cryptopp 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +8 -0
- data/MIT-LICENSE +22 -0
- data/README +7 -0
- data/Rakefile +42 -0
- data/cryptopp.gemspec +199 -0
- data/ext/.gitignore +5 -0
- data/ext/Rakefile +16 -0
- data/ext/ciphers.cpp +1402 -0
- data/ext/cryptopp.cpp +285 -0
- data/ext/cryptopp_ruby_api.h +139 -0
- data/ext/defs/block_modes.def +10 -0
- data/ext/defs/checksums.def +10 -0
- data/ext/defs/ciphers.def +136 -0
- data/ext/defs/hashes.def +78 -0
- data/ext/defs/hmacs.def +54 -0
- data/ext/defs/paddings.def +9 -0
- data/ext/defs/rngs.def +7 -0
- data/ext/digests.cpp +1120 -0
- data/ext/extconf.rb +39 -0
- data/ext/j3way.cpp +22 -0
- data/ext/j3way.h +29 -0
- data/ext/jadler32.h +32 -0
- data/ext/jaes.cpp +22 -0
- data/ext/jaes.h +31 -0
- data/ext/jarc4.cpp +22 -0
- data/ext/jarc4.h +37 -0
- data/ext/jbase.cpp +172 -0
- data/ext/jbase.h +92 -0
- data/ext/jbasiccipherinfo.h +74 -0
- data/ext/jblowfish.cpp +22 -0
- data/ext/jblowfish.h +29 -0
- data/ext/jcamellia.cpp +24 -0
- data/ext/jcamellia.h +33 -0
- data/ext/jcast128.cpp +22 -0
- data/ext/jcast128.h +31 -0
- data/ext/jcast256.cpp +22 -0
- data/ext/jcast256.h +31 -0
- data/ext/jcipher.cpp +112 -0
- data/ext/jcipher.h +42 -0
- data/ext/jcipher_t.h +469 -0
- data/ext/jconfig.h +127 -0
- data/ext/jconstants.h +189 -0
- data/ext/jcrc32.h +32 -0
- data/ext/jdes.cpp +22 -0
- data/ext/jdes.h +31 -0
- data/ext/jdes_ede2.cpp +22 -0
- data/ext/jdes_ede2.h +31 -0
- data/ext/jdes_ede3.cpp +22 -0
- data/ext/jdes_ede3.h +31 -0
- data/ext/jdes_xex3.cpp +22 -0
- data/ext/jdes_xex3.h +31 -0
- data/ext/jdiamond2.cpp +22 -0
- data/ext/jdiamond2.h +31 -0
- data/ext/jdiamond2lite.cpp +22 -0
- data/ext/jdiamond2lite.h +31 -0
- data/ext/jexception.h +20 -0
- data/ext/jgost.cpp +22 -0
- data/ext/jgost.h +31 -0
- data/ext/jhash.cpp +92 -0
- data/ext/jhash.h +54 -0
- data/ext/jhash_t.h +121 -0
- data/ext/jhaval.h +64 -0
- data/ext/jhelpers.cpp +90 -0
- data/ext/jhelpers.h +38 -0
- data/ext/jhmac.cpp +44 -0
- data/ext/jhmac.h +34 -0
- data/ext/jhmac_t.h +125 -0
- data/ext/jidea.cpp +22 -0
- data/ext/jidea.h +31 -0
- data/ext/jmarc4.cpp +22 -0
- data/ext/jmarc4.h +37 -0
- data/ext/jmars.cpp +22 -0
- data/ext/jmars.h +31 -0
- data/ext/jmd2.h +56 -0
- data/ext/jmd4.h +56 -0
- data/ext/jmd5.h +56 -0
- data/ext/jpanamacipher.cpp +32 -0
- data/ext/jpanamacipher.h +46 -0
- data/ext/jpanamahash.h +44 -0
- data/ext/jrc2.cpp +44 -0
- data/ext/jrc2.h +39 -0
- data/ext/jrc5.cpp +22 -0
- data/ext/jrc5.h +31 -0
- data/ext/jrc6.cpp +22 -0
- data/ext/jrc6.h +31 -0
- data/ext/jripemd160.h +113 -0
- data/ext/jsafer.cpp +32 -0
- data/ext/jsafer.h +42 -0
- data/ext/jseal.cpp +32 -0
- data/ext/jseal.h +42 -0
- data/ext/jserpent.cpp +22 -0
- data/ext/jserpent.h +31 -0
- data/ext/jsha.h +122 -0
- data/ext/jshacal2.cpp +22 -0
- data/ext/jshacal2.h +31 -0
- data/ext/jshark.cpp +24 -0
- data/ext/jshark.h +33 -0
- data/ext/jsink.cpp +90 -0
- data/ext/jsink.h +154 -0
- data/ext/jskipjack.cpp +22 -0
- data/ext/jskipjack.h +31 -0
- data/ext/jsquare.cpp +22 -0
- data/ext/jsquare.h +31 -0
- data/ext/jstream.cpp +8 -0
- data/ext/jstream.h +20 -0
- data/ext/jstream_t.h +175 -0
- data/ext/jtea.cpp +22 -0
- data/ext/jtea.h +31 -0
- data/ext/jtiger.h +52 -0
- data/ext/jtwofish.cpp +22 -0
- data/ext/jtwofish.h +31 -0
- data/ext/jwhirlpool.h +52 -0
- data/ext/utils.cpp +8 -0
- data/extras/parser_c.rb +114 -0
- data/test/ciphers_test.rb +37 -0
- data/test/data/ciphers/3desval.dat +7 -0
- data/test/data/ciphers/3wayval.dat +6 -0
- data/test/data/ciphers/arc4.dat +8 -0
- data/test/data/ciphers/blowfish.dat +5 -0
- data/test/data/ciphers/camellia.dat +7 -0
- data/test/data/ciphers/cast128v.dat +5 -0
- data/test/data/ciphers/cast256v.dat +5 -0
- data/test/data/ciphers/descert.dat +198 -0
- data/test/data/ciphers/diamond.dat +9 -0
- data/test/data/ciphers/gostval.dat +10 -0
- data/test/data/ciphers/ideaval.dat +13 -0
- data/test/data/ciphers/marsval.dat +11 -0
- data/test/data/ciphers/panamac.dat +7 -0
- data/test/data/ciphers/rc2val.dat +10 -0
- data/test/data/ciphers/rc5val.dat +7 -0
- data/test/data/ciphers/rc6val.dat +8 -0
- data/test/data/ciphers/rijndael.dat +11 -0
- data/test/data/ciphers/saferval.dat +27 -0
- data/test/data/ciphers/seal.dat +3 -0
- data/test/data/ciphers/serpentv.dat +11 -0
- data/test/data/ciphers/shacal2.dat +7 -0
- data/test/data/ciphers/sharkval.dat +9 -0
- data/test/data/ciphers/skipjack.dat +3 -0
- data/test/data/ciphers/squareva.dat +10 -0
- data/test/data/ciphers/twofishv.dat +11 -0
- data/test/data/digests/adler32.dat +8 -0
- data/test/data/digests/crc32.dat +10 -0
- data/test/data/digests/haval.dat +4 -0
- data/test/data/digests/havalcer.dat +23 -0
- data/test/data/digests/md2.dat +9 -0
- data/test/data/digests/md4.dat +9 -0
- data/test/data/digests/md5.dat +9 -0
- data/test/data/digests/panamah.dat +8 -0
- data/test/data/digests/ripemd.dat +43 -0
- data/test/data/digests/sha.dat +19 -0
- data/test/data/digests/tiger.dat +11 -0
- data/test/data/digests/whirlpool.dat +13 -0
- data/test/data/hmacs/hmac.dat +6 -0
- data/test/digests_test.rb +29 -0
- data/test/hmacs_test.rb +38 -0
- data/test/test_helper.rb +42 -0
- metadata +220 -0
data/test/test_helper.rb
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
|
2
|
+
require 'rubygems'
|
3
|
+
require 'ext/cryptopp'
|
4
|
+
|
5
|
+
module TestHelper
|
6
|
+
def readfile(file)
|
7
|
+
File.open(file) do |f|
|
8
|
+
while !f.eof do
|
9
|
+
l = f.gets.strip.split "\t"
|
10
|
+
case l.shift
|
11
|
+
when 'algorithm'
|
12
|
+
type = l.shift.upcase
|
13
|
+
algorithm = l.shift.to_sym
|
14
|
+
when 'fields'
|
15
|
+
fields = l
|
16
|
+
when 'test'
|
17
|
+
options = { :algorithm => algorithm }
|
18
|
+
fields.each do |i|
|
19
|
+
case i
|
20
|
+
when 'ciphertext_cont'
|
21
|
+
options[:ciphertext] = l.join ''
|
22
|
+
when 'ciphertext_hex_cont'
|
23
|
+
options[:ciphertext_hex] = l.join ''
|
24
|
+
when 'plaintext_repeat'
|
25
|
+
options[:plaintext] || options[:plaintext_hex] *= l.shift.to_i
|
26
|
+
when 'key_repeat'
|
27
|
+
options[:key] || options[:key_hex] *= l.shift.to_i
|
28
|
+
when 'block_mode'
|
29
|
+
options[:block_mode] = l.shift.to_sym
|
30
|
+
when 'padding'
|
31
|
+
options[:padding] = l.shift.to_sym
|
32
|
+
else
|
33
|
+
options[i.to_sym] = l.shift
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
yield(options)
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
metadata
ADDED
@@ -0,0 +1,220 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: cryptopp
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 0
|
8
|
+
- 4
|
9
|
+
version: 0.0.4
|
10
|
+
platform: ruby
|
11
|
+
authors:
|
12
|
+
- J Smith
|
13
|
+
autorequire:
|
14
|
+
bindir: bin
|
15
|
+
cert_chain: []
|
16
|
+
|
17
|
+
date: 2010-07-01 00:00:00 -04:00
|
18
|
+
default_executable:
|
19
|
+
dependencies: []
|
20
|
+
|
21
|
+
description: cryptopp is a cryptographic library for Ruby built on Wei Dai's Crypto++.
|
22
|
+
email: dark.panda@gmail.com
|
23
|
+
executables: []
|
24
|
+
|
25
|
+
extensions:
|
26
|
+
- ext/extconf.rb
|
27
|
+
extra_rdoc_files:
|
28
|
+
- README
|
29
|
+
files:
|
30
|
+
- .gitignore
|
31
|
+
- MIT-LICENSE
|
32
|
+
- README
|
33
|
+
- Rakefile
|
34
|
+
- cryptopp.gemspec
|
35
|
+
- ext/.gitignore
|
36
|
+
- ext/Rakefile
|
37
|
+
- ext/ciphers.cpp
|
38
|
+
- ext/cryptopp.cpp
|
39
|
+
- ext/cryptopp_ruby_api.h
|
40
|
+
- ext/defs/block_modes.def
|
41
|
+
- ext/defs/checksums.def
|
42
|
+
- ext/defs/ciphers.def
|
43
|
+
- ext/defs/hashes.def
|
44
|
+
- ext/defs/hmacs.def
|
45
|
+
- ext/defs/paddings.def
|
46
|
+
- ext/defs/rngs.def
|
47
|
+
- ext/digests.cpp
|
48
|
+
- ext/extconf.rb
|
49
|
+
- ext/j3way.cpp
|
50
|
+
- ext/j3way.h
|
51
|
+
- ext/jadler32.h
|
52
|
+
- ext/jaes.cpp
|
53
|
+
- ext/jaes.h
|
54
|
+
- ext/jarc4.cpp
|
55
|
+
- ext/jarc4.h
|
56
|
+
- ext/jbase.cpp
|
57
|
+
- ext/jbase.h
|
58
|
+
- ext/jbasiccipherinfo.h
|
59
|
+
- ext/jblowfish.cpp
|
60
|
+
- ext/jblowfish.h
|
61
|
+
- ext/jcamellia.cpp
|
62
|
+
- ext/jcamellia.h
|
63
|
+
- ext/jcast128.cpp
|
64
|
+
- ext/jcast128.h
|
65
|
+
- ext/jcast256.cpp
|
66
|
+
- ext/jcast256.h
|
67
|
+
- ext/jcipher.cpp
|
68
|
+
- ext/jcipher.h
|
69
|
+
- ext/jcipher_t.h
|
70
|
+
- ext/jconfig.h
|
71
|
+
- ext/jconstants.h
|
72
|
+
- ext/jcrc32.h
|
73
|
+
- ext/jdes.cpp
|
74
|
+
- ext/jdes.h
|
75
|
+
- ext/jdes_ede2.cpp
|
76
|
+
- ext/jdes_ede2.h
|
77
|
+
- ext/jdes_ede3.cpp
|
78
|
+
- ext/jdes_ede3.h
|
79
|
+
- ext/jdes_xex3.cpp
|
80
|
+
- ext/jdes_xex3.h
|
81
|
+
- ext/jdiamond2.cpp
|
82
|
+
- ext/jdiamond2.h
|
83
|
+
- ext/jdiamond2lite.cpp
|
84
|
+
- ext/jdiamond2lite.h
|
85
|
+
- ext/jexception.h
|
86
|
+
- ext/jgost.cpp
|
87
|
+
- ext/jgost.h
|
88
|
+
- ext/jhash.cpp
|
89
|
+
- ext/jhash.h
|
90
|
+
- ext/jhash_t.h
|
91
|
+
- ext/jhaval.h
|
92
|
+
- ext/jhelpers.cpp
|
93
|
+
- ext/jhelpers.h
|
94
|
+
- ext/jhmac.cpp
|
95
|
+
- ext/jhmac.h
|
96
|
+
- ext/jhmac_t.h
|
97
|
+
- ext/jidea.cpp
|
98
|
+
- ext/jidea.h
|
99
|
+
- ext/jmarc4.cpp
|
100
|
+
- ext/jmarc4.h
|
101
|
+
- ext/jmars.cpp
|
102
|
+
- ext/jmars.h
|
103
|
+
- ext/jmd2.h
|
104
|
+
- ext/jmd4.h
|
105
|
+
- ext/jmd5.h
|
106
|
+
- ext/jpanamacipher.cpp
|
107
|
+
- ext/jpanamacipher.h
|
108
|
+
- ext/jpanamahash.h
|
109
|
+
- ext/jrc2.cpp
|
110
|
+
- ext/jrc2.h
|
111
|
+
- ext/jrc5.cpp
|
112
|
+
- ext/jrc5.h
|
113
|
+
- ext/jrc6.cpp
|
114
|
+
- ext/jrc6.h
|
115
|
+
- ext/jripemd160.h
|
116
|
+
- ext/jsafer.cpp
|
117
|
+
- ext/jsafer.h
|
118
|
+
- ext/jseal.cpp
|
119
|
+
- ext/jseal.h
|
120
|
+
- ext/jserpent.cpp
|
121
|
+
- ext/jserpent.h
|
122
|
+
- ext/jsha.h
|
123
|
+
- ext/jshacal2.cpp
|
124
|
+
- ext/jshacal2.h
|
125
|
+
- ext/jshark.cpp
|
126
|
+
- ext/jshark.h
|
127
|
+
- ext/jsink.cpp
|
128
|
+
- ext/jsink.h
|
129
|
+
- ext/jskipjack.cpp
|
130
|
+
- ext/jskipjack.h
|
131
|
+
- ext/jsquare.cpp
|
132
|
+
- ext/jsquare.h
|
133
|
+
- ext/jstream.cpp
|
134
|
+
- ext/jstream.h
|
135
|
+
- ext/jstream_t.h
|
136
|
+
- ext/jtea.cpp
|
137
|
+
- ext/jtea.h
|
138
|
+
- ext/jtiger.h
|
139
|
+
- ext/jtwofish.cpp
|
140
|
+
- ext/jtwofish.h
|
141
|
+
- ext/jwhirlpool.h
|
142
|
+
- ext/utils.cpp
|
143
|
+
- extras/parser_c.rb
|
144
|
+
- test/ciphers_test.rb
|
145
|
+
- test/data/ciphers/3desval.dat
|
146
|
+
- test/data/ciphers/3wayval.dat
|
147
|
+
- test/data/ciphers/arc4.dat
|
148
|
+
- test/data/ciphers/blowfish.dat
|
149
|
+
- test/data/ciphers/camellia.dat
|
150
|
+
- test/data/ciphers/cast128v.dat
|
151
|
+
- test/data/ciphers/cast256v.dat
|
152
|
+
- test/data/ciphers/descert.dat
|
153
|
+
- test/data/ciphers/diamond.dat
|
154
|
+
- test/data/ciphers/gostval.dat
|
155
|
+
- test/data/ciphers/ideaval.dat
|
156
|
+
- test/data/ciphers/marsval.dat
|
157
|
+
- test/data/ciphers/panamac.dat
|
158
|
+
- test/data/ciphers/rc2val.dat
|
159
|
+
- test/data/ciphers/rc5val.dat
|
160
|
+
- test/data/ciphers/rc6val.dat
|
161
|
+
- test/data/ciphers/rijndael.dat
|
162
|
+
- test/data/ciphers/saferval.dat
|
163
|
+
- test/data/ciphers/seal.dat
|
164
|
+
- test/data/ciphers/serpentv.dat
|
165
|
+
- test/data/ciphers/shacal2.dat
|
166
|
+
- test/data/ciphers/sharkval.dat
|
167
|
+
- test/data/ciphers/skipjack.dat
|
168
|
+
- test/data/ciphers/squareva.dat
|
169
|
+
- test/data/ciphers/twofishv.dat
|
170
|
+
- test/data/digests/adler32.dat
|
171
|
+
- test/data/digests/crc32.dat
|
172
|
+
- test/data/digests/haval.dat
|
173
|
+
- test/data/digests/havalcer.dat
|
174
|
+
- test/data/digests/md2.dat
|
175
|
+
- test/data/digests/md4.dat
|
176
|
+
- test/data/digests/md5.dat
|
177
|
+
- test/data/digests/panamah.dat
|
178
|
+
- test/data/digests/ripemd.dat
|
179
|
+
- test/data/digests/sha.dat
|
180
|
+
- test/data/digests/tiger.dat
|
181
|
+
- test/data/digests/whirlpool.dat
|
182
|
+
- test/data/hmacs/hmac.dat
|
183
|
+
- test/digests_test.rb
|
184
|
+
- test/hmacs_test.rb
|
185
|
+
- test/test_helper.rb
|
186
|
+
has_rdoc: true
|
187
|
+
homepage: http://github.com/dark-panda/ruby-cryptopp
|
188
|
+
licenses: []
|
189
|
+
|
190
|
+
post_install_message:
|
191
|
+
rdoc_options:
|
192
|
+
- --charset=UTF-8
|
193
|
+
require_paths:
|
194
|
+
- lib
|
195
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
196
|
+
requirements:
|
197
|
+
- - ">="
|
198
|
+
- !ruby/object:Gem::Version
|
199
|
+
segments:
|
200
|
+
- 0
|
201
|
+
version: "0"
|
202
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
203
|
+
requirements:
|
204
|
+
- - ">="
|
205
|
+
- !ruby/object:Gem::Version
|
206
|
+
segments:
|
207
|
+
- 0
|
208
|
+
version: "0"
|
209
|
+
requirements: []
|
210
|
+
|
211
|
+
rubyforge_project:
|
212
|
+
rubygems_version: 1.3.6
|
213
|
+
signing_key:
|
214
|
+
specification_version: 3
|
215
|
+
summary: cryptopp is a cryptographic library for Ruby built on Wei Dai's Crypto++.
|
216
|
+
test_files:
|
217
|
+
- test/ciphers_test.rb
|
218
|
+
- test/digests_test.rb
|
219
|
+
- test/hmacs_test.rb
|
220
|
+
- test/test_helper.rb
|