summaryrefslogtreecommitdiff
path: root/cipher/twofish.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>1998-09-14 15:49:50 +0000
committerWerner Koch <wk@gnupg.org>1998-09-14 15:49:50 +0000
commit91e0657206cc084d6877d6da26e3475f8f82c612 (patch)
treef2928a468eaf4919e716cdd6896a1b2a2171c634 /cipher/twofish.c
parent4301e92fe95887a7ecab8206eb1ed7eea77a766c (diff)
downloadlibgcrypt-91e0657206cc084d6877d6da26e3475f8f82c612.tar.gz
New release
Diffstat (limited to 'cipher/twofish.c')
-rw-r--r--cipher/twofish.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/cipher/twofish.c b/cipher/twofish.c
index b244e952..d93c145e 100644
--- a/cipher/twofish.c
+++ b/cipher/twofish.c
@@ -29,7 +29,7 @@
static void selftest(void);
/* Macros used by the info function. */
-#define FNCCAST_SETKEY(f) ((void(*)(void*, byte*, unsigned))(f))
+#define FNCCAST_SETKEY(f) ((int(*)(void*, byte*, unsigned))(f))
#define FNCCAST_CRYPT(f) ((void(*)(void*, byte*, byte*))(f))
/* Structure for an expanded Twofish key. s contains the key-dependent
@@ -443,7 +443,7 @@ static const byte exp_to_poly[492] = {
/* Perform the key setup. Note that this works *only* with 128-bit keys,
* despite the API that makes it look like it might support other sizes. */
-static void
+static int
twofish_setkey (TWOFISH_context *ctx, const byte *key, const unsigned keylen)
{
/* Temporaries for CALC_K. */
@@ -577,6 +577,8 @@ twofish_setkey (TWOFISH_context *ctx, const byte *key, const unsigned keylen)
CALC_K (k, 26, 0x8B, 0xAE, 0x30, 0x5B);
CALC_K (k, 28, 0x84, 0x8A, 0x54, 0x00);
CALC_K (k, 30, 0xDF, 0xBC, 0x23, 0x9D);
+
+ return 0;
}
/* Macros to compute the g() function in the encryption and decryption
@@ -825,7 +827,7 @@ main()
static const char *
twofish_get_info (int algo, size_t *keylen,
size_t *blocksize, size_t *contextsize,
- void (**r_setkey) (void *c, byte *key, unsigned keylen),
+ int (**r_setkey) (void *c, byte *key, unsigned keylen),
void (**r_encrypt) (void *c, byte *outbuf, byte *inbuf),
void (**r_decrypt) (void *c, byte *outbuf, byte *inbuf)
)