1 /* 2 * cast5.h 3 * Definitions for CAST5 cipher 4 * 5 * Copyright 2002-2004 by Bob Mathews 6 * 7 * This library is free software; you can redistribute it and/or modify 8 * it under the same terms as Perl itself. 9 */ 10 11 #include <EXTERN.h> 12 #include <perl.h> 13 14 typedef struct cast5_state { 15 int rounds; 16 U32 mask_key[16]; 17 int rot_key[16]; 18 } *Crypt__CAST5; 19 20 extern const U32 cast5_s1[256]; 21 extern const U32 cast5_s2[256]; 22 extern const U32 cast5_s3[256]; 23 extern const U32 cast5_s4[256]; 24 extern const U32 cast5_s5[256]; 25 extern const U32 cast5_s6[256]; 26 extern const U32 cast5_s7[256]; 27 extern const U32 cast5_s8[256]; 28 29 #define S1 cast5_s1 30 #define S2 cast5_s2 31 #define S3 cast5_s3 32 #define S4 cast5_s4 33 #define S5 cast5_s5 34 #define S6 cast5_s6 35 #define S7 cast5_s7 36 #define S8 cast5_s8 37 38 void cast5_init(struct cast5_state *cast5, char *key, int keylen); 39 void cast5_encrypt(struct cast5_state *cast5, char *in, char *out); 40 void cast5_decrypt(struct cast5_state *cast5, char *in, char *out); 41 42 /* end cast5.h */ 43