diff options
author | James Morris <jmorris@intercode.com.au> | 2002-10-28 08:38:56 -0800 |
---|---|---|
committer | James Morris <jmorris@intercode.com.au> | 2002-10-28 08:38:56 -0800 |
commit | fb3652c1ec8f64657a670f196d4eed387c4e2a8c (patch) | |
tree | 7dc7ac284ed7a26de307cd5c35a6a07c9bf5504f /crypto | |
parent | 03882e044f1bbf3603a856652100652aeabe465a (diff) | |
download | history-fb3652c1ec8f64657a670f196d4eed387c4e2a8c.tar.gz |
[CRYPTO]: Update to IV get/set interface.
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/tcrypt.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c index a940f877b22310..8408d0ddc163be 100644 --- a/crypto/tcrypt.c +++ b/crypto/tcrypt.c @@ -982,6 +982,14 @@ test_des(void) memcpy(tvmem, des_cbc_enc_tv_template, tsize); des_tv = (void *) tvmem; + crypto_cipher_set_iv(tfm, des_tv[i].iv, crypto_tfm_alg_ivsize(tfm)); + crypto_cipher_get_iv(tfm, res, crypto_tfm_alg_ivsize(tfm)); + + if (memcmp(res, des_tv[i].iv, sizeof(res))) { + printk("crypto_cipher_[set|get]_iv() failed\n"); + goto out; + } + for (i = 0; i < DES_CBC_ENC_TEST_VECTORS; i++) { printk("test %d:\n", i + 1); @@ -1000,8 +1008,8 @@ test_des(void) sg[0].offset = ((long) p & ~PAGE_MASK); sg[0].length = len; - crypto_cipher_copy_iv(tfm, des_tv[i].iv, - crypto_tfm_alg_ivsize(tfm)); + crypto_cipher_set_iv(tfm, des_tv[i].iv, + crypto_tfm_alg_ivsize(tfm)); ret = crypto_cipher_encrypt(tfm, sg, 1); if (ret) { @@ -1060,7 +1068,7 @@ test_des(void) sg[1].offset = ((long) p & ~PAGE_MASK); sg[1].length = 11; - crypto_cipher_copy_iv(tfm, des_tv[i].iv, crypto_tfm_alg_ivsize(tfm)); + crypto_cipher_set_iv(tfm, des_tv[i].iv, crypto_tfm_alg_ivsize(tfm)); ret = crypto_cipher_encrypt(tfm, sg, 2); if (ret) { @@ -1108,7 +1116,7 @@ test_des(void) sg[0].offset = ((long) p & ~PAGE_MASK); sg[0].length = len; - crypto_cipher_copy_iv(tfm, des_tv[i].iv, + crypto_cipher_set_iv(tfm, des_tv[i].iv, crypto_tfm_alg_blocksize(tfm)); ret = crypto_cipher_decrypt(tfm, sg, 1); @@ -1161,7 +1169,7 @@ test_des(void) sg[1].offset = ((long) p & ~PAGE_MASK); sg[1].length = 4; - crypto_cipher_copy_iv(tfm, des_tv[i].iv, crypto_tfm_alg_ivsize(tfm)); + crypto_cipher_set_iv(tfm, des_tv[i].iv, crypto_tfm_alg_ivsize(tfm)); ret = crypto_cipher_decrypt(tfm, sg, 2); if (ret) { |