From 07fe3d305bdc9d91076c6c330b2f5ce6baceae81 Mon Sep 17 00:00:00 2001 From: JacobBarthelmeh Date: Tue, 5 Apr 2022 14:58:36 -0700 Subject: [PATCH] fix typo and remove magic number --- caam/seco/README.md | 4 ++-- caam/seco/aes-cbc.c | 4 ++-- caam/seco/aes-ccm.c | 4 ++-- caam/seco/aes-ecb.c | 4 ++-- caam/seco/aes-gcm.c | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/caam/seco/README.md b/caam/seco/README.md index 20d9e91f..12b398a7 100644 --- a/caam/seco/README.md +++ b/caam/seco/README.md @@ -1,8 +1,8 @@ Example use cases when compiling wolfSSL with --enable-caam=seco -## Setup Envirnment +## Setup Environment -Setup the location to SECO HSM and NVM library, cryptodev header (if wolfSSL is built to look for it), wolfSSL library path, and libz install path. The following is examples of setting the envirnment variables: +Setup the location to SECO HSM and NVM library, cryptodev header (if wolfSSL is built to look for it), wolfSSL library path, and libz install path. The following is examples of setting the environment variables: export HSM_DIR=/home/user/imx-seco-libs/export/usr export CRYPTODEV_DIR=/home/user/build-xwayland/sysroots-components/aarch64/cryptodev-linux/usr/include diff --git a/caam/seco/aes-cbc.c b/caam/seco/aes-cbc.c index ae1c3159..cf785de2 100644 --- a/caam/seco/aes-cbc.c +++ b/caam/seco/aes-cbc.c @@ -34,9 +34,9 @@ static unsigned int createAesKey() unsigned int keyIdOut; int keyInfo = CAAM_KEY_PERSISTENT; int keyType = CAAM_KEYTYPE_AES128; - byte pubOut[32]; + byte pubOut[AES_MAX_KEY_SIZE]; - /* generate a CMAC key in the HSM */ + /* generate a AES-CBC key in the HSM */ if (wc_SECO_GenerateKey(CAAM_GENERATE_KEY, keyGroup, pubOut, 0, keyType, keyInfo, &keyIdOut) != 0) { printf("Error generating key in hsm\n"); diff --git a/caam/seco/aes-ccm.c b/caam/seco/aes-ccm.c index 0859e2ec..5f42e699 100644 --- a/caam/seco/aes-ccm.c +++ b/caam/seco/aes-ccm.c @@ -36,9 +36,9 @@ static unsigned int createAesKey() unsigned int keyIdOut; int keyInfo = CAAM_KEY_PERSISTENT; int keyType = CAAM_KEYTYPE_AES128; - byte pubOut[32]; + byte pubOut[AES_MAX_KEY_SIZE]; - /* generate a CMAC key in the HSM */ + /* generate a AES-CCM key in the HSM */ if (wc_SECO_GenerateKey(CAAM_GENERATE_KEY, keyGroup, pubOut, 0, keyType, keyInfo, &keyIdOut) != 0) { printf("Error generating key in hsm\n"); diff --git a/caam/seco/aes-ecb.c b/caam/seco/aes-ecb.c index c28bf879..89409359 100644 --- a/caam/seco/aes-ecb.c +++ b/caam/seco/aes-ecb.c @@ -36,9 +36,9 @@ static unsigned int createAesKey() unsigned int keyIdOut; int keyInfo = CAAM_KEY_PERSISTENT; int keyType = CAAM_KEYTYPE_AES128; - byte pubOut[32]; + byte pubOut[AES_MAX_KEY_SIZE]; - /* generate a CMAC key in the HSM */ + /* generate a AES-ECB key in the HSM */ if (wc_SECO_GenerateKey(CAAM_GENERATE_KEY, keyGroup, pubOut, 0, keyType, keyInfo, &keyIdOut) != 0) { printf("Error generating key in hsm\n"); diff --git a/caam/seco/aes-gcm.c b/caam/seco/aes-gcm.c index 18ac4da3..305f8ef9 100644 --- a/caam/seco/aes-gcm.c +++ b/caam/seco/aes-gcm.c @@ -36,7 +36,7 @@ static unsigned int createAesKey() int keyType = CAAM_KEYTYPE_AES128; byte pubOut[AES_256_KEY_SIZE]; - /* generate a CMAC key in the HSM */ + /* generate a AES-GCM key in the HSM */ if (wc_SECO_GenerateKey(CAAM_GENERATE_KEY, keyGroup, pubOut, 0, keyType, keyInfo, &keyIdOut) != 0) { printf("Error generating key in hsm\n");