diff options
author | Azul <azul@riseup.net> | 2012-10-04 09:54:47 +0200 |
---|---|---|
committer | Azul <azul@riseup.net> | 2012-10-04 09:54:47 +0200 |
commit | 693b6d1e36828fa17915a9297595f65c739b611a (patch) | |
tree | 2bafa7d9fd2cb311f36f7a68c3ff54fa5ecac794 /lib/srp/util.rb | |
parent | 4f57d8010a90fe1221c351f695d15d29a9cdc37f (diff) |
using BIG_PRIME_N and hashing the byte array - tests pass
We still calculate M differently than in SRP 6a
Diffstat (limited to 'lib/srp/util.rb')
-rw-r--r-- | lib/srp/util.rb | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/srp/util.rb b/lib/srp/util.rb index 66bd9e7..cafa5f4 100644 --- a/lib/srp/util.rb +++ b/lib/srp/util.rb @@ -59,14 +59,13 @@ d15dc7d7b46154d6b6ce8ef4ad69b15d4982559b297bcf1885c529f566660e5 def calculate_m(aa, bb, s) hashin = '%x%x%x' % [aa, bb, s] - sha256_str(hashin).hex + sha256_hex(hashin).hex end def calculate_u(aa, bb, n) - nlen = 2 * ((('%x' % [n]).length * 4 + 7) >> 3) aahex = '%x' % [aa] bbhex = '%x' % [bb] - return sha256_str("%x%x" % [aa, bb]).hex + return sha256_hex("%x%x" % [aa, bb]).hex end end |