X-Git-Url: http://git.silcnet.org/gitweb/?a=blobdiff_plain;f=lib%2Fsilccrypt%2Ftwofish_internal.h;h=716e0edf64927230cee6c13e3ffb39b9a2cee618;hb=9f20f0382b6229eca740925a73f96294f6dcedc6;hp=0cabe2c400e4f3c8ff521a6562c9674d8736534f;hpb=62f89b2886bbe9df82d9b2fdabfe707509d9e0fc;p=crypto.git diff --git a/lib/silccrypt/twofish_internal.h b/lib/silccrypt/twofish_internal.h index 0cabe2c4..716e0edf 100644 --- a/lib/silccrypt/twofish_internal.h +++ b/lib/silccrypt/twofish_internal.h @@ -2,15 +2,14 @@ twofish_internal.h - Author: Pekka Riikonen + Author: Pekka Riikonen - Copyright (C) 1997 - 2000 Pekka Riikonen + Copyright (C) 2008 Pekka Riikonen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - + the Free Software Foundation; version 2 of the License. + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -25,17 +24,17 @@ /* Cipher's context */ typedef struct { - u4byte k_len; - u4byte l_key[40]; - u4byte s_key[4]; -} TwofishContext; + SilcUInt32 S[4][256]; + SilcUInt32 K[40]; + SilcUInt32 padlen; +} twofish_key; /* Prototypes */ -u4byte *twofish_set_key(TwofishContext *ctx, - const u4byte in_key[], const u4byte key_len); -void twofish_encrypt(TwofishContext *ctx, - const u4byte in_blk[4], u4byte out_blk[]); -void twofish_decrypt(TwofishContext *ctx, - const u4byte in_blk[4], u4byte out_blk[4]); - -#endif +int twofish_setup(const unsigned char *key, int keylen, int num_rounds, + twofish_key *skey); +int twofish_encrypt(const SilcUInt32 pt[4], SilcUInt32 ct[4], + twofish_key *skey); +int twofish_decrypt(const SilcUInt32 ct[4], SilcUInt32 pt[4], + twofish_key *skey); + +#endif /* TWOFISH_INTERNAL_H */