GT-3570: Formatted scalar.getUnsignedValue()

scalar.getUnsignedValue() now returns value masked by bitLength.
This commit is contained in:
ghidorahrex 2020-03-03 13:42:20 -05:00
parent 7102fe5c00
commit 86b3d9a271

View File

@ -99,7 +99,10 @@ public class Scalar implements Comparable<Scalar> {
* Get the value as unsigned.
*/
public long getUnsignedValue() {
return value;
if (value == 0) { // just in case the bitLength is 0
return 0;
}
return (value & BITMASKS[bitLength]);
}
/**