examples/ipsec-secgw: add AES-CTR

RFC3686: Using AES Counter (CTR) Mode With IPsec ESP.`

Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
This commit is contained in:
Sergio Gonzalez Monroy 2016-09-29 16:44:10 +01:00 committed by Pablo de Lara
parent a9121c4001
commit 4470c22de2
4 changed files with 12 additions and 2 deletions

View File

@ -87,7 +87,7 @@ New Features
* configuration file
* AES CBC IV generation with cipher forward function
* AES GCM mode
* AES GCM/CTR mode
Resolved Issues

View File

@ -79,7 +79,7 @@ Constraints
* No IPv6 options headers.
* No AH mode.
* Supported algorithms: AES-CBC, AES-GCM, HMAC-SHA1 and NULL.
* Supported algorithms: AES-CBC, AES-CTR, AES-GCM, HMAC-SHA1 and NULL.
* Each SA must be handle by a unique lcore (*1 RX queue per port*).
* No chained mbufs.
@ -418,6 +418,7 @@ where each options means:
* *null*: NULL algorithm
* *aes-128-cbc*: AES-CBC 128-bit algorithm
* *aes-128-ctr*: AES-CTR 128-bit algorithm
* *aes-128-gcm*: AES-GCM 128-bit algorithm
* Syntax: *cipher_algo <your algorithm>*

View File

@ -102,6 +102,7 @@ esp_inbound(struct rte_mbuf *m, struct ipsec_sa *sa,
ip_hdr_len + sizeof(struct esp_hdr));
sym_cop->cipher.iv.length = sa->iv_len;
break;
case RTE_CRYPTO_CIPHER_AES_CTR:
case RTE_CRYPTO_CIPHER_AES_GCM:
icb = get_cnt_blk(m);
icb->salt = sa->salt;
@ -320,6 +321,7 @@ esp_outbound(struct rte_mbuf *m, struct ipsec_sa *sa,
sizeof(struct esp_hdr);
sym_cop->cipher.data.length = pad_payload_len + sa->iv_len;
break;
case RTE_CRYPTO_CIPHER_AES_CTR:
case RTE_CRYPTO_CIPHER_AES_GCM:
*iv = sa->seq;
sym_cop->cipher.data.offset = ip_hdr_len +

View File

@ -88,6 +88,13 @@ const struct supported_cipher_algo cipher_algos[] = {
.iv_len = 8,
.block_size = 4,
.key_len = 16
},
{
.keyword = "aes-128-ctr",
.algo = RTE_CRYPTO_CIPHER_AES_CTR,
.iv_len = 8,
.block_size = 16, /* XXX AESNI MB limition, should be 4 */
.key_len = 16
}
};