author | zcarsten <zcarsten> | 2003-07-22 19:23:13 (UTC) |
---|---|---|
committer | zcarsten <zcarsten> | 2003-07-22 19:23:13 (UTC) |
commit | fa3772aa7ddea5725cc7e7db42d017567e4cc14c (patch) (unidiff) | |
tree | 112ec27dd148d0b381ac559fd3e1ee32a89ecd0d /noncore/apps/zsafe/krc2.h | |
parent | 059af0e82a14a32f068c2ad943dc918afca93587 (diff) | |
download | opie-fa3772aa7ddea5725cc7e7db42d017567e4cc14c.zip opie-fa3772aa7ddea5725cc7e7db42d017567e4cc14c.tar.gz opie-fa3772aa7ddea5725cc7e7db42d017567e4cc14c.tar.bz2 |
Initial revision
-rw-r--r-- | noncore/apps/zsafe/krc2.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/noncore/apps/zsafe/krc2.h b/noncore/apps/zsafe/krc2.h new file mode 100644 index 0000000..87b5d29 --- a/dev/null +++ b/noncore/apps/zsafe/krc2.h | |||
@@ -0,0 +1,35 @@ | |||
1 | /* | ||
2 | ** $Id$ | ||
3 | */ | ||
4 | |||
5 | #ifndef _KRC2_H_ | ||
6 | #define _KRC2_H_ | ||
7 | |||
8 | /* Header file for rc2 implementation by Matthew Palmer <mjp16@uow.edu.au> */ | ||
9 | |||
10 | class Krc2 | ||
11 | { | ||
12 | public: | ||
13 | Krc2(); | ||
14 | ~Krc2(); | ||
15 | |||
16 | /* Externally worked functions */ | ||
17 | void rc2_expandkey(char key[], int length, int ekl); | ||
18 | void rc2_encrypt(unsigned short *input); | ||
19 | void rc2_decrypt(unsigned short *input); | ||
20 | |||
21 | private: | ||
22 | /* The internals */ | ||
23 | void _rc2_mix(unsigned short *input); | ||
24 | void _rc2_mash(unsigned short *input); | ||
25 | void _rc2_rmix(unsigned short *input); | ||
26 | void _rc2_rmash(unsigned short *input); | ||
27 | int _rc2_pow(int base, int exponent); | ||
28 | unsigned short _rc2_ror(unsigned short input, int places); | ||
29 | unsigned short _rc2_rol(unsigned short input, int places); | ||
30 | |||
31 | }; | ||
32 | #endif // _KRC2_H_ | ||
33 | |||
34 | |||
35 | |||