summaryrefslogtreecommitdiff
path: root/lib/srp/authentication.rb
diff options
context:
space:
mode:
authorAzul <azul@riseup.net>2012-10-04 09:54:47 +0200
committerAzul <azul@riseup.net>2012-10-04 09:54:47 +0200
commit693b6d1e36828fa17915a9297595f65c739b611a (patch)
tree2bafa7d9fd2cb311f36f7a68c3ff54fa5ecac794 /lib/srp/authentication.rb
parent4f57d8010a90fe1221c351f695d15d29a9cdc37f (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/authentication.rb')
-rw-r--r--lib/srp/authentication.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/srp/authentication.rb b/lib/srp/authentication.rb
index 4afe20b..0505a58 100644
--- a/lib/srp/authentication.rb
+++ b/lib/srp/authentication.rb
@@ -13,18 +13,18 @@ module SRP
@aa = aa
@b = bigrand(32).hex
# B = g^b + k v (mod N)
- @bb = (modpow(GENERATOR, @b, PRIME_N) + multiplier * verifier) % PRIME_N
+ @bb = (modpow(GENERATOR, @b, BIG_PRIME_N) + multiplier * verifier) % BIG_PRIME_N
end
def u
- calculate_u(aa, bb, PRIME_N)
+ calculate_u(aa, bb, BIG_PRIME_N)
end
# do not cache this - it's secret and someone might store the
# session in a CookieStore
def secret(verifier)
- base = (modpow(verifier, u, PRIME_N) * aa) % PRIME_N
- modpow(base, @b, PRIME_N)
+ base = (modpow(verifier, u, BIG_PRIME_N) * aa) % BIG_PRIME_N
+ modpow(base, @b, BIG_PRIME_N)
end
def m1(verifier)