3 void memxor(Byte *dest, const Byte *src, int l);
10 extern Tcl_ObjType blockcipherkey_type;
12 /* from algtables.c */
17 } BlockCipherPropInfo, HashAlgPropInfo;
21 int hashsize, blocksize, statesize;
22 void (*init)(void *state);
23 void (*update)(void *state, const void *data, int len);
24 void (*final)(void *state, void *digest);
25 void (*oneshot)(void *digest, const void *data, int len);
28 extern const HashAlgInfo hashalginfos[];
31 void (*make_schedule)(void *schedule, const void *key, int keylen);
32 void (*crypt)(const void *schedule, const void *in, void *out);
33 /* in and out may be the same, but if they aren't they may not overlap */
34 /* in and out for crypt will have been through block_byteswap */
35 } BlockCipherPerDirectionInfo;
39 int blocksize, schedule_size, key_min, key_max;
40 BlockCipherPerDirectionInfo encrypt, decrypt;
43 extern const BlockCipherAlgInfo blockcipheralginfos[];
49 int iv_blocks, buf_blocks, mac_blocks;
51 /* Each function is allowed to use up to buf_blocks * blocksize
52 * bytes of space in buf. data is blocks * blocksize bytes
53 * long. data should be modified in place by encrypt and decrypt;
54 * modes may not change the size of data. iv is always provided and
55 * is always of length iv_blocks * blocksize; encrypt and
56 * decrypt may modify the iv value (in which case the Tcl caller
57 * will get the modified IV) but this is not recommended. mac
58 * should leave the mac, which must be mac_blocks * blocksize
59 * bytes, in buf. (Therefore mac_blocks must be at least
62 const char *(*encrypt)(Byte *data, int nblocks,
63 const Byte *iv, Byte *buf,
64 const BlockCipherAlgInfo *alg, int encr,
66 const char *(*decrypt)(Byte *data, int nblocks,
67 const Byte *iv, Byte *buf,
68 const BlockCipherAlgInfo *alg, int encr,
70 const char *(*mac)(const Byte *data, int nblocks,
71 const Byte *iv, Byte *buf,
72 const BlockCipherAlgInfo *alg,
74 } BlockCipherModeInfo;
76 extern const BlockCipherModeInfo blockciphermodeinfos[];