summaryrefslogtreecommitdiff
path: root/lib/srp/authentication.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/srp/authentication.rb')
-rw-r--r--lib/srp/authentication.rb14
1 files changed, 1 insertions, 13 deletions
diff --git a/lib/srp/authentication.rb b/lib/srp/authentication.rb
index 1f36dd7..f4b2e70 100644
--- a/lib/srp/authentication.rb
+++ b/lib/srp/authentication.rb
@@ -11,8 +11,7 @@ module SRP
@b = bigrand(32).hex
# B = g^b + k v (mod N)
@bb = (modpow(GENERATOR, @b, PRIME_N) + multiplier * verifier) % PRIME_N
- u = calculate_u(@aa, @bb, PRIME_N)
- return @bb, u
+ return @bb
end
def authenticate(m)
@@ -25,17 +24,6 @@ module SRP
end
- protected
-
- 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
- hashin = '0' * (nlen - aahex.length) + aahex \
- + '0' * (nlen - bbhex.length) + bbhex
- sha256_str(hashin).hex
- end
end
end