fix ccm example and add printout

pull/312/head
Jacob Barthelmeh 2022-04-08 14:55:54 -06:00
parent 0b539dc4e0
commit ffd01dc2ed
3 changed files with 11 additions and 1 deletions

View File

@ -59,7 +59,7 @@ static int doCcm(unsigned int keyId, const byte* in, int inSz,
XMEMSET(authTag, 0, AES_BLOCK_SIZE);
XMEMSET(cipherTxt, 0, sizeof(cipherTxt));
wc_AesInit(&aes, NULL, WOLFSSL_CAAM_DEVID);
wc_AesInit(&aes, NULL, WOLFSSL_SECO_DEVID);
wc_SECO_AesSetKeyID(&aes, keyId);
printf("Encrypting : ");

View File

@ -101,6 +101,11 @@ int main(int argc, char** argv)
if (XSTRNCMP(argv[1], "1", 1) == 0) {
create = CAAM_KEYSTORE_CREATE;
}
else {
printf("This example uses a transient key which gets deleted once"
"HSM is closed down\n");
return -1;
}
keyId = (unsigned int)XATOI(argv[2]);
keyStoreId = (unsigned int)XATOI(argv[3]);

View File

@ -83,6 +83,11 @@ int main(int argc, char** argv)
if (XSTRNCMP(argv[1], "1", 1) == 0) {
create = CAAM_KEYSTORE_CREATE;
}
else {
printf("This example uses a transient key which gets deleted once"
"HSM is closed down\n");
return -1;
}
keyId = (unsigned int)XATOI(argv[2]);
keyStoreId = (unsigned int)XATOI(argv[3]);