mirror of
https://github.com/armbian/linux.git
synced 2026-01-06 10:13:00 -08:00
crypto: echainiv - Add encrypted chain IV generator
This patch adds a new AEAD IV generator echainiv. It is intended to replace the existing skcipher IV generator eseqiv. If the underlying AEAD algorithm is using the old AEAD interface, then echainiv will simply use its IV generator. Otherwise, echainiv will encrypt a counter just like eseqiv but it'll first xor it against a previously stored IV similar to chainiv. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
@@ -227,6 +227,16 @@ config CRYPTO_SEQIV
|
||||
This IV generator generates an IV based on a sequence number by
|
||||
xoring it with a salt. This algorithm is mainly useful for CTR
|
||||
|
||||
config CRYPTO_ECHAINIV
|
||||
tristate "Encrypted Chain IV Generator"
|
||||
select CRYPTO_AEAD
|
||||
select CRYPTO_NULL
|
||||
select CRYPTO_RNG
|
||||
help
|
||||
This IV generator generates an IV based on the encryption of
|
||||
a sequence number xored with a salt. This is the default
|
||||
algorithm for CBC.
|
||||
|
||||
comment "Block modes"
|
||||
|
||||
config CRYPTO_CBC
|
||||
|
||||
@@ -21,6 +21,7 @@ obj-$(CONFIG_CRYPTO_BLKCIPHER2) += crypto_blkcipher.o
|
||||
obj-$(CONFIG_CRYPTO_BLKCIPHER2) += chainiv.o
|
||||
obj-$(CONFIG_CRYPTO_BLKCIPHER2) += eseqiv.o
|
||||
obj-$(CONFIG_CRYPTO_SEQIV) += seqiv.o
|
||||
obj-$(CONFIG_CRYPTO_ECHAINIV) += echainiv.o
|
||||
|
||||
crypto_hash-y += ahash.o
|
||||
crypto_hash-y += shash.o
|
||||
|
||||
531
crypto/echainiv.c
Normal file
531
crypto/echainiv.c
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user