cryptopp 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +4 -0
- data/Gemfile +14 -0
- data/Guardfile +17 -0
- data/MIT-LICENSE +1 -1
- data/Rakefile +20 -27
- data/VERSION +1 -0
- data/cryptopp.gemspec +7 -182
- data/ext/Rakefile +2 -2
- data/ext/ciphers.cpp +619 -619
- data/ext/cryptopp.cpp +220 -217
- data/ext/cryptopp_ruby_api.h +7 -7
- data/ext/defs/hashes.def +16 -0
- data/ext/defs/hmacs.def +16 -0
- data/ext/digests.cpp +635 -601
- data/ext/extconf.rb +61 -19
- data/ext/j3way.cpp +5 -5
- data/ext/j3way.h +6 -6
- data/ext/jadler32.h +6 -6
- data/ext/jaes.cpp +5 -5
- data/ext/jaes.h +6 -6
- data/ext/jarc4.cpp +5 -5
- data/ext/jarc4.h +6 -6
- data/ext/jbase.cpp +94 -94
- data/ext/jbase.h +49 -55
- data/ext/jbasiccipherinfo.h +23 -23
- data/ext/jblowfish.cpp +5 -5
- data/ext/jblowfish.h +6 -6
- data/ext/jcamellia.cpp +5 -7
- data/ext/jcamellia.h +6 -8
- data/ext/jcast128.cpp +5 -5
- data/ext/jcast128.h +6 -6
- data/ext/jcast256.cpp +5 -5
- data/ext/jcast256.h +6 -6
- data/ext/jcipher.cpp +62 -62
- data/ext/jcipher.h +24 -24
- data/ext/jcipher_t.h +383 -383
- data/ext/jconfig.h +29 -46
- data/ext/jconstants.h +120 -122
- data/ext/jcrc32.h +6 -6
- data/ext/jdes.cpp +5 -5
- data/ext/jdes.h +6 -6
- data/ext/jdes_ede2.cpp +5 -5
- data/ext/jdes_ede2.h +6 -6
- data/ext/jdes_ede3.cpp +5 -5
- data/ext/jdes_ede3.h +6 -6
- data/ext/jdes_xex3.cpp +5 -5
- data/ext/jdes_xex3.h +6 -6
- data/ext/jdiamond2.cpp +5 -5
- data/ext/jdiamond2.h +6 -6
- data/ext/jdiamond2lite.cpp +5 -5
- data/ext/jdiamond2lite.h +6 -6
- data/ext/jexception.h +5 -5
- data/ext/jgost.cpp +5 -5
- data/ext/jgost.h +6 -6
- data/ext/jhash.cpp +51 -51
- data/ext/jhash.h +22 -27
- data/ext/jhash_t.h +59 -59
- data/ext/jhaval.h +15 -15
- data/ext/jhelpers.cpp +54 -54
- data/ext/jhelpers.h +3 -3
- data/ext/jhmac.cpp +20 -20
- data/ext/jhmac.h +15 -15
- data/ext/jhmac_t.h +40 -72
- data/ext/jidea.cpp +5 -5
- data/ext/jidea.h +6 -6
- data/ext/jmarc4.cpp +5 -5
- data/ext/jmarc4.h +6 -6
- data/ext/jmars.cpp +5 -5
- data/ext/jmars.h +6 -6
- data/ext/jmd2.h +9 -9
- data/ext/jmd4.h +9 -9
- data/ext/jmd5.h +9 -9
- data/ext/jpanamacipher.cpp +7 -7
- data/ext/jpanamacipher.h +9 -9
- data/ext/jpanamahash.h +9 -9
- data/ext/jrc2.cpp +15 -15
- data/ext/jrc2.h +11 -11
- data/ext/jrc5.cpp +5 -5
- data/ext/jrc5.h +6 -6
- data/ext/jrc6.cpp +5 -5
- data/ext/jrc6.h +6 -6
- data/ext/jripemd160.h +28 -28
- data/ext/jsafer.cpp +7 -7
- data/ext/jsafer.h +9 -9
- data/ext/jseal.cpp +7 -7
- data/ext/jseal.h +9 -9
- data/ext/jserpent.cpp +5 -5
- data/ext/jserpent.h +6 -6
- data/ext/jsha.h +38 -37
- data/ext/jsha3.h +130 -0
- data/ext/jsha3_blocksizes.h +73 -0
- data/ext/jshacal2.cpp +5 -5
- data/ext/jshacal2.h +6 -6
- data/ext/jshark.cpp +5 -7
- data/ext/jshark.h +6 -8
- data/ext/jsink.cpp +57 -57
- data/ext/jsink.h +127 -123
- data/ext/jskipjack.cpp +5 -5
- data/ext/jskipjack.h +6 -6
- data/ext/jsquare.cpp +5 -5
- data/ext/jsquare.h +6 -6
- data/ext/jstream.cpp +3 -3
- data/ext/jstream.h +3 -3
- data/ext/jstream_t.h +74 -126
- data/ext/jtea.cpp +5 -5
- data/ext/jtea.h +6 -6
- data/ext/jtiger.h +9 -11
- data/ext/jtwofish.cpp +5 -5
- data/ext/jtwofish.h +6 -6
- data/ext/jwhirlpool.h +9 -11
- data/ext/utils.cpp +3 -3
- data/extras/parser_c.rb +102 -102
- data/test/ciphers_test.rb +24 -30
- data/test/data/ciphers/3desval.yml +13 -0
- data/test/data/ciphers/3wayval.yml +17 -0
- data/test/data/ciphers/arc4.yml +22 -0
- data/test/data/ciphers/blowfish.yml +9 -0
- data/test/data/ciphers/camellia.yml +21 -0
- data/test/data/ciphers/cast128v.yml +13 -0
- data/test/data/ciphers/cast256v.yml +13 -0
- data/test/data/ciphers/descert.yml +723 -0
- data/test/data/ciphers/diamond.yml +31 -0
- data/test/data/ciphers/gostval.yml +33 -0
- data/test/data/ciphers/ideaval.yml +45 -0
- data/test/data/ciphers/marsval.yml +37 -0
- data/test/data/ciphers/panamac.yml +11 -0
- data/test/data/ciphers/rc2val.yml +49 -0
- data/test/data/ciphers/rc5val.yml +26 -0
- data/test/data/ciphers/rc6val.yml +25 -0
- data/test/data/ciphers/rijndael.yml +37 -0
- data/test/data/ciphers/saferval.yml +77 -0
- data/test/data/ciphers/seal.yml +6 -0
- data/test/data/ciphers/serpentv.yml +37 -0
- data/test/data/ciphers/shacal2.yml +21 -0
- data/test/data/ciphers/sharkval.yml +29 -0
- data/test/data/ciphers/skipjack.yml +5 -0
- data/test/data/ciphers/squareva.yml +33 -0
- data/test/data/ciphers/twofishv.yml +37 -0
- data/test/data/digests/adler32.yml +19 -0
- data/test/data/digests/crc32.yml +25 -0
- data/test/data/digests/haval.yml +7 -0
- data/test/data/digests/havalcer.yml +1 -0
- data/test/data/digests/md2.yml +22 -0
- data/test/data/digests/md4.yml +22 -0
- data/test/data/digests/md5.yml +22 -0
- data/test/data/digests/panamah.yml +13 -0
- data/test/data/digests/ripemd.yml +97 -0
- data/test/data/digests/sha.yml +25 -0
- data/test/data/digests/sha3.yml +23 -0
- data/test/data/digests/tiger.yml +30 -0
- data/test/data/digests/whirlpool.yml +25 -0
- data/test/data/hmacs/hmac.yml +14 -0
- data/test/digests_test.rb +17 -23
- data/test/hmacs_test.rb +25 -31
- data/test/test_helper.rb +31 -37
- metadata +70 -82
- data/test/data/ciphers/3desval.dat +0 -7
- data/test/data/ciphers/3wayval.dat +0 -6
- data/test/data/ciphers/arc4.dat +0 -8
- data/test/data/ciphers/blowfish.dat +0 -5
- data/test/data/ciphers/camellia.dat +0 -7
- data/test/data/ciphers/cast128v.dat +0 -5
- data/test/data/ciphers/cast256v.dat +0 -5
- data/test/data/ciphers/descert.dat +0 -198
- data/test/data/ciphers/diamond.dat +0 -9
- data/test/data/ciphers/gostval.dat +0 -10
- data/test/data/ciphers/ideaval.dat +0 -13
- data/test/data/ciphers/marsval.dat +0 -11
- data/test/data/ciphers/panamac.dat +0 -7
- data/test/data/ciphers/rc2val.dat +0 -10
- data/test/data/ciphers/rc5val.dat +0 -7
- data/test/data/ciphers/rc6val.dat +0 -8
- data/test/data/ciphers/rijndael.dat +0 -11
- data/test/data/ciphers/saferval.dat +0 -27
- data/test/data/ciphers/seal.dat +0 -3
- data/test/data/ciphers/serpentv.dat +0 -11
- data/test/data/ciphers/shacal2.dat +0 -7
- data/test/data/ciphers/sharkval.dat +0 -9
- data/test/data/ciphers/skipjack.dat +0 -3
- data/test/data/ciphers/squareva.dat +0 -10
- data/test/data/ciphers/twofishv.dat +0 -11
- data/test/data/digests/adler32.dat +0 -8
- data/test/data/digests/crc32.dat +0 -10
- data/test/data/digests/haval.dat +0 -4
- data/test/data/digests/havalcer.dat +0 -23
- data/test/data/digests/md2.dat +0 -9
- data/test/data/digests/md4.dat +0 -9
- data/test/data/digests/md5.dat +0 -9
- data/test/data/digests/panamah.dat +0 -8
- data/test/data/digests/ripemd.dat +0 -43
- data/test/data/digests/sha.dat +0 -19
- data/test/data/digests/tiger.dat +0 -11
- data/test/data/digests/whirlpool.dat +0 -13
- data/test/data/hmacs/hmac.dat +0 -6
data/ext/cryptopp.cpp
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
|
2
2
|
/*
|
3
|
-
* Copyright (c) 2002-
|
4
|
-
* Crypto++ copyright (c) 1995-
|
5
|
-
* See
|
3
|
+
* Copyright (c) 2002-2014 J Smith <dark.panda@gmail.com>
|
4
|
+
* Crypto++ copyright (c) 1995-2013 Wei Dai
|
5
|
+
* See MIT-LICENSE for the extact license
|
6
6
|
*/
|
7
7
|
|
8
8
|
#include "ruby.h"
|
@@ -26,19 +26,19 @@ VALUE rb_cCryptoPP_Digest;
|
|
26
26
|
VALUE rb_cCryptoPP_Digest_HMAC;
|
27
27
|
|
28
28
|
#define CIPHER_ALGORITHM_X(klass, r, c, s) \
|
29
|
-
|
29
|
+
VALUE rb_cCryptoPP_Cipher_ ## r ;
|
30
30
|
#include "defs/ciphers.def"
|
31
31
|
|
32
32
|
#define CHECKSUM_ALGORITHM_X(klass, r, c, s) \
|
33
|
-
|
33
|
+
VALUE rb_cCryptoPP_Digest_ ## r ;
|
34
34
|
#include "defs/checksums.def"
|
35
35
|
|
36
36
|
#define HASH_ALGORITHM_X(klass, r, c, s) \
|
37
|
-
|
37
|
+
VALUE rb_cCryptoPP_Digest_ ## r ;
|
38
38
|
#include "defs/hashes.def"
|
39
39
|
|
40
40
|
#define HMAC_ALGORITHM_X(klass, r, c, s) \
|
41
|
-
|
41
|
+
VALUE rb_cCryptoPP_Digest_HMAC_ ## r ;
|
42
42
|
#include "defs/hmacs.def"
|
43
43
|
|
44
44
|
/* Marking function for garbage collector. */
|
@@ -49,7 +49,7 @@ void cipher_mark(JBase *c)
|
|
49
49
|
/* Free up memory. */
|
50
50
|
void cipher_free(JBase *c)
|
51
51
|
{
|
52
|
-
|
52
|
+
delete c;
|
53
53
|
}
|
54
54
|
|
55
55
|
/* Marking function for garbage collector. */
|
@@ -60,226 +60,229 @@ void hash_mark (JHash *c)
|
|
60
60
|
/* Free up memory. */
|
61
61
|
void hash_free (JHash *c)
|
62
62
|
{
|
63
|
-
|
63
|
+
delete c;
|
64
64
|
}
|
65
65
|
|
66
66
|
|
67
67
|
#define CRYPTOPP_VALUE_FUNC(f) \
|
68
|
-
|
68
|
+
RUBY_METHOD_FUNC(f)
|
69
69
|
#define CRYPTOPP_DEFINE_CONST(klass, n, c) \
|
70
|
-
|
70
|
+
rb_define_const(klass, n, INT2NUM(c));
|
71
71
|
#define CRYPTOPP_MODULE_METHOD(m, n, f, a) \
|
72
|
-
|
72
|
+
rb_define_module_function(m, n, CRYPTOPP_VALUE_FUNC(f), a);
|
73
73
|
#define CRYPTOPP_CLASS_METHOD(c, n, f, a) \
|
74
|
-
|
74
|
+
rb_define_method(rb_cCryptoPP_ ## c, n, CRYPTOPP_VALUE_FUNC(f), a);
|
75
75
|
#define CRYPTOPP_MODULE_METHOD_ALIAS(m, n, o) \
|
76
|
-
|
76
|
+
rb_define_alias(rb_singleton_class(m), n, o);
|
77
77
|
#define CRYPTOPP_CLASS_METHOD_ALIAS(c, n, o) \
|
78
|
-
|
78
|
+
rb_define_alias(rb_cCryptoPP_ ## c, n, o);
|
79
79
|
|
80
80
|
/* The extension initialization function. */
|
81
81
|
extern "C" void Init_cryptopp()
|
82
82
|
{
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
#
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
#
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
#
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
#
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
#
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
83
|
+
/**
|
84
|
+
* This is the main CryptoPP module. All of the various Cipher, Digest
|
85
|
+
* and HMAC classes are found here.
|
86
|
+
*
|
87
|
+
* The CryptoPP module contains a handful of module methods that can be
|
88
|
+
* used to create new ciphers, digests and HMACs and provide information
|
89
|
+
* on the environment and configuration CryptoPP is running with.
|
90
|
+
*/
|
91
|
+
rb_mCryptoPP = rb_define_module("CryptoPP");
|
92
|
+
|
93
|
+
/**
|
94
|
+
* Exception class.
|
95
|
+
*/
|
96
|
+
rb_eCryptoPP_Error = rb_define_class_under(rb_mCryptoPP, "CryptoPPError", rb_eStandardError);
|
97
|
+
|
98
|
+
/**
|
99
|
+
* The base cipher class. This class is not meant to be used directly. It
|
100
|
+
* merely serves as the base class for all CryptoPP ciphers.
|
101
|
+
*
|
102
|
+
* Ciphers can be created either by using the
|
103
|
+
* <tt>CryptoPP#cipher_factory</tt> factory method or by instantiating
|
104
|
+
* the classes directly. For instance, the following are equivalent:
|
105
|
+
*
|
106
|
+
* cipher = CryptoPP.cipher_factory(:aes)
|
107
|
+
* cipher = CryptoPP::AES.new
|
108
|
+
*
|
109
|
+
* Options include:
|
110
|
+
*
|
111
|
+
* * <tt>:plaintext</tt> and <tt>:plaintext_hex</tt> - set the plaintext. You
|
112
|
+
* can only use one at a time.
|
113
|
+
* * <tt>:ciphertext</tt> and <tt>:ciphertext_hex</tt> - set the ciphertext.
|
114
|
+
* You can only use one at a time.
|
115
|
+
* * <tt>:key</tt> and <tt>:key_hex</tt> - set the key. You can only use one
|
116
|
+
* at a time.
|
117
|
+
* * <tt>:key_length</tt> - set the length of the key. Normally this is done
|
118
|
+
* automatically, but you can force a different key length if necessary.
|
119
|
+
* * <tt>:effective_key_length</tt> - sets the effective key length on RC2
|
120
|
+
* ciphers.
|
121
|
+
* * <tt>:rounds</tt> - sets the number of rounds a cipher performs on
|
122
|
+
* block ciphers that support them.
|
123
|
+
* * <tt>:rng</tt> - sets the random number generator to be used for things
|
124
|
+
* like creating initialization vectors and such. Not all operating
|
125
|
+
* systems and environments will support all RNGs. You can check which
|
126
|
+
* ones are supported with <tt>CryptoPP#rng_available?</tt>. Possible
|
127
|
+
* values are :blocking, :non_blocking and :rand.
|
128
|
+
*
|
129
|
+
* All of these options have their equivalent setter and getter methods
|
130
|
+
* if you need to modify them after initialization.
|
131
|
+
*/
|
132
|
+
rb_cCryptoPP_Cipher = rb_define_class_under(rb_mCryptoPP, "Cipher", rb_cObject);
|
133
|
+
|
134
|
+
/**
|
135
|
+
* The base Digest class. This class is not meant to be used directly. It
|
136
|
+
* merely serves as the base class for all CryptoPP Digests and HMACs.
|
137
|
+
*/
|
138
|
+
rb_cCryptoPP_Digest = rb_define_class_under(rb_mCryptoPP, "Digest", rb_cObject);
|
139
|
+
|
140
|
+
/**
|
141
|
+
* The base HMAC class. This class is not meant to be used directly. It
|
142
|
+
* merely serves as the base class for all CryptoPP HMACs.
|
143
|
+
*/
|
144
|
+
rb_cCryptoPP_Digest_HMAC = rb_define_class_under(rb_mCryptoPP, "HMAC", rb_cCryptoPP_Digest);
|
145
|
+
|
146
|
+
rb_undef_alloc_func(rb_cCryptoPP_Cipher);
|
147
|
+
rb_undef_alloc_func(rb_cCryptoPP_Digest);
|
148
|
+
rb_undef_alloc_func(rb_cCryptoPP_Digest_HMAC);
|
149
|
+
|
150
|
+
# define XCRYPTOPP_EXT_VERSION(s) #s
|
151
|
+
# define CRYPTOPP_EXT_VERSION(s) XCRYPTOPP_EXT_VERSION(s)
|
152
|
+
|
153
|
+
rb_define_const(rb_mCryptoPP, "VERSION", rb_str_new2(CRYPTOPP_EXT_VERSION(EXT_VERSION_CODE)));
|
154
|
+
rb_define_const(rb_mCryptoPP, "CRYPTOPP_VERSION", INT2NUM(CRYPTOPP_VERSION));
|
155
|
+
|
156
|
+
# define CIPHER_ALGORITHM_X(klass, r, c, s) \
|
157
|
+
rb_cCryptoPP_Cipher_ ## r = rb_define_class_under(rb_mCryptoPP, # klass, rb_cCryptoPP_Cipher); \
|
158
|
+
rb_define_singleton_method((rb_cCryptoPP_Cipher_ ## r), "new", CRYPTOPP_VALUE_FUNC(rb_cipher_ ## r ##_new), -1);
|
159
|
+
# include "defs/ciphers.def"
|
160
|
+
|
161
|
+
# define CHECKSUM_ALGORITHM_X(klass, r, c, s) \
|
162
|
+
rb_cCryptoPP_Digest_ ## r = rb_define_class_under(rb_mCryptoPP, # klass, rb_cCryptoPP_Digest); \
|
163
|
+
rb_define_singleton_method((rb_cCryptoPP_Digest_ ## r), "new", CRYPTOPP_VALUE_FUNC(rb_digest_ ## r ##_new), -1);
|
164
|
+
# include "defs/checksums.def"
|
165
|
+
|
166
|
+
# define HASH_ALGORITHM_X(klass, r, c, s) \
|
167
|
+
rb_cCryptoPP_Digest_ ## r = rb_define_class_under(rb_mCryptoPP, # klass, rb_cCryptoPP_Digest); \
|
168
|
+
rb_define_singleton_method((rb_cCryptoPP_Digest_ ## r), "new", CRYPTOPP_VALUE_FUNC(rb_digest_ ## r ##_new), -1);
|
169
|
+
# include "defs/hashes.def"
|
170
|
+
|
171
|
+
# define HMAC_ALGORITHM_X(klass, r, c, s) \
|
172
|
+
rb_cCryptoPP_Digest_HMAC_ ## r = rb_define_class_under(rb_mCryptoPP, # klass, rb_cCryptoPP_Digest_HMAC); \
|
173
|
+
rb_define_singleton_method((rb_cCryptoPP_Digest_HMAC_ ## r), "new", CRYPTOPP_VALUE_FUNC(rb_digest_hmac_ ## r ##_new), -1);
|
174
|
+
# include "defs/hmacs.def"
|
175
|
+
|
176
|
+
rb_define_module_function(rb_mCryptoPP, "cipher_list", RUBY_METHOD_FUNC(rb_module_cipher_list), 0); /* in ciphers.cpp */
|
177
|
+
rb_define_module_function(rb_mCryptoPP, "cipher_name", RUBY_METHOD_FUNC(rb_module_cipher_name), 1); /* in ciphers.cpp */
|
178
|
+
rb_define_module_function(rb_mCryptoPP, "block_mode_name", RUBY_METHOD_FUNC(rb_module_block_mode_name), 1); /* in ciphers.cpp */
|
179
|
+
rb_define_module_function(rb_mCryptoPP, "padding_name", RUBY_METHOD_FUNC(rb_module_padding_name), 1); /* in ciphers.cpp */
|
180
|
+
rb_define_module_function(rb_mCryptoPP, "rng_name", RUBY_METHOD_FUNC(rb_module_rng_name), 1); /* in ciphers.cpp */
|
181
|
+
rb_define_module_function(rb_mCryptoPP, "cipher_enabled?", RUBY_METHOD_FUNC(rb_module_cipher_enabled), 1); /* in ciphers.cpp */
|
182
|
+
rb_define_module_function(rb_mCryptoPP, "rng_available?", RUBY_METHOD_FUNC(rb_module_rng_available), 1); /* in ciphers.cpp */
|
183
|
+
|
184
|
+
rb_define_module_function(rb_mCryptoPP, "cipher_factory", RUBY_METHOD_FUNC(rb_module_cipher_factory), -1); /* in ciphers.cpp */
|
185
|
+
rb_define_module_function(rb_mCryptoPP, "digest_factory", RUBY_METHOD_FUNC(rb_module_digest_factory), -1); /* in digests.cpp */
|
186
|
+
rb_define_module_function(rb_mCryptoPP, "hmac_factory", RUBY_METHOD_FUNC(rb_module_hmac_factory), -1); /* in digests.cpp */
|
187
|
+
|
188
|
+
rb_define_module_function(rb_mCryptoPP, "digest_enabled?", RUBY_METHOD_FUNC(rb_module_digest_enabled), 1); /* in digests.cpp */
|
189
|
+
rb_define_module_function(rb_mCryptoPP, "digest_name", RUBY_METHOD_FUNC(rb_module_digest_name), 1); /* in digests.cpp */
|
190
|
+
rb_define_module_function(rb_mCryptoPP, "digest_list", RUBY_METHOD_FUNC(rb_module_digest_list), 0); /* in digests.cpp */
|
191
|
+
|
192
|
+
rb_define_alias(rb_singleton_class(rb_mCryptoPP), "hash_enabled?", "digest_enabled?");
|
193
|
+
rb_define_alias(rb_singleton_class(rb_mCryptoPP), "hash_name", "digest_name");
|
194
|
+
rb_define_alias(rb_singleton_class(rb_mCryptoPP), "hash_list", "digest_list");
|
195
|
+
|
196
|
+
rb_define_module_function(rb_mCryptoPP, "digest", RUBY_METHOD_FUNC(rb_module_digest), -1); /* in digests.cpp */
|
197
|
+
rb_define_module_function(rb_mCryptoPP, "digest_hex", RUBY_METHOD_FUNC(rb_module_digest_hex), -1); /* in digests.cpp */
|
198
|
+
|
199
|
+
rb_define_alias(rb_singleton_class(rb_mCryptoPP), "hexdigest", "digest_hex");
|
200
|
+
|
201
|
+
rb_define_module_function(rb_mCryptoPP, "digest_io", RUBY_METHOD_FUNC(rb_module_digest_io), -1); /* in digests.cpp */
|
202
|
+
rb_define_module_function(rb_mCryptoPP, "digest_io_hex", RUBY_METHOD_FUNC(rb_module_digest_io_hex), -1); /* in digests.cpp */
|
203
|
+
|
204
|
+
rb_define_module_function(rb_mCryptoPP, "digest_hmac", RUBY_METHOD_FUNC(rb_module_hmac_digest), -1); /* in digests.cpp */
|
205
|
+
rb_define_module_function(rb_mCryptoPP, "digest_hmac_hex", RUBY_METHOD_FUNC(rb_module_hmac_digest_hex), -1); /* in digests.cpp */
|
206
|
+
rb_define_module_function(rb_mCryptoPP, "hmac_list", RUBY_METHOD_FUNC(rb_module_hmac_list), 0); /* in digests.cpp */
|
207
|
+
|
208
|
+
rb_define_method(rb_cCryptoPP_Cipher, "rand_iv", RUBY_METHOD_FUNC(rb_cipher_rand_iv), 1); /* in ciphers.cpp */
|
209
|
+
rb_define_method(rb_cCryptoPP_Cipher, "iv=", RUBY_METHOD_FUNC(rb_cipher_iv_eq), 1); /* in ciphers.cpp */
|
210
|
+
rb_define_method(rb_cCryptoPP_Cipher, "iv_hex=", RUBY_METHOD_FUNC(rb_cipher_iv_hex_eq), 1); /* in ciphers.cpp */
|
211
|
+
rb_define_method(rb_cCryptoPP_Cipher, "iv", RUBY_METHOD_FUNC(rb_cipher_iv), 0); /* in ciphers.cpp */
|
212
|
+
rb_define_method(rb_cCryptoPP_Cipher, "iv_hex", RUBY_METHOD_FUNC(rb_cipher_iv_hex), 0); /* in ciphers.cpp */
|
213
|
+
rb_define_method(rb_cCryptoPP_Cipher, "block_mode=", RUBY_METHOD_FUNC(rb_cipher_block_mode_eq), 1); /* in ciphers.cpp */
|
214
|
+
rb_define_method(rb_cCryptoPP_Cipher, "block_mode", RUBY_METHOD_FUNC(rb_cipher_block_mode), 0); /* in ciphers.cpp */
|
215
|
+
rb_define_method(rb_cCryptoPP_Cipher, "padding=", RUBY_METHOD_FUNC(rb_cipher_padding_eq), 1); /* in ciphers.cpp */
|
216
|
+
rb_define_method(rb_cCryptoPP_Cipher, "padding", RUBY_METHOD_FUNC(rb_cipher_padding), 0); /* in ciphers.cpp */
|
217
|
+
rb_define_method(rb_cCryptoPP_Cipher, "rng=", RUBY_METHOD_FUNC(rb_cipher_rng_eq), 1); /* in ciphers.cpp */
|
218
|
+
rb_define_method(rb_cCryptoPP_Cipher, "rng", RUBY_METHOD_FUNC(rb_cipher_rng), 0); /* in ciphers.cpp */
|
219
|
+
rb_define_method(rb_cCryptoPP_Cipher, "plaintext=", RUBY_METHOD_FUNC(rb_cipher_plaintext_eq), 1); /* in ciphers.cpp */
|
220
|
+
rb_define_method(rb_cCryptoPP_Cipher, "plaintext_hex=", RUBY_METHOD_FUNC(rb_cipher_plaintext_hex_eq), 1); /* in ciphers.cpp */
|
221
|
+
rb_define_method(rb_cCryptoPP_Cipher, "plaintext", RUBY_METHOD_FUNC(rb_cipher_plaintext), 0); /* in ciphers.cpp */
|
222
|
+
rb_define_method(rb_cCryptoPP_Cipher, "plaintext_hex", RUBY_METHOD_FUNC(rb_cipher_plaintext_hex), 0); /* in ciphers.cpp */
|
223
|
+
rb_define_method(rb_cCryptoPP_Cipher, "ciphertext=", RUBY_METHOD_FUNC(rb_cipher_ciphertext_eq), 1); /* in ciphers.cpp */
|
224
|
+
rb_define_method(rb_cCryptoPP_Cipher, "ciphertext_hex=", RUBY_METHOD_FUNC(rb_cipher_ciphertext_hex_eq), 1); /* in ciphers.cpp */
|
225
|
+
rb_define_method(rb_cCryptoPP_Cipher, "ciphertext", RUBY_METHOD_FUNC(rb_cipher_ciphertext), 0); /* in ciphers.cpp */
|
226
|
+
rb_define_method(rb_cCryptoPP_Cipher, "ciphertext_hex", RUBY_METHOD_FUNC(rb_cipher_ciphertext_hex), 0); /* in ciphers.cpp */
|
227
|
+
rb_define_method(rb_cCryptoPP_Cipher, "key=", RUBY_METHOD_FUNC(rb_cipher_key_eq), 1); /* in ciphers.cpp */
|
228
|
+
rb_define_method(rb_cCryptoPP_Cipher, "key_hex=", RUBY_METHOD_FUNC(rb_cipher_key_hex_eq), 1); /* in ciphers.cpp */
|
229
|
+
rb_define_method(rb_cCryptoPP_Cipher, "key", RUBY_METHOD_FUNC(rb_cipher_key), 0); /* in ciphers.cpp */
|
230
|
+
rb_define_method(rb_cCryptoPP_Cipher, "key_hex", RUBY_METHOD_FUNC(rb_cipher_key_hex), 0); /* in ciphers.cpp */
|
231
|
+
rb_define_method(rb_cCryptoPP_Cipher, "key_length=", RUBY_METHOD_FUNC(rb_cipher_key_length_eq), 1); /* in ciphers.cpp */
|
232
|
+
rb_define_method(rb_cCryptoPP_Cipher, "key_length", RUBY_METHOD_FUNC(rb_cipher_key_length), 0); /* in ciphers.cpp */
|
233
|
+
rb_define_method(rb_cCryptoPP_Cipher, "default_key_length", RUBY_METHOD_FUNC(rb_cipher_default_key_length), 0); /* in ciphers.cpp */
|
234
|
+
rb_define_method(rb_cCryptoPP_Cipher, "max_key_length", RUBY_METHOD_FUNC(rb_cipher_max_key_length), 0); /* in ciphers.cpp */
|
235
|
+
rb_define_method(rb_cCryptoPP_Cipher, "min_key_length", RUBY_METHOD_FUNC(rb_cipher_min_key_length), 0); /* in ciphers.cpp */
|
236
|
+
rb_define_method(rb_cCryptoPP_Cipher, "mult_key_length", RUBY_METHOD_FUNC(rb_cipher_mult_key_length), 0); /* in ciphers.cpp */
|
237
|
+
rb_define_method(rb_cCryptoPP_Cipher, "valid_key_length", RUBY_METHOD_FUNC(rb_cipher_valid_key_length), 1); /* in ciphers.cpp */
|
238
|
+
# if ENABLED_RC2_CIPHER
|
239
|
+
rb_define_method(rb_cCryptoPP_Cipher_RC2, "effective_key_length=", RUBY_METHOD_FUNC(rb_cipher_effective_key_length_eq), 1); /* in ciphers.cpp */
|
240
|
+
rb_define_method(rb_cCryptoPP_Cipher_RC2, "effective_key_length", RUBY_METHOD_FUNC(rb_cipher_effective_key_length), 0); /* in ciphers.cpp */
|
241
|
+
# endif
|
242
|
+
rb_define_method(rb_cCryptoPP_Cipher, "block_size", RUBY_METHOD_FUNC(rb_cipher_block_size), 1); /* in ciphers.cpp */
|
243
|
+
rb_define_method(rb_cCryptoPP_Cipher, "rounds=", RUBY_METHOD_FUNC(rb_cipher_rounds_eq), 1); /* in ciphers.cpp */
|
244
|
+
rb_define_method(rb_cCryptoPP_Cipher, "rounds", RUBY_METHOD_FUNC(rb_cipher_rounds), 0); /* in ciphers.cpp */
|
245
|
+
rb_define_method(rb_cCryptoPP_Cipher, "algorithm_name", RUBY_METHOD_FUNC(rb_cipher_algorithm_name), 0); /* in ciphers.cpp */
|
246
|
+
rb_define_method(rb_cCryptoPP_Cipher, "block_mode_name", RUBY_METHOD_FUNC(rb_cipher_block_mode_name), 0); /* in ciphers.cpp */
|
247
|
+
rb_define_method(rb_cCryptoPP_Cipher, "padding_name", RUBY_METHOD_FUNC(rb_cipher_padding_name), 0); /* in ciphers.cpp */
|
248
|
+
rb_define_method(rb_cCryptoPP_Cipher, "rng_name", RUBY_METHOD_FUNC(rb_cipher_rng_name), 0); /* in ciphers.cpp */
|
249
|
+
rb_define_method(rb_cCryptoPP_Cipher, "cipher_type", RUBY_METHOD_FUNC(rb_cipher_cipher_type), 0); /* in ciphers.cpp */
|
250
|
+
rb_define_method(rb_cCryptoPP_Cipher, "encrypt", RUBY_METHOD_FUNC(rb_cipher_encrypt), 0); /* in ciphers.cpp */
|
251
|
+
rb_define_method(rb_cCryptoPP_Cipher, "encrypt_hex", RUBY_METHOD_FUNC(rb_cipher_encrypt_hex), 0); /* in ciphers.cpp */
|
252
|
+
rb_define_method(rb_cCryptoPP_Cipher, "decrypt", RUBY_METHOD_FUNC(rb_cipher_decrypt), 0); /* in ciphers.cpp */
|
253
|
+
rb_define_method(rb_cCryptoPP_Cipher, "decrypt_hex", RUBY_METHOD_FUNC(rb_cipher_decrypt_hex), 0); /* in ciphers.cpp */
|
254
|
+
rb_define_method(rb_cCryptoPP_Cipher, "encrypt_io", RUBY_METHOD_FUNC(rb_cipher_encrypt_io), 2); /* in ciphers.cpp */
|
255
|
+
rb_define_method(rb_cCryptoPP_Cipher, "decrypt_io", RUBY_METHOD_FUNC(rb_cipher_decrypt_io), 2); /* in ciphers.cpp */
|
256
|
+
|
257
|
+
rb_define_method(rb_cCryptoPP_Digest, "digest", RUBY_METHOD_FUNC(rb_digest_digest), 0); /* in digests.cpp */
|
258
|
+
rb_define_method(rb_cCryptoPP_Digest, "digest_hex", RUBY_METHOD_FUNC(rb_digest_digest_hex), 0); /* in digests.cpp */
|
259
|
+
rb_define_method(rb_cCryptoPP_Digest, "digest=", RUBY_METHOD_FUNC(rb_digest_digest_eq), 1); /* in digests.cpp */
|
260
|
+
rb_define_method(rb_cCryptoPP_Digest, "digest_hex=", RUBY_METHOD_FUNC(rb_digest_digest_hex_eq), 1); /* in digests.cpp */
|
261
|
+
rb_define_method(rb_cCryptoPP_Digest, "plaintext", RUBY_METHOD_FUNC(rb_digest_plaintext), 0); /* in digests.cpp */
|
262
|
+
rb_define_method(rb_cCryptoPP_Digest, "plaintext=", RUBY_METHOD_FUNC(rb_digest_plaintext_eq), 1); /* in digests.cpp */
|
263
|
+
rb_define_method(rb_cCryptoPP_Digest, "plaintext_hex", RUBY_METHOD_FUNC(rb_digest_plaintext_hex), 0); /* in digests.cpp */
|
264
|
+
rb_define_method(rb_cCryptoPP_Digest, "plaintext_hex=", RUBY_METHOD_FUNC(rb_digest_plaintext_hex_eq), 1); /* in digests.cpp */
|
265
|
+
rb_define_method(rb_cCryptoPP_Digest, "calculate", RUBY_METHOD_FUNC(rb_digest_calculate), 0); /* in digests.cpp */
|
266
|
+
rb_define_method(rb_cCryptoPP_Digest, "calculate_hex", RUBY_METHOD_FUNC(rb_digest_calculate_hex), 0); /* in digests.cpp */
|
267
|
+
rb_define_method(rb_cCryptoPP_Digest, "digest_io", RUBY_METHOD_FUNC(rb_digest_digest_io), 1); /* in digests.cpp */
|
268
|
+
rb_define_method(rb_cCryptoPP_Digest, "digest_io_hex", RUBY_METHOD_FUNC(rb_digest_digest_io_hex), 1); /* in digests.cpp */
|
269
|
+
rb_define_method(rb_cCryptoPP_Digest, "update", RUBY_METHOD_FUNC(rb_digest_update), 1); /* in digests.cpp */
|
270
|
+
rb_define_method(rb_cCryptoPP_Digest, "to_s", RUBY_METHOD_FUNC(rb_digest_digest_hex), 0); /* in digests.cpp */
|
271
|
+
rb_define_method(rb_cCryptoPP_Digest, "inspect", RUBY_METHOD_FUNC(rb_digest_inspect), 0); /* in digests.cpp */
|
272
|
+
rb_define_method(rb_cCryptoPP_Digest, "==", RUBY_METHOD_FUNC(rb_digest_equals), 1); /* in digests.cpp */
|
273
|
+
rb_define_method(rb_cCryptoPP_Digest, "algorithm_name", RUBY_METHOD_FUNC(rb_digest_algorithm_name), 0); /* in digests.cpp */
|
274
|
+
rb_define_method(rb_cCryptoPP_Digest, "clear", RUBY_METHOD_FUNC(rb_digest_clear), 0); /* in digests.cpp */
|
275
|
+
rb_define_method(rb_cCryptoPP_Digest, "validate", RUBY_METHOD_FUNC(rb_digest_validate), 0); /* in digests.cpp */
|
276
|
+
|
277
|
+
rb_define_alias(rb_cCryptoPP_Digest, "hexdigest", "digest_hex");
|
278
|
+
rb_define_alias(rb_cCryptoPP_Digest, "hexdigest=", "digest_hex=");
|
279
|
+
rb_define_alias(rb_cCryptoPP_Digest, "<<", "update");
|
280
|
+
rb_define_alias(rb_cCryptoPP_Digest, "valid?", "validate");
|
281
|
+
|
282
|
+
rb_define_method(rb_cCryptoPP_Digest_HMAC, "key=", RUBY_METHOD_FUNC(rb_digest_hmac_key_eq), 1); /* in digests.cpp */
|
283
|
+
rb_define_method(rb_cCryptoPP_Digest_HMAC, "key_hex=", RUBY_METHOD_FUNC(rb_digest_hmac_key_hex_eq), 1); /* in digests.cpp */
|
284
|
+
rb_define_method(rb_cCryptoPP_Digest_HMAC, "key", RUBY_METHOD_FUNC(rb_digest_hmac_key), 0); /* in digests.cpp */
|
285
|
+
rb_define_method(rb_cCryptoPP_Digest_HMAC, "key_hex", RUBY_METHOD_FUNC(rb_digest_hmac_key_hex), 0); /* in digests.cpp */
|
286
|
+
rb_define_method(rb_cCryptoPP_Digest_HMAC, "key_length=", RUBY_METHOD_FUNC(rb_digest_hmac_key_length_eq), 1); /* in digests.cpp */
|
287
|
+
rb_define_method(rb_cCryptoPP_Digest_HMAC, "key_length", RUBY_METHOD_FUNC(rb_digest_hmac_key_length), 0); /* in digests.cpp */
|
285
288
|
}
|