Update AES use in SmartPGP (ENC/DEC/SM)

This commit is contained in:
Arnaud Fontaine
2017-07-06 18:05:59 +02:00
parent a2787abbcf
commit f8abbd8732
6 changed files with 86 additions and 54 deletions

View File

@@ -31,9 +31,9 @@ public final class CmacKey {
protected final byte[] k1;
protected final byte[] k2;
protected CmacKey() {
protected CmacKey(final byte aesKeyLength) {
key = (AESKey)KeyBuilder.buildKey(KeyBuilder.TYPE_AES_TRANSIENT_DESELECT,
(short)(Constants.aesKeyLength() * 8),
(short)(aesKeyLength * 8),
false);
k1 = JCSystem.makeTransientByteArray(Constants.AES_BLOCK_SIZE, JCSystem.CLEAR_ON_DESELECT);