crypt19-rb 1.3.0 → 1.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1503323fa1e5ed3ea4bd0acda221b9b3db37db93
4
- data.tar.gz: 73db3b0e52b9c31545a2fbb84e44aaf2da749faa
3
+ metadata.gz: 4530ce12b07ff0aeada987cdc41cf9974ff03895
4
+ data.tar.gz: a99cc84e9d1c4b20134d59ca6e62d33766b7612a
5
5
  SHA512:
6
- metadata.gz: 5a187c56c32f75296cfc10229cd5d2899b74349696e704b81214acaa45c1f09c919c0715ab112a02bad261d83b9ddca4c9c1446dd8e7df76b5dd9431efd380e4
7
- data.tar.gz: 0177e6eaff71863016a359560b34f86d2400f85289b6fc32f6a8de3416c33b19ccb89937ca2f92c10a94383db7b268667cdde292e38b705d0c028cf8a953c558
6
+ metadata.gz: 77e7a45bd1461c70d74178c6f62442f14203fe2898518d9b2cf63e370026f3ae2cca28a5daffa4fe5c5e3cece07d30e7d27e3c1ea11a570f4b8bfb20fa3952c3
7
+ data.tar.gz: bd1f2e21e36055d26a7ed9298edb700338563d25436eba1de7e12a441e870066ea7c61e4bc09e5ec21a40c3efa178d9527cbe4f085594c5e1f49793e003108e9
@@ -14,5 +14,4 @@ matrix:
14
14
  allow_failures:
15
15
  - rvm: ruby-head
16
16
  - rvm: jruby-head
17
- - rvm: 2.0.0
18
17
  script: "bundle exec rake"
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- crypt19-rb (1.3.0)
4
+ crypt19-rb (1.3.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.3.0
1
+ 1.3.1
@@ -0,0 +1,16 @@
1
+ module BlockMethods
2
+ def encrypt_block(block)
3
+ xl, xr = block.unpack('NN')
4
+ xl, xr = encrypt_pair(xl, xr)
5
+ encrypted = [xl, xr].pack('NN')
6
+ return(encrypted)
7
+ end
8
+
9
+
10
+ def decrypt_block(block)
11
+ xl, xr = block.unpack('NN')
12
+ xl, xr = decrypt_pair(xl, xr)
13
+ decrypted = [xl, xr].pack('NN')
14
+ return(decrypted)
15
+ end
16
+ end
@@ -5,6 +5,7 @@
5
5
  require 'crypt/cbc'
6
6
  require 'crypt/blowfish-tables'
7
7
  require 'crypt/bytes-compat'
8
+ require 'crypt/block_methods'
8
9
 
9
10
  module Crypt
10
11
  class Blowfish
@@ -12,6 +13,8 @@ module Crypt
12
13
  include Crypt::CBC
13
14
  include Crypt::BlowfishTables
14
15
 
16
+ include BlockMethods
17
+
15
18
  ULONG = 0x100000000
16
19
 
17
20
  def block_size
@@ -90,21 +93,5 @@ module Crypt
90
93
  return([xl, xr])
91
94
  end
92
95
 
93
-
94
- def encrypt_block(block)
95
- xl, xr = block.unpack('NN')
96
- xl, xr = encrypt_pair(xl, xr)
97
- encrypted = [xl, xr].pack('NN')
98
- return(encrypted)
99
- end
100
-
101
-
102
- def decrypt_block(block)
103
- xl, xr = block.unpack('NN')
104
- xl, xr = decrypt_pair(xl, xr)
105
- decrypted = [xl, xr].pack('NN')
106
- return(decrypted)
107
- end
108
-
109
96
  end
110
97
  end
@@ -3,12 +3,15 @@
3
3
  # of the Crypto++ project http://www.eskimo.com/~weidai/cryptlib.html
4
4
 
5
5
  require 'crypt/cbc'
6
+ require 'crypt/block_methods'
6
7
 
7
8
  module Crypt
8
9
  class Gost
9
10
 
10
11
  include CBC
11
12
 
13
+ include BlockMethods
14
+
12
15
  ULONG = 0x100000000
13
16
 
14
17
  def block_size
@@ -119,21 +122,5 @@ module Crypt
119
122
  return([xr, xl])
120
123
  end
121
124
 
122
-
123
- def encrypt_block(block)
124
- xl, xr = block.unpack('NN')
125
- xl, xr = encrypt_pair(xl, xr)
126
- encrypted = [xl, xr].pack('NN')
127
- return(encrypted)
128
- end
129
-
130
-
131
- def decrypt_block(block)
132
- xl, xr = block.unpack('NN')
133
- xl, xr = decrypt_pair(xl, xr)
134
- decrypted = [xl, xr].pack('NN')
135
- return(decrypted)
136
- end
137
-
138
125
  end
139
126
  end
@@ -1,4 +1,4 @@
1
1
  # coding: ASCII
2
2
  module Crypt
3
- VERSION = "1.3.0"
3
+ VERSION = "1.3.1"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: crypt19-rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Rudenberg
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-07-31 00:00:00.000000000 Z
13
+ date: 2013-08-13 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rake
@@ -44,6 +44,7 @@ files:
44
44
  - Rakefile
45
45
  - VERSION
46
46
  - crypt19.gemspec
47
+ - lib/crypt/block_methods.rb
47
48
  - lib/crypt/blowfish-tables.rb
48
49
  - lib/crypt/blowfish.rb
49
50
  - lib/crypt/bytes-compat.rb