Skip to content

Commit 917fc52

Browse files
ThePassionateGUIDINGLI
authored andcommitted
include/crypto/virtio_crypto.h: remove virtio_crypto_get_iv_len()
cryptodev passes the IV length with each request, so the driver no longer needs to derive it from the algorithm. Signed-off-by: makejian <makejian@xiaomi.com>
1 parent a05db6a commit 917fc52

1 file changed

Lines changed: 0 additions & 31 deletions

File tree

‎include/crypto/virtio_crypto.h‎

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -96,37 +96,6 @@ int virtio_crypto_get_tag_len(int valg)
9696
return -EINVAL;
9797
}
9898

99-
static inline_function
100-
int virtio_crypto_get_iv_len(int vservice, int valg)
101-
{
102-
if (vservice == VIRTIO_CRYPTO_SERVICE_CIPHER)
103-
{
104-
switch (valg)
105-
{
106-
case VIRTIO_CRYPTO_CIPHER_3DES_CBC:
107-
return VIRTIO_CRYPTO_DES_IV_LEN;
108-
case VIRTIO_CRYPTO_CIPHER_AES_CBC:
109-
case VIRTIO_CRYPTO_CIPHER_AES_CTR:
110-
case VIRTIO_CRYPTO_CIPHER_AES_XTS:
111-
return VIRTIO_CRYPTO_AES_IV_LEN;
112-
}
113-
}
114-
else if (vservice = VIRTIO_CRYPTO_SERVICE_AEAD)
115-
{
116-
switch (valg)
117-
{
118-
case VIRTIO_CRYPTO_AEAD_GCM:
119-
return VIRTIO_CRYPTO_GCM_IV_LEN;
120-
case VIRTIO_CRYPTO_AEAD_CCM:
121-
return VIRTIO_CRYPTO_CCM_IV_LEN;
122-
case VIRTIO_CRYPTO_AEAD_CHACHA20_POLY1305:
123-
return VIRTIO_CRYPTO_CHACHAPOLY_IV_LEN;
124-
}
125-
}
126-
127-
return 0;
128-
}
129-
13099
static inline_function
131100
int virtio_crypto_get_auth_key_len(int valg)
132101
{

0 commit comments

Comments
 (0)