mirror of
https://github.com/bitcoinj/bitcoinj.git
synced 2025-01-18 21:32:35 +01:00
PBKDF2SHA512: calculate l
with integer math
This commit is contained in:
parent
5a11957eb3
commit
b4f7deaba5
@ -54,7 +54,7 @@ public class PBKDF2SHA512 {
|
|||||||
throw new IllegalArgumentException("derived key too long");
|
throw new IllegalArgumentException("derived key too long");
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
int l = (int) Math.ceil((double) dkLen / (double) H_LEN);
|
int l = (dkLen + H_LEN - 1) / H_LEN; // Divide by H_LEN with rounding up
|
||||||
// int r = dkLen - (l-1)*hLen;
|
// int r = dkLen - (l-1)*hLen;
|
||||||
|
|
||||||
for (int i = 1; i <= l; i++) {
|
for (int i = 1; i <= l; i++) {
|
||||||
|
Loading…
Reference in New Issue
Block a user