diff options
author | David Hook <dgh@cryptoworkshop.com> | 2014-07-22 14:59:42 +0400 |
---|---|---|
committer | David Hook <dgh@cryptoworkshop.com> | 2014-07-22 14:59:42 +0400 |
commit | 054947daabc9c3a2354f80fbc955a572df2f9003 (patch) | |
tree | 0b955b1afb430a7c75f42958a10042bcc8a29d04 /core/src/main/java/org/bouncycastle | |
parent | d9a8181bf89386342fe16a34d800c75c5dddafa9 (diff) |
J2ME compatibility updates
Diffstat (limited to 'core/src/main/java/org/bouncycastle')
-rw-r--r-- | core/src/main/java/org/bouncycastle/math/raw/Mod.java | 7 |
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)); |