mirror of
https://github.com/bitcoinj/bitcoinj.git
synced 2025-03-10 09:20:04 +01:00
PBKDF2SHA512: set hLen to correct value of 64
This is a bugfix to the API, but since `MnemonicCode` always passes `dkLen` of 64 and the `System.arraycopy()` on line 66 truncates `baos.toByteArray()` to `dkLen` length, the call to `derive()` works correctly for our use-case.
This commit is contained in:
parent
4b987cb172
commit
c830107bce
1 changed files with 1 additions and 1 deletions
|
@ -41,7 +41,7 @@ public class PBKDF2SHA512 {
|
||||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
int hLen = 20;
|
int hLen = 64; // Length of HMAC result
|
||||||
|
|
||||||
if (dkLen > ((Math.pow(2, 32)) - 1) * hLen) {
|
if (dkLen > ((Math.pow(2, 32)) - 1) * hLen) {
|
||||||
throw new IllegalArgumentException("derived key too long");
|
throw new IllegalArgumentException("derived key too long");
|
||||||
|
|
Loading…
Add table
Reference in a new issue