if (auth_xform->auth.algo != RTE_CRYPTO_AUTH_AES_GMAC) {
GCM_LOG_ERR("Only AES GMAC is supported as an "
"authentication only algorithm");
- return -EINVAL;
+ return -ENOTSUP;
}
/* Set IV parameters */
sess->iv.offset = auth_xform->auth.iv.offset;
if (aead_xform->aead.algo != RTE_CRYPTO_AEAD_AES_GCM) {
GCM_LOG_ERR("The only combined operation "
"supported is AES GCM");
- return -EINVAL;
+ return -ENOTSUP;
}
/* Set IV parameters */
digest_length = aead_xform->aead.digest_length;
} else {
GCM_LOG_ERR("Wrong xform type, has to be AEAD or authentication");
- return -EINVAL;
+ return -ENOTSUP;
}
sess->key = AESNI_GCM_KEY_256;
break;
default:
- GCM_LOG_ERR("Unsupported key length");
+ GCM_LOG_ERR("Invalid key length");
return -EINVAL;
}
RTE_ASSERT(m_src != NULL);
- while (offset >= m_src->data_len) {
+ while (offset >= m_src->data_len && data_length != 0) {
offset -= m_src->data_len;
m_src = m_src->next;