fix key size for native HMAC

This commit is contained in:
Michele Balistreri 2019-09-03 13:49:02 +03:00
parent fc4120cd0d
commit c53b0cd811
No known key found for this signature in database
GPG Key ID: E9567DA33A4F791A
1 changed files with 1 additions and 1 deletions

View File

@ -51,7 +51,7 @@ public class Crypto {
try { try {
hmacSHA512 = Signature.getInstance(Signature.ALG_HMAC_SHA_512, false); hmacSHA512 = Signature.getInstance(Signature.ALG_HMAC_SHA_512, false);
hmacKey = (HMACKey) KeyBuilder.buildKey(KeyBuilder.TYPE_HMAC_TRANSIENT_DESELECT, KEY_SECRET_SIZE, false); hmacKey = (HMACKey) KeyBuilder.buildKey(KeyBuilder.TYPE_HMAC_TRANSIENT_DESELECT, KeyBuilder.LENGTH_AES_256, false);
} catch (CryptoException e) { } catch (CryptoException e) {
hmacSHA512 = null; hmacSHA512 = null;
hmacBlock = JCSystem.makeTransientByteArray(HMAC_BLOCK_SIZE, JCSystem.CLEAR_ON_RESET); hmacBlock = JCSystem.makeTransientByteArray(HMAC_BLOCK_SIZE, JCSystem.CLEAR_ON_RESET);