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:
authorDavid Hook <dgh@cryptoworkshop.com>2014-07-22 14:59:42 +0400
committerDavid Hook <dgh@cryptoworkshop.com>2014-07-22 14:59:42 +0400
commit054947daabc9c3a2354f80fbc955a572df2f9003 (patch)
tree0b955b1afb430a7c75f42958a10042bcc8a29d04 /core/src
parentd9a8181bf89386342fe16a34d800c75c5dddafa9 (diff)
J2ME compatibility updates
Diffstat (limited to 'core/src')
-rw-r--r--core/src/main/java/org/bouncycastle/math/raw/Mod.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/core/src/main/java/org/bouncycastle/math/raw/Mod.java b/core/src/main/java/org/bouncycastle/math/raw/Mod.java
index 1bc7d3f7..47e6d8c6 100644
--- a/core/src/main/java/org/bouncycastle/math/raw/Mod.java
+++ b/core/src/main/java/org/bouncycastle/math/raw/Mod.java
@@ -101,9 +101,10 @@ public abstract class Mod
do
{
- byte[] bytes = new byte[len << 2];
- rand.nextBytes(bytes);
- Pack.bigEndianToInt(bytes, 0, s);
+ for (int i = 0; i != len; i++)
+ {
+ s[i] = rand.nextInt();
+ }
s[len - 1] &= m;
}
while (Nat.gte(len, s, p));