crypto: api: New capability flag CAP_NO_IV_PREFIX
Zephyr crypto API currently does not allow IV to be treated as separate entity. This is mostly due to fact that underlying libraries expect the IV to be prefixed to the cipher/plain text for performance reasons. But there are cases where the IV is derived from other sources and not directly transmitted to the other end. In such cases, it must be treated as a first class citizen. This patch adds a new capability flag `CAP_NO_IV_PREFIX` to the crypto API that allows operations without prefixing the IV to the cipher/plain text. When `CAP_NO_IV_PREFIX` is active (and supported), the IV passed to cipher_*_op() must not be modified. As a side effect, the length of the cipher/plain texts are equal; allowing for in-place encryption/decryption. Signed-off-by: Siddharth Chandrasekaran <siddharth@embedjournal.com>
This commit is contained in:
parent
d0f7652858
commit
0ff77b10e1
1 changed files with 3 additions and 0 deletions
|
@ -172,6 +172,9 @@ struct cipher_ctx {
|
||||||
/* Whether the hardware/driver supports autononce feature */
|
/* Whether the hardware/driver supports autononce feature */
|
||||||
#define CAP_AUTONONCE BIT(7)
|
#define CAP_AUTONONCE BIT(7)
|
||||||
|
|
||||||
|
/* Don't prefix IV to cipher blocks */
|
||||||
|
#define CAP_NO_IV_PREFIX BIT(8)
|
||||||
|
|
||||||
/* More flags to be added as necessary */
|
/* More flags to be added as necessary */
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue