cryptopp 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (157) hide show
  1. data/.gitignore +8 -0
  2. data/MIT-LICENSE +22 -0
  3. data/README +7 -0
  4. data/Rakefile +42 -0
  5. data/cryptopp.gemspec +199 -0
  6. data/ext/.gitignore +5 -0
  7. data/ext/Rakefile +16 -0
  8. data/ext/ciphers.cpp +1402 -0
  9. data/ext/cryptopp.cpp +285 -0
  10. data/ext/cryptopp_ruby_api.h +139 -0
  11. data/ext/defs/block_modes.def +10 -0
  12. data/ext/defs/checksums.def +10 -0
  13. data/ext/defs/ciphers.def +136 -0
  14. data/ext/defs/hashes.def +78 -0
  15. data/ext/defs/hmacs.def +54 -0
  16. data/ext/defs/paddings.def +9 -0
  17. data/ext/defs/rngs.def +7 -0
  18. data/ext/digests.cpp +1120 -0
  19. data/ext/extconf.rb +39 -0
  20. data/ext/j3way.cpp +22 -0
  21. data/ext/j3way.h +29 -0
  22. data/ext/jadler32.h +32 -0
  23. data/ext/jaes.cpp +22 -0
  24. data/ext/jaes.h +31 -0
  25. data/ext/jarc4.cpp +22 -0
  26. data/ext/jarc4.h +37 -0
  27. data/ext/jbase.cpp +172 -0
  28. data/ext/jbase.h +92 -0
  29. data/ext/jbasiccipherinfo.h +74 -0
  30. data/ext/jblowfish.cpp +22 -0
  31. data/ext/jblowfish.h +29 -0
  32. data/ext/jcamellia.cpp +24 -0
  33. data/ext/jcamellia.h +33 -0
  34. data/ext/jcast128.cpp +22 -0
  35. data/ext/jcast128.h +31 -0
  36. data/ext/jcast256.cpp +22 -0
  37. data/ext/jcast256.h +31 -0
  38. data/ext/jcipher.cpp +112 -0
  39. data/ext/jcipher.h +42 -0
  40. data/ext/jcipher_t.h +469 -0
  41. data/ext/jconfig.h +127 -0
  42. data/ext/jconstants.h +189 -0
  43. data/ext/jcrc32.h +32 -0
  44. data/ext/jdes.cpp +22 -0
  45. data/ext/jdes.h +31 -0
  46. data/ext/jdes_ede2.cpp +22 -0
  47. data/ext/jdes_ede2.h +31 -0
  48. data/ext/jdes_ede3.cpp +22 -0
  49. data/ext/jdes_ede3.h +31 -0
  50. data/ext/jdes_xex3.cpp +22 -0
  51. data/ext/jdes_xex3.h +31 -0
  52. data/ext/jdiamond2.cpp +22 -0
  53. data/ext/jdiamond2.h +31 -0
  54. data/ext/jdiamond2lite.cpp +22 -0
  55. data/ext/jdiamond2lite.h +31 -0
  56. data/ext/jexception.h +20 -0
  57. data/ext/jgost.cpp +22 -0
  58. data/ext/jgost.h +31 -0
  59. data/ext/jhash.cpp +92 -0
  60. data/ext/jhash.h +54 -0
  61. data/ext/jhash_t.h +121 -0
  62. data/ext/jhaval.h +64 -0
  63. data/ext/jhelpers.cpp +90 -0
  64. data/ext/jhelpers.h +38 -0
  65. data/ext/jhmac.cpp +44 -0
  66. data/ext/jhmac.h +34 -0
  67. data/ext/jhmac_t.h +125 -0
  68. data/ext/jidea.cpp +22 -0
  69. data/ext/jidea.h +31 -0
  70. data/ext/jmarc4.cpp +22 -0
  71. data/ext/jmarc4.h +37 -0
  72. data/ext/jmars.cpp +22 -0
  73. data/ext/jmars.h +31 -0
  74. data/ext/jmd2.h +56 -0
  75. data/ext/jmd4.h +56 -0
  76. data/ext/jmd5.h +56 -0
  77. data/ext/jpanamacipher.cpp +32 -0
  78. data/ext/jpanamacipher.h +46 -0
  79. data/ext/jpanamahash.h +44 -0
  80. data/ext/jrc2.cpp +44 -0
  81. data/ext/jrc2.h +39 -0
  82. data/ext/jrc5.cpp +22 -0
  83. data/ext/jrc5.h +31 -0
  84. data/ext/jrc6.cpp +22 -0
  85. data/ext/jrc6.h +31 -0
  86. data/ext/jripemd160.h +113 -0
  87. data/ext/jsafer.cpp +32 -0
  88. data/ext/jsafer.h +42 -0
  89. data/ext/jseal.cpp +32 -0
  90. data/ext/jseal.h +42 -0
  91. data/ext/jserpent.cpp +22 -0
  92. data/ext/jserpent.h +31 -0
  93. data/ext/jsha.h +122 -0
  94. data/ext/jshacal2.cpp +22 -0
  95. data/ext/jshacal2.h +31 -0
  96. data/ext/jshark.cpp +24 -0
  97. data/ext/jshark.h +33 -0
  98. data/ext/jsink.cpp +90 -0
  99. data/ext/jsink.h +154 -0
  100. data/ext/jskipjack.cpp +22 -0
  101. data/ext/jskipjack.h +31 -0
  102. data/ext/jsquare.cpp +22 -0
  103. data/ext/jsquare.h +31 -0
  104. data/ext/jstream.cpp +8 -0
  105. data/ext/jstream.h +20 -0
  106. data/ext/jstream_t.h +175 -0
  107. data/ext/jtea.cpp +22 -0
  108. data/ext/jtea.h +31 -0
  109. data/ext/jtiger.h +52 -0
  110. data/ext/jtwofish.cpp +22 -0
  111. data/ext/jtwofish.h +31 -0
  112. data/ext/jwhirlpool.h +52 -0
  113. data/ext/utils.cpp +8 -0
  114. data/extras/parser_c.rb +114 -0
  115. data/test/ciphers_test.rb +37 -0
  116. data/test/data/ciphers/3desval.dat +7 -0
  117. data/test/data/ciphers/3wayval.dat +6 -0
  118. data/test/data/ciphers/arc4.dat +8 -0
  119. data/test/data/ciphers/blowfish.dat +5 -0
  120. data/test/data/ciphers/camellia.dat +7 -0
  121. data/test/data/ciphers/cast128v.dat +5 -0
  122. data/test/data/ciphers/cast256v.dat +5 -0
  123. data/test/data/ciphers/descert.dat +198 -0
  124. data/test/data/ciphers/diamond.dat +9 -0
  125. data/test/data/ciphers/gostval.dat +10 -0
  126. data/test/data/ciphers/ideaval.dat +13 -0
  127. data/test/data/ciphers/marsval.dat +11 -0
  128. data/test/data/ciphers/panamac.dat +7 -0
  129. data/test/data/ciphers/rc2val.dat +10 -0
  130. data/test/data/ciphers/rc5val.dat +7 -0
  131. data/test/data/ciphers/rc6val.dat +8 -0
  132. data/test/data/ciphers/rijndael.dat +11 -0
  133. data/test/data/ciphers/saferval.dat +27 -0
  134. data/test/data/ciphers/seal.dat +3 -0
  135. data/test/data/ciphers/serpentv.dat +11 -0
  136. data/test/data/ciphers/shacal2.dat +7 -0
  137. data/test/data/ciphers/sharkval.dat +9 -0
  138. data/test/data/ciphers/skipjack.dat +3 -0
  139. data/test/data/ciphers/squareva.dat +10 -0
  140. data/test/data/ciphers/twofishv.dat +11 -0
  141. data/test/data/digests/adler32.dat +8 -0
  142. data/test/data/digests/crc32.dat +10 -0
  143. data/test/data/digests/haval.dat +4 -0
  144. data/test/data/digests/havalcer.dat +23 -0
  145. data/test/data/digests/md2.dat +9 -0
  146. data/test/data/digests/md4.dat +9 -0
  147. data/test/data/digests/md5.dat +9 -0
  148. data/test/data/digests/panamah.dat +8 -0
  149. data/test/data/digests/ripemd.dat +43 -0
  150. data/test/data/digests/sha.dat +19 -0
  151. data/test/data/digests/tiger.dat +11 -0
  152. data/test/data/digests/whirlpool.dat +13 -0
  153. data/test/data/hmacs/hmac.dat +6 -0
  154. data/test/digests_test.rb +29 -0
  155. data/test/hmacs_test.rb +38 -0
  156. data/test/test_helper.rb +42 -0
  157. metadata +220 -0
