poly_pseudo 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/poly_pseudo/util.rb +4 -19
- data/lib/poly_pseudo/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 793a8c85f4f1ba8dc27efbc62dd9da1128f125e9
|
4
|
+
data.tar.gz: bf8bd1a56268675c8c5a75a521ed4c26f0e8c37d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 230f00a0e4a3b5ea28cc624bbe5f881504645770bc6a3d7f29270cb1d4e66675d38a856ea666c203d53a98a159864dd8638cfc04b06ed4cfb1c2cdd17a1dc3dc
|
7
|
+
data.tar.gz: 7f924a92e4aba19a90f99865df99caaa91d64d7b48a2ce933fc26e306faae0372dfc293f615bfc7bf5086433a64817bd79e4260a1bb19d9b1e6483113f6b7a04
|
data/lib/poly_pseudo/util.rb
CHANGED
@@ -43,28 +43,13 @@ module PolyPseudo
|
|
43
43
|
m
|
44
44
|
end
|
45
45
|
|
46
|
-
def self.i2osp(x, len = nil)
|
47
|
-
raise ArgumentError, "integer too large" if len && x >= 256**len
|
48
|
-
|
49
|
-
StringIO.open do |buffer|
|
50
|
-
while x > 0
|
51
|
-
b = (x & 0xFF).chr
|
52
|
-
x >>= 8
|
53
|
-
buffer << b
|
54
|
-
end
|
55
|
-
s = buffer.string
|
56
|
-
s.force_encoding(Encoding::BINARY) if s.respond_to?(:force_encoding)
|
57
|
-
s.reverse!
|
58
|
-
s = len ? s.rjust(len, "\0") : s
|
59
|
-
end
|
60
|
-
end
|
61
|
-
|
62
46
|
def self.mgf1(z, l)
|
63
47
|
t = ''
|
64
48
|
|
65
|
-
(
|
66
|
-
|
67
|
-
|
49
|
+
n = (l - 1) / 48 + 1
|
50
|
+
n.times do |i|
|
51
|
+
t << Digest::SHA384.digest(z + [i].pack('N'))
|
52
|
+
end
|
68
53
|
|
69
54
|
t[0...l]
|
70
55
|
end
|
data/lib/poly_pseudo/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: poly_pseudo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Benoist Claassen
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-01-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|