diff options
| author | Michael Brown | 2022-10-24 17:52:24 +0200 |
|---|---|---|
| committer | Michael Brown | 2022-10-25 14:21:28 +0200 |
| commit | 8e478e648fb68ac6f07e4e5cd80a5c1fefcb1cf5 (patch) | |
| tree | 59d27d4c71ed6c92b24d7fd6e007ed16e6379399 /src/include/ipxe/crypto.h | |
| parent | [crypto] Expose null crypto algorithm methods for reuse (diff) | |
| download | ipxe-8e478e648fb68ac6f07e4e5cd80a5c1fefcb1cf5.tar.gz ipxe-8e478e648fb68ac6f07e4e5cd80a5c1fefcb1cf5.tar.xz ipxe-8e478e648fb68ac6f07e4e5cd80a5c1fefcb1cf5.zip | |
[crypto] Allow initialisation vector length to vary from cipher blocksize
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include/ipxe/crypto.h')
| -rw-r--r-- | src/include/ipxe/crypto.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/include/ipxe/crypto.h b/src/include/ipxe/crypto.h index 34ab38930..931be0502 100644 --- a/src/include/ipxe/crypto.h +++ b/src/include/ipxe/crypto.h @@ -64,8 +64,9 @@ struct cipher_algorithm { * * @v ctx Context * @v iv Initialisation vector + * @v ivlen Initialisation vector length */ - void ( * setiv ) ( void *ctx, const void *iv ); + void ( * setiv ) ( void *ctx, const void *iv, size_t ivlen ); /** Encrypt data * * @v ctx Context @@ -190,8 +191,8 @@ static inline int cipher_setkey ( struct cipher_algorithm *cipher, } static inline void cipher_setiv ( struct cipher_algorithm *cipher, - void *ctx, const void *iv ) { - cipher->setiv ( ctx, iv ); + void *ctx, const void *iv, size_t ivlen ) { + cipher->setiv ( ctx, iv, ivlen ); } static inline void cipher_encrypt ( struct cipher_algorithm *cipher, @@ -268,7 +269,7 @@ extern void digest_null_update ( void *ctx, const void *src, size_t len ); extern void digest_null_final ( void *ctx, void *out ); extern int cipher_null_setkey ( void *ctx, const void *key, size_t keylen ); -extern void cipher_null_setiv ( void *ctx, const void *iv ); +extern void cipher_null_setiv ( void *ctx, const void *iv, size_t ivlen ); extern void cipher_null_encrypt ( void *ctx, const void *src, void *dst, size_t len ); extern void cipher_null_decrypt ( void *ctx, const void *src, void *dst, |
