aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests
diff options
context:
space:
mode:
authorMichael Brown <mcb30@ipxe.org>2022-10-24 16:52:24 +0100
committerMichael Brown <mcb30@ipxe.org>2022-10-25 13:21:28 +0100
commit8e478e648fb68ac6f07e4e5cd80a5c1fefcb1cf5 (patch)
tree59d27d4c71ed6c92b24d7fd6e007ed16e6379399 /src/tests
parent52f72d298abd81a6102ddddf2fff4918e4b077ce (diff)
downloadipxe-8e478e648fb68ac6f07e4e5cd80a5c1fefcb1cf5.tar.gz
[crypto] Allow initialisation vector length to vary from cipher blocksize
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/cipher_test.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/tests/cipher_test.c b/src/tests/cipher_test.c
index 800d6c138..5361502ff 100644
--- a/src/tests/cipher_test.c
+++ b/src/tests/cipher_test.c
@@ -61,7 +61,7 @@ void cipher_encrypt_okx ( struct cipher_test *test, const char *file,
/* Initialise cipher */
okx ( cipher_setkey ( cipher, ctx, test->key, test->key_len ) == 0,
file, line );
- cipher_setiv ( cipher, ctx, test->iv );
+ cipher_setiv ( cipher, ctx, test->iv, test->iv_len );
/* Perform encryption */
cipher_encrypt ( cipher, ctx, test->plaintext, ciphertext, len );
@@ -87,7 +87,7 @@ void cipher_decrypt_okx ( struct cipher_test *test, const char *file,
/* Initialise cipher */
okx ( cipher_setkey ( cipher, ctx, test->key, test->key_len ) == 0,
file, line );
- cipher_setiv ( cipher, ctx, test->iv );
+ cipher_setiv ( cipher, ctx, test->iv, test->iv_len );
/* Perform encryption */
cipher_decrypt ( cipher, ctx, test->ciphertext, plaintext, len );
@@ -143,7 +143,7 @@ cipher_cost ( struct cipher_algorithm *cipher, size_t key_len,
/* Initialise cipher */
rc = cipher_setkey ( cipher, ctx, key, key_len );
assert ( rc == 0 );
- cipher_setiv ( cipher, ctx, iv );
+ cipher_setiv ( cipher, ctx, iv, sizeof ( iv ) );
/* Profile cipher operation */
memset ( &profiler, 0, sizeof ( profiler ) );