@@ -0,0 +1,44 @@
1
+
2
+ /*
3
+ * Copyright (c) 2002-2010 J Smith <dark.panda@gmail.com>
4
+ * Crypto++ copyright (c) 1995-2010 Wei Dai
5
+ * See COPYING for the extact license
6
+ */
7
+
8
+ #include "jrc2.h"
9
+
10
+ #if ENABLED_RC2_CIPHER
11
+
12
+ JRC2::JRC2()
13
+ {
14
+ itsEffectiveKeylength = RC2_Info::DEFAULT_EFFECTIVE_KEYLENGTH;
15
+ }
16
+
17
+ unsigned int JRC2::setEffectiveKeylength(const unsigned int keylength)
18
+ {
19
+ if (keylength > RC2_Info::MAX_EFFECTIVE_KEYLENGTH) {
20
+ itsEffectiveKeylength = RC2_Info::MAX_EFFECTIVE_KEYLENGTH;
21
+ }
22
+ else {
23
+ itsEffectiveKeylength = keylength;
24
+ }
25
+
26
+ return itsEffectiveKeylength;
27
+ }
28
+
29
+ unsigned int JRC2::getEffectiveKeylength() const
30
+ {
31
+ return itsEffectiveKeylength;
32
+ }
33
+
34
+ BlockCipher* JRC2::getEncryptionObject()
35
+ {
36
+ return new RC2Encryption((byte*) itsKey.data(), itsKeylength, itsEffectiveKeylength);
37
+ }
38
+
39
+ BlockCipher* JRC2::getDecryptionObject()
40
+ {
41
+ return new RC2Decryption((byte*) itsKey.data(), itsKeylength, itsEffectiveKeylength);
42
+ }
43
+
44
+ #endif
@@ -0,0 +1,39 @@
1
+
2
+ /*
3
+ * Copyright (c) 2002-2010 J Smith <dark.panda@gmail.com>
4
+ * Crypto++ copyright (c) 1995-2010 Wei Dai
5
+ * See COPYING for the extact license
6
+ */
7
+
8
+ #ifndef __JRC2_H__
9
+ #define __JRC2_H__
10
+
11
+ #include "jconfig.h"
12
+
13
+ #if ENABLED_RC2_CIPHER
14
+
15
+ #include "jcipher_t.h"
16
+
17
+ // Crypto++ headers...
18
+
19
+ #include "rc2.h"
20
+
21
+ using namespace CryptoPP;
22
+
23
+ class JRC2 : public JCipher_Template<RC2_Info, RC2_CIPHER>
24
+ {
25
+ public:
26
+ JRC2();
27
+
28
+ unsigned int setEffectiveKeylength(const unsigned int keylength);
29
+ unsigned int getEffectiveKeylength() const;
30
+
31
+ protected:
32
+ BlockCipher* getEncryptionObject();
33
+ BlockCipher* getDecryptionObject();
34
+
35
+ unsigned int itsEffectiveKeylength;
36
+ };
37
+
38
+ #endif
39
+ #endif
@@ -0,0 +1,22 @@
1
+
2
+ /*
3
+ * Copyright (c) 2002-2010 J Smith <dark.panda@gmail.com>
4
+ * Crypto++ copyright (c) 1995-2010 Wei Dai
5
+ * See COPYING for the extact license
6
+ */
7
+
8
+ #include "jrc5.h"
9
+
10
+ #if ENABLED_RC5_CIPHER
11
+
12
+ BlockCipher* JRC5::getEncryptionObject()
13
+ {
14
+ return new RC5Encryption((byte*) itsKey.data(), itsKeylength, itsRounds);
15
+ }
16
+
17
+ BlockCipher* JRC5::getDecryptionObject()
18
+ {
19
+ return new RC5Decryption((byte*) itsKey.data(), itsKeylength, itsRounds);
20
+ }
21
+
22
+ #endif
@@ -0,0 +1,31 @@
1
+
2
+ /*
3
+ * Copyright (c) 2002-2010 J Smith <dark.panda@gmail.com>
4
+ * Crypto++ copyright (c) 1995-2010 Wei Dai
5
+ * See COPYING for the extact license
6
+ */
7
+
8
+ #ifndef __JRC5_H__
9
+ #define __JRC5_H__
10
+
11
+ #include "jconfig.h"
12
+
13
+ #if ENABLED_RC5_CIPHER
14
+
15
+ #include "jcipher_t.h"
16
+
17
+ // Crypto++ headers...
18
+
19
+ #include "rc5.h"
20
+
21
+ using namespace CryptoPP;
22
+
23
+ class JRC5 : public JCipher_Template<RC5_Info, RC5_CIPHER, 16, 1, INT_MAX>
24
+ {
25
+ protected:
26
+ BlockCipher* getEncryptionObject();
27
+ BlockCipher* getDecryptionObject();
28
+ };
29
+
30
+ #endif
31
+ #endif
@@ -0,0 +1,22 @@
1
+
2
+ /*
3
+ * Copyright (c) 2002-2010 J Smith <dark.panda@gmail.com>
4
+ * Crypto++ copyright (c) 1995-2010 Wei Dai
5
+ * See COPYING for the extact license
6
+ */
7
+
8
+ #include "jrc6.h"
9
+
10
+ #if ENABLED_RC6_CIPHER
11
+
12
+ BlockCipher* JRC6::getEncryptionObject()
13
+ {
14
+ return new RC6Encryption((byte*) itsKey.data(), itsKeylength);
15
+ }
16
+
17
+ BlockCipher* JRC6::getDecryptionObject()
18
+ {
19
+ return new RC6Decryption((byte*) itsKey.data(), itsKeylength);
20
+ }
21
+
22
+ #endif
@@ -0,0 +1,31 @@
1
+
2
+ /*
3
+ * Copyright (c) 2002-2010 J Smith <dark.panda@gmail.com>
4
+ * Crypto++ copyright (c) 1995-2010 Wei Dai
5
+ * See COPYING for the extact license
6
+ */
7
+
8
+ #ifndef __JRC6_H__
9
+ #define __JRC6_H__
10
+
11
+ #include "jconfig.h"
12
+
13
+ #if ENABLED_RC6_CIPHER
14
+
15
+ #include "jcipher_t.h"
16
+
17
+ // Crypto++ headers...
18
+
19
+ #include "rc6.h"
20
+
21
+ using namespace CryptoPP;
22
+
23
+ class JRC6 : public JCipher_Template<RC6_Info, RC6_CIPHER, 20, 1, INT_MAX>
24
+ {
25
+ protected:
26
+ BlockCipher* getEncryptionObject();
27
+ BlockCipher* getDecryptionObject();
28
+ };
29
+
30
+ #endif
31
+ #endif
@@ -0,0 +1,113 @@
1
+
2
+ /*
3
+ * Copyright (c) 2002-2010 J Smith <dark.panda@gmail.com>
4
+ * Crypto++ copyright (c) 1995-2010 Wei Dai
5
+ * See COPYING for the extact license
6
+ */
7
+
8
+ #ifndef __JRIPEMD160_H__
9
+ #define __JRIPEMD160_H__
10
+
11
+ #include "jconfig.h"
12
+
13
+ #if ENABLED_RIPEMD128_HASH || ENABLED_RIPEMD160_HASH || ENABLED_RIPEMD256_HASH || ENABLED_RIPEMD320_HASH || \
14
+ ENABLED_RIPEMD128_HMAC || ENABLED_RIPEMD160_HMAC || ENABLED_RIPEMD256_HMAC || ENABLED_RIPEMD320_HMAC
15
+
16
+ #if ENABLED_RIPEMD128_HASH || ENABLED_RIPEMD160_HASH || ENABLED_RIPEMD256_HASH || ENABLED_RIPEMD320_HASH
17
+ #include "jhash_t.h"
18
+ #endif
19
+
20
+ #if ENABLED_RIPEMD128_HMAC || ENABLED_RIPEMD160_HMAC || ENABLED_RIPEMD256_HMAC || ENABLED_RIPEMD320_HMAC
21
+ #include "jhmac_t.h"
22
+ #endif
23
+
24
+ // Crypto++ headers...
25
+
26
+ #include "ripemd.h"
27
+
28
+ using namespace CryptoPP;
29
+
30
+ #if ENABLED_RIPEMD128_HASH
31
+ class JRIPEMD128 : public JHash_Template<RIPEMD128, RIPEMD128_HASH>
32
+ {
33
+ public:
34
+ JRIPEMD128(string plaintext = "") : JHash_Template<RIPEMD128, RIPEMD128_HASH>(plaintext) { }
35
+
36
+ static string getHashName() { return "RIPEMD-128"; }
37
+ };
38
+ #endif
39
+
40
+ #if ENABLED_RIPEMD160_HASH
41
+ class JRIPEMD160 : public JHash_Template<RIPEMD160, RIPEMD160_HASH>
42
+ {
43
+ public:
44
+ JRIPEMD160(string plaintext = "") : JHash_Template<RIPEMD160, RIPEMD160_HASH>(plaintext) { }
45
+
46
+ static string getHashName() { return "RIPEMD-160"; }
47
+ };
48
+ #endif
49
+
50
+ #if ENABLED_RIPEMD256_HASH
51
+ class JRIPEMD256 : public JHash_Template<RIPEMD256, RIPEMD256_HASH>
52
+ {
53
+ public:
54
+ JRIPEMD256(string plaintext = "") : JHash_Template<RIPEMD256, RIPEMD256_HASH>(plaintext) { }
55
+
56
+ static string getHashName() { return "RIPEMD-256"; }
57
+ };
58
+ #endif
59
+
60
+ #if ENABLED_RIPEMD320_HASH
61
+ class JRIPEMD320 : public JHash_Template<RIPEMD320, RIPEMD320_HASH>
62
+ {
63
+ public:
64
+ JRIPEMD320(string plaintext = "") : JHash_Template<RIPEMD320, RIPEMD320_HASH>(plaintext) { }
65
+
66
+ static string getHashName() { return "RIPEMD-320"; }
67
+ };
68
+ #endif
69
+
70
+
71
+
72
+ #if ENABLED_RIPEMD128_HMAC
73
+ class JRIPEMD128_HMAC : public JHMAC_Template<RIPEMD128, RIPEMD128_HMAC>
74
+ {
75
+ public:
76
+ JRIPEMD128_HMAC(string plaintext = "") : JHMAC_Template<RIPEMD128, RIPEMD128_HMAC>(plaintext) { }
77
+
78
+ static string getHashName() { return "RIPEMD-128-HMAC"; }
79
+ };
80
+ #endif
81
+
82
+ #if ENABLED_RIPEMD160_HMAC
83
+ class JRIPEMD160_HMAC : public JHMAC_Template<RIPEMD160, RIPEMD160_HMAC>
84
+ {
85
+ public:
86
+ JRIPEMD160_HMAC(string plaintext = "") : JHMAC_Template<RIPEMD160, RIPEMD160_HMAC>(plaintext) { }
87
+
88
+ static string getHashName() { return "RIPEMD-160-HMAC"; }
89
+ };
90
+ #endif
91
+
92
+ #if ENABLED_RIPEMD256_HMAC
93
+ class JRIPEMD256_HMAC : public JHMAC_Template<RIPEMD256, RIPEMD256_HMAC>
94
+ {
95
+ public:
96
+ JRIPEMD256_HMAC(string plaintext = "") : JHMAC_Template<RIPEMD256, RIPEMD256_HMAC>(plaintext) { }
97
+
98
+ static string getHashName() { return "RIPEMD-256-HMAC"; }
99
+ };
100
+ #endif
101
+
102
+ #if ENABLED_RIPEMD320_HMAC
103
+ class JRIPEMD320_HMAC : public JHMAC_Template<RIPEMD320, RIPEMD320_HMAC>
104
+ {
105
+ public:
106
+ JRIPEMD320_HMAC(string plaintext = "") : JHMAC_Template<RIPEMD320, RIPEMD320_HMAC>(plaintext) { }
107
+
108
+ static string getHashName() { return "RIPEMD-320-HMAC"; }
109
+ };
110
+ #endif
111
+
112
+ #endif
113
+ #endif
@@ -0,0 +1,32 @@
1
+
2
+ /*
3
+ * Copyright (c) 2002-2010 J Smith <dark.panda@gmail.com>
4
+ * Crypto++ copyright (c) 1995-2010 Wei Dai
5
+ * See COPYING for the extact license
6
+ */
7
+
8
+ #include "jsafer.h"
9
+
10
+ #if ENABLED_SAFER_K_CIPHER
11
+ BlockCipher* JSAFER_K::getEncryptionObject()
12
+ {
13
+ return new SAFER_K_Encryption((byte*) itsKey.data(), itsKeylength, itsRounds);
14
+ }
15
+
16
+ BlockCipher* JSAFER_K::getDecryptionObject()
17
+ {
18
+ return new SAFER_K_Decryption((byte*) itsKey.data(), itsKeylength, itsRounds);
19
+ }
20
+ #endif
21
+
22
+ #if ENABLED_SAFER_SK_CIPHER
23
+ BlockCipher* JSAFER_SK::getEncryptionObject()
24
+ {
25
+ return new SAFER_SK_Encryption((byte*) itsKey.data(), itsKeylength, itsRounds);
26
+ }
27
+
28
+ BlockCipher* JSAFER_SK::getDecryptionObject()
29
+ {
30
+ return new SAFER_SK_Decryption((byte*) itsKey.data(), itsKeylength, itsRounds);
31
+ }
32
+ #endif
@@ -0,0 +1,42 @@
1
+
2
+ /*
3
+ * Copyright (c) 2002-2010 J Smith <dark.panda@gmail.com>
4
+ * Crypto++ copyright (c) 1995-2010 Wei Dai
5
+ * See COPYING for the extact license
6
+ */
7
+
8
+ #ifndef __JSAFER_H__
9
+ #define __JSAFER_H__
10
+
11
+ #include "jconfig.h"
12
+
13
+ #if ENABLED_SAFER_K_CIPHER || ENABLED_SAFER_SAFER_SK_CIPHER
14
+
15
+ #include "jcipher_t.h"
16
+
17
+ // Crypto++ headers...
18
+
19
+ #include "safer.h"
20
+
21
+ using namespace CryptoPP;
22
+
23
+ #if ENABLED_SAFER_K_CIPHER
24
+ class JSAFER_K : public JCipher_Template<SAFER_K_Info, SAFER_K_CIPHER, 6, 1, 13>
25
+ {
26
+ protected:
27
+ BlockCipher* getEncryptionObject();
28
+ BlockCipher* getDecryptionObject();
29
+ };
30
+ #endif
31
+
32
+ #if ENABLED_SAFER_SK_CIPHER
33
+ class JSAFER_SK : public JCipher_Template<SAFER_SK_Info, SAFER_SK_CIPHER, 6, 1, 13>
34
+ {
35
+ protected:
36
+ BlockCipher* getEncryptionObject();
37
+ BlockCipher* getDecryptionObject();
38
+ };
39
+ #endif
40
+
41
+ #endif
42
+ #endif
@@ -0,0 +1,32 @@
1
+
2
+ /*
3
+ * Copyright (c) 2002-2010 J Smith <dark.panda@gmail.com>
4
+ * Crypto++ copyright (c) 1995-2010 Wei Dai
5
+ * See COPYING for the extact license
6
+ */
7
+
8
+ #include "jseal.h"
9
+
10
+ #if ENABLED_SEAL_LITTLE_ENDIAN_CIPHER
11
+ SymmetricCipher* JSEAL_LE::getEncryptionObject()
12
+ {
13
+ return new SEAL<LittleEndian>::Encryption((byte*) itsKey.data(), itsKeylength, (byte*) itsIV.data());
14
+ }
15
+
16
+ SymmetricCipher* JSEAL_LE::getDecryptionObject()
17
+ {
18
+ return getEncryptionObject();
19
+ }
20
+ #endif
21
+
22
+ #if ENABLED_SEAL_BIG_ENDIAN_CIPHER
23
+ SymmetricCipher* JSEAL_BE::getEncryptionObject()
24
+ {
25
+ return new SEAL<BigEndian>::Encryption((byte*) itsKey.data(), itsKeylength, (byte*) itsIV.data());
26
+ }
27
+
28
+ SymmetricCipher* JSEAL_BE::getDecryptionObject()
29
+ {
30
+ return getEncryptionObject();
31
+ }
32
+ #endif
@@ -0,0 +1,42 @@
1
+
2
+ /*
3
+ * Copyright (c) 2002-2010 J Smith <dark.panda@gmail.com>
4
+ * Crypto++ copyright (c) 1995-2010 Wei Dai
5
+ * See COPYING for the extact license
6
+ */
7
+
8
+ #ifndef __JSEAL_H__
9
+ #define __JSEAL_H__
10
+
11
+ #include "jconfig.h"
12
+
13
+ #if ENABLED_SEAL_LITTLE_ENDIAN_CIPHER || ENABLED_SEAL_BIG_ENDIAN_CIPHER
14
+
15
+ #include "jstream_t.h"
16
+
17
+ // Crypto++ headers...
18
+
19
+ #include "seal.h"
20
+
21
+ using namespace CryptoPP;
22
+
23
+ #if ENABLED_SEAL_LITTLE_ENDIAN_CIPHER
24
+ class JSEAL_LE : public JStream_Template<SEAL_Info<LittleEndian>, SEAL_LITTLE_ENDIAN_CIPHER>
25
+ {
26
+ protected:
27
+ SymmetricCipher* getEncryptionObject();
28
+ SymmetricCipher* getDecryptionObject();
29
+ };
30
+ #endif
31
+
32
+ #if ENABLED_SEAL_BIG_ENDIAN_CIPHER
33
+ class JSEAL_BE : public JStream_Template<SEAL_Info<BigEndian>, SEAL_BIG_ENDIAN_CIPHER>
34
+ {
35
+ protected:
36
+ SymmetricCipher* getEncryptionObject();
37
+ SymmetricCipher* getDecryptionObject();
38
+ };
39
+ #endif
40
+
41
+ #endif
42
+ #endif