1 /* crypto-null.c --- NULL crypto functions
2 * Copyright (C) 2002, 2003, 2004, 2007 Simon Josefsson
4 * This file is part of Shishi.
6 * Shishi is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 3 of the License, or
9 * (at your option) any later version.
11 * Shishi is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with Shishi; if not, see http://www.gnu.org/licenses or write
18 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
19 * Floor, Boston, MA 02110-1301, USA
28 null_encrypt (Shishi
* handle
,
31 const char *iv
, size_t ivlen
,
32 char **ivout
, size_t * ivoutlen
,
33 const char *in
, size_t inlen
, char **out
, size_t * outlen
)
36 *out
= xmalloc (*outlen
);
37 memcpy (*out
, in
, inlen
);
48 null_decrypt (Shishi
* handle
,
51 const char *iv
, size_t ivlen
,
52 char **ivout
, size_t * ivoutlen
,
53 const char *in
, size_t inlen
, char **out
, size_t * outlen
)
56 *out
= xmalloc (*outlen
);
57 memcpy (*out
, in
, inlen
);
68 null_random_to_key (Shishi
* handle
,
69 const char *rnd
, size_t rndlen
, Shishi_key
* outkey
)
75 null_string_to_key (Shishi
* handle
,
76 const char *password
, size_t passwordlen
,
77 const char *salt
, size_t saltlen
,
78 const char *parameter
, Shishi_key
* outkey
)
83 cipherinfo null_info
= {