From 693b6d1e36828fa17915a9297595f65c739b611a Mon Sep 17 00:00:00 2001 From: Azul Date: Thu, 4 Oct 2012 09:54:47 +0200 Subject: using BIG_PRIME_N and hashing the byte array - tests pass We still calculate M differently than in SRP 6a --- lib/srp/authentication.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/srp/authentication.rb') 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) -- cgit v1.2.3