Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/quite/humla-spongycastle.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/core/src
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2014-05-24 17:30:27 +0400
committerPeter Dettman <peter.dettman@bouncycastle.org>2014-05-24 17:30:27 +0400
commit795de8fa567750da7e29ffdaa4c75ebe574aa77d (patch)
tree65c074cb82f0b7ca0b5e1c8fcfaab32df831ed5f /core/src
parentd9c5523df0b969c851272bc50d79269b3940c859 (diff)
Use uvLen with u, v
Diffstat (limited to 'core/src')
-rw-r--r--core/src/main/java/org/bouncycastle/math/ec/Mod.java12
1 files changed, 6 insertions, 6 deletions
diff --git a/core/src/main/java/org/bouncycastle/math/ec/Mod.java b/core/src/main/java/org/bouncycastle/math/ec/Mod.java
index 0e6e6579..73a8237b 100644
--- a/core/src/main/java/org/bouncycastle/math/ec/Mod.java
+++ b/core/src/main/java/org/bouncycastle/math/ec/Mod.java
@@ -47,13 +47,13 @@ public abstract class Mod
--uvLen;
}
- if (Nat.gte(len, u, v))
+ if (Nat.gte(uvLen, u, v))
{
- Nat.sub(len, u, v, u);
+ Nat.sub(uvLen, u, v, u);
// assert (u[0] & 1) == 0;
ac += Nat.sub(len, a, b, a) - bc;
ac = inversionStep(p, u, uvLen, a, ac);
- if (Nat.isOne(len, u))
+ if (Nat.isOne(uvLen, u))
{
inversionResult(p, ac, a, z);
return;
@@ -61,11 +61,11 @@ public abstract class Mod
}
else
{
- Nat.sub(len, v, u, v);
+ Nat.sub(uvLen, v, u, v);
// assert (v[0] & 1) == 0;
bc += Nat.sub(len, b, a, b) - ac;
bc = inversionStep(p, v, uvLen, b, bc);
- if (Nat.isOne(len, v))
+ if (Nat.isOne(uvLen, v))
{
inversionResult(p, bc, b, z);
return;
@@ -90,7 +90,7 @@ public abstract class Mod
do
{
byte[] bytes = new byte[len << 2];
- rand. nextBytes(bytes);
+ rand.nextBytes(bytes);
Pack.bigEndianToInt(bytes, 0, s);
s[len - 1] &= m;
}