diff options
author | Werner Koch <wk@gnupg.org> | 2000-07-14 17:34:52 +0000 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2000-07-14 17:34:52 +0000 |
commit | 74386120dad6b3da62db37f7044267c8ef34689b (patch) | |
tree | 16fc58b6817d55a9556192a064d573ea8a174a93 /cipher/twofish.c | |
parent | eef468f4897c6d46fe46c2a9635151e2257e3dd1 (diff) | |
download | libgcrypt-74386120dad6b3da62db37f7044267c8ef34689b.tar.gz |
See ChangeLog: Fri Jul 14 19:38:23 CEST 2000 Werner Koch
Diffstat (limited to 'cipher/twofish.c')
-rw-r--r-- | cipher/twofish.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/cipher/twofish.c b/cipher/twofish.c index 1eea4b8e..5766021c 100644 --- a/cipher/twofish.c +++ b/cipher/twofish.c @@ -34,10 +34,6 @@ /* Prototype for the self-test function. */ static const char *selftest(void); -/* Macros used by the info function. */ -#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 * S-boxes composed with the MDS matrix; w contains the eight "whitening" * subkeys, K[0] through K[7]. k holds the remaining, "round" subkeys. Note @@ -990,16 +986,20 @@ twofish_get_info (int algo, size_t *keylen, *keylen = algo==10? 256 : 128; *blocksize = 16; *contextsize = sizeof (TWOFISH_context); - *r_setkey = FNCCAST_SETKEY (twofish_setkey); - *r_encrypt= FNCCAST_CRYPT (twofish_encrypt); - *r_decrypt= FNCCAST_CRYPT (twofish_decrypt); - - if( algo == 10 ) - return "TWOFISH"; - if (algo == 102) /* This algorithm number is assigned for - * experiments, so we can use it */ - return "TWOFISH128"; - return NULL; + + *(int (**)(TWOFISH_context*, const byte*, const unsigned))r_setkey + = twofish_setkey; + *(void (**)(const TWOFISH_context*, byte*, const byte*))r_encrypt + = twofish_encrypt; + *(void (**)(const TWOFISH_context*, byte*, const byte*))r_decrypt + = twofish_decrypt; + + if( algo == 10 ) + return "TWOFISH"; + if (algo == 102) /* This algorithm number is assigned for + * experiments, so we can use it */ + return "TWOFISH128"; + return NULL; } |