summaryrefslogtreecommitdiff
path: root/lib/srp/authentication.rb
diff options
context:
space:
mode:
authorAzul <azul@riseup.net>2012-10-04 10:32:39 +0200
committerAzul <azul@riseup.net>2012-10-04 10:32:39 +0200
commitc73f7c1b4c1270d4d0ca47650a12893a6d13e796 (patch)
tree91f3ff3bfddc1abb62c3628833faf0f64d0c55e8 /lib/srp/authentication.rb
parentb889ef34d4fff0d156901ae2aebfcee02339ce77 (diff)
simplifying modpow to default to BIG_PRIME_N
Diffstat (limited to 'lib/srp/authentication.rb')
-rw-r--r--lib/srp/authentication.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/srp/authentication.rb b/lib/srp/authentication.rb
index 0fd275c..3428fd4 100644
--- a/lib/srp/authentication.rb
+++ b/lib/srp/authentication.rb
@@ -13,7 +13,7 @@ module SRP
@aa = aa
@b = bigrand(32).hex
# B = g^b + k v (mod N)
- @bb = (modpow(GENERATOR, @b, BIG_PRIME_N) + multiplier * verifier) % BIG_PRIME_N
+ @bb = (modpow(GENERATOR, @b) + multiplier * verifier) % BIG_PRIME_N
end
def u
@@ -23,8 +23,8 @@ module SRP
# do not cache this - it's secret and someone might store the
# session in a CookieStore
def secret(verifier)
- base = (modpow(verifier, u, BIG_PRIME_N) * aa) % BIG_PRIME_N
- modpow(base, @b, BIG_PRIME_N)
+ base = (modpow(verifier, u) * aa) % BIG_PRIME_N
+ modpow(base, @b)
end
def m1(verifier)