diff --git a/wolfcrypt/src/port/caam/caam_driver.c b/wolfcrypt/src/port/caam/caam_driver.c index 6126601f4..e3ce796be 100644 --- a/wolfcrypt/src/port/caam/caam_driver.c +++ b/wolfcrypt/src/port/caam/caam_driver.c @@ -847,7 +847,7 @@ static Error caamAes(struct DescStruct* desc) } /* set alignment constraints */ - if (desc->type == CAAM_AESCBC) { + if (desc->type == CAAM_AESCBC || desc->type == CAAM_AESECB) { align = 16; } @@ -1403,6 +1403,10 @@ static Error caamTransferStart(IODeviceVector ioCaam, switch (type) { case CAAM_AESECB: case CAAM_AESCBC: + if (desc->inputSz % 16 != 0) { + return ArgumentError; + } + /* fall through to break */ case CAAM_AESCTR: break;