mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8294997: Improve ECC math operations
Reviewed-by: xuelei
This commit is contained in:
parent
94caecbe57
commit
2f60675e06
5 changed files with 26 additions and 47 deletions
|
@ -329,9 +329,10 @@ public abstract sealed class IntegerPolynomial implements IntegerFieldModuloP
|
|||
}
|
||||
|
||||
protected void setLimbsValuePositive(BigInteger v, long[] limbs) {
|
||||
BigInteger mod = BigInteger.valueOf(1 << bitsPerLimb);
|
||||
assert bitsPerLimb < 32;
|
||||
long limbMask = (1L << bitsPerLimb) - 1;
|
||||
for (int i = 0; i < limbs.length; i++) {
|
||||
limbs[i] = v.mod(mod).longValue();
|
||||
limbs[i] = v.intValue() & limbMask;
|
||||
v = v.shiftRight(bitsPerLimb);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue