Skip to content

Commit a10f554

Browse files
committed
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 <[email protected]>
1 parent 3c08fee commit a10f554

File tree

3 files changed

+542
-0
lines changed

3 files changed

+542
-0
lines changed

crypto/Kconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,16 @@ config CRYPTO_SEQIV
227227
This IV generator generates an IV based on a sequence number by
228228
xoring it with a salt. This algorithm is mainly useful for CTR
229229

230+
config CRYPTO_ECHAINIV
231+
tristate "Encrypted Chain IV Generator"
232+
select CRYPTO_AEAD
233+
select CRYPTO_NULL
234+
select CRYPTO_RNG
235+
help
236+
This IV generator generates an IV based on the encryption of
237+
a sequence number xored with a salt. This is the default
238+
algorithm for CBC.
239+
230240
comment "Block modes"
231241

232242
config CRYPTO_CBC

crypto/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ obj-$(CONFIG_CRYPTO_BLKCIPHER2) += crypto_blkcipher.o
2121
obj-$(CONFIG_CRYPTO_BLKCIPHER2) += chainiv.o
2222
obj-$(CONFIG_CRYPTO_BLKCIPHER2) += eseqiv.o
2323
obj-$(CONFIG_CRYPTO_SEQIV) += seqiv.o
24+
obj-$(CONFIG_CRYPTO_ECHAINIV) += echainiv.o
2425

2526
crypto_hash-y += ahash.o
2627
crypto_hash-y += shash.o

0 commit comments

Comments
 (0)