* [PATCH ipsec-next v4 0/4] xfrm: add ARIA CBC, CTR and GCM support
@ 2026-11-30 6:27 Hong In-su
2026-11-30 6:27 ` [PATCH ipsec-next v4 1/4] nfp: reject unsupported IPsec encryption algorithms Hong In-su
` (4 more replies)
0 siblings, 5 replies; 7+ messages in thread
From: Hong In-su @ 2026-11-30 6:27 UTC (permalink / raw)
To: steffen.klassert, herbert
Cc: davem, edumazet, kuba, pabeni, horms, sd, andrew+netdev, csh0052,
oss-drivers, linux-crypto, netdev, ipsec, linux-kernel, his1415
This series adds ARIA CBC, CTR and GCM support to XFRM, allowing
the existing crypto API implementations to be used for IPsec ESP.
Following the Sashiko review of v3, this revision adds two
preparatory patches before the XFRM changes.
The first patch prevents the NFP IPsec offload driver from treating
unrecognized encryption algorithms without a SADB algorithm ID as
the NULL cipher. It returns -EOPNOTSUPP to allow fallback to
software crypto.
The second patch adds crypto API test vectors for
rfc3686(ctr(aria)) and rfc4106(gcm(aria)).
The XFRM changes in patches 3 and 4 are unchanged from v3.
Testing:
- CBC and CTR were previously tested with strongSwan.
- GCM was previously tested with strongSwan using 256-bit ARIA
keys and 64-bit, 96-bit and 128-bit ICVs.
- The new RFC3686 and RFC4106 test vectors cover all three ARIA
key lengths (128, 192 and 256 bits) and all three supported
ICV lengths for GCM.
- Both algorithms passed the crypto API self-tests under QEMU
x86_64 with CONFIG_CRYPTO_SELFTESTS and
CONFIG_CRYPTO_SELFTESTS_FULL enabled.
- The complete v4 series was build-tested and boot-tested.
- The NFP change was compile-tested only, as I do not have
access to NFP hardware.
- All four patches passed checkpatch.pl --strict.
Changes in v4:
- Add a preparatory NFP offload fix.
- Add RFC3686 and RFC4106 ARIA test vectors.
- No changes to the XFRM patches.
Changes in v3:
- Change the target tree from net-next to ipsec-next.
- Remove the CBC compatibility alias.
- Add ARIA GCM support in a separate patch.
Changes in v2:
- Remove the CTR compatibility alias.
- Change the CBC default key length to 128 bits.
- Clarify that the CTR key length includes the 32-bit nonce.
Previous versions:
v3: https://lore.kernel.org/netdev/20261127020448.55891-1-his1415@pribit.com/
v2: https://lore.kernel.org/netdev/20260916023135.26043-1-his1415@pribit.com/
v1: https://lore.kernel.org/netdev/20260909054530.7861-1-his1415@pribit.com/
Hong In-su (4):
nfp: reject unsupported IPsec encryption algorithms
crypto: testmgr - add ARIA RFC3686 and RFC4106 test vectors
xfrm: add ARIA CBC and CTR support
xfrm: add ARIA GCM support
crypto/testmgr.c | 17 ++
crypto/testmgr.h | 266 ++++++++++++++++++
.../net/ethernet/netronome/nfp/crypto/ipsec.c | 5 +
net/xfrm/xfrm_algo.c | 62 ++++
4 files changed, 350 insertions(+)
base-commit: 4d12fa4df5c15cebc587644e84b8f972874e66f1
--
2.43.0
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH ipsec-next v4 1/4] nfp: reject unsupported IPsec encryption algorithms
2026-11-30 6:27 [PATCH ipsec-next v4 0/4] xfrm: add ARIA CBC, CTR and GCM support Hong In-su
@ 2026-11-30 6:27 ` Hong In-su
2026-11-30 6:27 ` [PATCH ipsec-next v4 2/4] crypto: testmgr - add ARIA RFC3686 and RFC4106 test vectors Hong In-su
` (3 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: Hong In-su @ 2026-11-30 6:27 UTC (permalink / raw)
To: steffen.klassert, herbert
Cc: davem, edumazet, kuba, pabeni, horms, sd, andrew+netdev, csh0052,
oss-drivers, linux-crypto, netdev, ipsec, linux-kernel, his1415
The NFP IPsec offload driver uses SADB_EALG_NONE to identify
ChaCha20-Poly1305 by its algorithm name. Other algorithms without
a SADB algorithm ID fall through to the NULL cipher case.
Reject unrecognized encryption algorithms when an AEAD or encryption
algorithm is present, while preserving the existing handling of AH
and ChaCha20-Poly1305.
Return -EOPNOTSUPP to allow fallback to software crypto.
Compile-tested only.
Signed-off-by: Hong In-su <his1415@pribit.com>
---
drivers/net/ethernet/netronome/nfp/crypto/ipsec.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/net/ethernet/netronome/nfp/crypto/ipsec.c b/drivers/net/ethernet/netronome/nfp/crypto/ipsec.c
index 960d7513aa8d..5d861e5c4665 100644
--- a/drivers/net/ethernet/netronome/nfp/crypto/ipsec.c
+++ b/drivers/net/ethernet/netronome/nfp/crypto/ipsec.c
@@ -405,6 +405,11 @@ static int nfp_net_xfrm_add_state(struct net_device *dev,
cfg->ctrl_word.cipher = NFP_IPSEC_CIPHER_CHACHA20;
break;
}
+ if (x->aead || x->ealg) {
+ NL_SET_ERR_MSG_MOD(extack,
+ "Unsupported encryption algorithm for offload");
+ return -EOPNOTSUPP;
+ }
fallthrough;
case SADB_EALG_NULL:
cfg->ctrl_word.cimode = NFP_IPSEC_CIMODE_CBC;
--
2.43.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH ipsec-next v4 2/4] crypto: testmgr - add ARIA RFC3686 and RFC4106 test vectors
2026-11-30 6:27 [PATCH ipsec-next v4 0/4] xfrm: add ARIA CBC, CTR and GCM support Hong In-su
2026-11-30 6:27 ` [PATCH ipsec-next v4 1/4] nfp: reject unsupported IPsec encryption algorithms Hong In-su
@ 2026-11-30 6:27 ` Hong In-su
2026-11-30 6:27 ` [PATCH ipsec-next v4 3/4] xfrm: add ARIA CBC and CTR support Hong In-su
` (2 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: Hong In-su @ 2026-11-30 6:27 UTC (permalink / raw)
To: steffen.klassert, herbert
Cc: davem, edumazet, kuba, pabeni, horms, sd, andrew+netdev, csh0052,
oss-drivers, linux-crypto, netdev, ipsec, linux-kernel, his1415
Add test vectors for rfc3686(ctr(aria)) and rfc4106(gcm(aria))
to exercise the existing crypto API implementations before
adding XFRM support.
Cover all three ARIA key lengths (128, 192 and 256 bits).
For RFC3686, include single-block and multi-block test cases.
For RFC4106, cover 64-bit, 96-bit and 128-bit authentication tags.
The test vectors were generated using OpenSSL.
Tested under QEMU x86_64 with CONFIG_CRYPTO_SELFTESTS and
CONFIG_CRYPTO_SELFTESTS_FULL enabled. Both algorithms passed
the crypto API self-tests using the generic ARIA implementation.
Signed-off-by: Hong In-su <his1415@pribit.com>
---
crypto/testmgr.c | 17 +++
crypto/testmgr.h | 266 +++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 283 insertions(+)
diff --git a/crypto/testmgr.c b/crypto/testmgr.c
index 9419d61d0602..7737e387d8d2 100644
--- a/crypto/testmgr.c
+++ b/crypto/testmgr.c
@@ -5220,6 +5220,12 @@ static const struct alg_test_desc alg_test_descs[] = {
.suite = {
.cipher = __VECS(aes_ctr_rfc3686_tv_template)
}
+ }, {
+ .alg = "rfc3686(ctr(aria))",
+ .test = alg_test_skcipher,
+ .suite = {
+ .cipher = __VECS(aria_ctr_rfc3686_tv_template)
+ }
}, {
.alg = "rfc3686(ctr(sm4))",
.test = alg_test_skcipher,
@@ -5238,6 +5244,17 @@ static const struct alg_test_desc alg_test_descs[] = {
.aad_iv = 1,
}
}
+ }, {
+ .alg = "rfc4106(gcm(aria))",
+ .generic_driver = "rfc4106(gcm_base(ctr(aria-generic),ghash-lib))",
+ .test = alg_test_aead,
+ .suite = {
+ .aead = {
+ ____VECS(aria_gcm_rfc4106_tv_template),
+ .einval_allowed = 1,
+ .aad_iv = 1,
+ }
+ }
}, {
.alg = "rfc4309(ccm(aes))",
.generic_driver = "rfc4309(ccm_base(ctr(aes-lib),cbcmac-aes-lib))",
diff --git a/crypto/testmgr.h b/crypto/testmgr.h
index 0ee15a8fae27..53bbd219f9b6 100644
--- a/crypto/testmgr.h
+++ b/crypto/testmgr.h
@@ -28486,6 +28486,91 @@ static const struct cipher_testvec aria_ctr_tv_template[] = {
}
};
+static const struct cipher_testvec aria_ctr_rfc3686_tv_template[] = {
+ { /* Generated using OpenSSL */
+ .key = "\xae\x68\x52\xf8\x12\x10\x67\xcc"
+ "\x4b\xf7\xa5\x76\x55\x77\xf3\x9e"
+ "\x00\x00\x00\x30",
+ .klen = 20,
+ .iv = "\x00\x00\x00\x00\x00\x00\x00\x00",
+ .ptext = "Single block msg",
+ .ctext = "\x04\x88\x4b\x0e\xee\xc3\xd1\x8e"
+ "\xc9\x68\x30\x8a\x38\xbf\xf6\x8c",
+ .len = 16,
+ }, {
+ .key = "\x7e\x24\x06\x78\x17\xfa\xe0\xd7"
+ "\x43\xd6\xce\x1f\x32\x53\x91\x63"
+ "\x00\x6c\xb6\xdb",
+ .klen = 20,
+ .iv = "\xc0\x54\x3b\x59\xda\x48\xd9\x0b",
+ .ptext = "\x00\x01\x02\x03\x04\x05\x06\x07"
+ "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
+ "\x10\x11\x12\x13\x14\x15\x16\x17"
+ "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f",
+ .ctext = "\x2f\x64\x9d\x04\x9d\x52\x34\x74"
+ "\x25\x44\x5e\x14\xfa\x01\x8e\x72"
+ "\x13\xb6\x1f\x1e\x42\x9f\xfe\xd0"
+ "\x25\x53\x47\xaa\xce\x1e\x0b\x15",
+ .len = 32,
+ }, {
+ .key = "\x16\xaf\x5b\x14\x5f\xc9\xf5\x79"
+ "\xc1\x75\xf9\x3e\x3b\xfb\x0e\xed"
+ "\x86\x3d\x06\xcc\xfd\xb7\x85\x15"
+ "\x00\x00\x00\x48",
+ .klen = 28,
+ .iv = "\x36\x73\x3c\x14\x7d\x6d\x93\xcb",
+ .ptext = "Single block msg",
+ .ctext = "\xea\xc2\xed\x97\x9e\xcd\x5a\x8e"
+ "\xbd\xfe\xe4\x6f\xfd\x3e\x42\x3e",
+ .len = 16,
+ }, {
+ .key = "\x7c\x5c\xb2\x40\x1b\x3d\xc3\x3c"
+ "\x19\xe7\x34\x08\x19\xe0\xf6\x9c"
+ "\x67\x8c\x3d\xb8\xe6\xf6\xa9\x1a"
+ "\x00\x96\xb0\x3b",
+ .klen = 28,
+ .iv = "\x02\x0c\x6e\xad\xc2\xcb\x50\x0d",
+ .ptext = "\x00\x01\x02\x03\x04\x05\x06\x07"
+ "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
+ "\x10\x11\x12\x13\x14\x15\x16\x17"
+ "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f",
+ .ctext = "\x80\xf1\x58\xa7\xed\xed\xeb\xd1"
+ "\x04\x1f\x78\x12\x7d\xf5\xe0\xfc"
+ "\xf0\x9e\x5e\x55\xe3\xa1\xf9\x3c"
+ "\x0d\x65\x20\x59\xaa\x4a\xdd\xf8",
+ .len = 32,
+ }, {
+ .key = "\x77\x6b\xef\xf2\x85\x1d\xb0\x6f"
+ "\x4c\x8a\x05\x42\xc8\x69\x6f\x6c"
+ "\x6a\x81\xaf\x1e\xec\x96\xb4\xd3"
+ "\x7f\xc1\xd6\x89\xe6\xc1\xc1\x04"
+ "\x00\x00\x00\x60",
+ .klen = 36,
+ .iv = "\xdb\x56\x72\xc9\x7a\xa8\xf0\xb2",
+ .ptext = "Single block msg",
+ .ctext = "\x2f\x73\xab\x5c\x9a\x19\xc2\xfb"
+ "\x1a\x16\xde\x7c\xa8\x2f\x36\xef",
+ .len = 16,
+ }, {
+ .key = "\xf6\xd6\x6d\x6b\xd5\x2d\x59\xbb"
+ "\x07\x96\x36\x58\x79\xef\xf8\x86"
+ "\xc6\x6d\xd5\x1a\x5b\x6a\x99\x74"
+ "\x4b\x50\x59\x0c\x87\xa2\x38\x84"
+ "\x00\xfa\xac\x24",
+ .klen = 36,
+ .iv = "\xc1\x58\x5e\xf1\x5a\x43\xd8\x75",
+ .ptext = "\x00\x01\x02\x03\x04\x05\x06\x07"
+ "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
+ "\x10\x11\x12\x13\x14\x15\x16\x17"
+ "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f",
+ .ctext = "\xa0\x20\xbf\xe2\x84\x6a\x25\x76"
+ "\xf8\xbf\xac\x4f\x48\xec\xca\xf2"
+ "\xf8\xee\x06\x00\x86\x9a\x16\x9b"
+ "\x15\x9f\x91\x70\xd7\x8c\x66\x34",
+ .len = 32,
+ }
+};
+
static const struct aead_testvec aria_gcm_tv_template[] = {
{
.key = "\xe9\x1e\x5e\x75\xda\x65\x55\x4a"
@@ -28598,6 +28683,187 @@ static const struct aead_testvec aria_gcm_tv_template[] = {
}
};
+static const struct aead_testvec aria_gcm_rfc4106_tv_template[] = {
+ { /* Generated using OpenSSL */
+ .key = "\x00\x01\x02\x03\x04\x05\x06\x07"
+ "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
+ "\xa0\xa1\xa2\xa3",
+ .klen = 20,
+ .iv = "\x00\x00\x00\x00\x00\x00\x00\x02",
+ .ptext = "\x00\x01\x02\x03\x04\x05\x06\x07"
+ "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
+ "\x10\x11\x12\x13\x14\x15\x16",
+ .plen = 23,
+ .assoc = "\x01\x02\x03\x04\x00\x00\x00\x01"
+ "\x00\x00\x00\x00\x00\x00\x00\x02",
+ .alen = 16,
+ .ctext = "\xdb\x18\x05\x3a\xc4\x1c\xa9\xb3"
+ "\xf7\xdb\x87\x65\x7b\xbe\xc8\x51"
+ "\xdf\xd8\x8f\xbf\x28\x47\x4f\x71"
+ "\x99\x33\x51\xfc\xc1\x89\xb2",
+ .clen = 31,
+ }, {
+ .key = "\x00\x01\x02\x03\x04\x05\x06\x07"
+ "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
+ "\xa0\xa1\xa2\xa3",
+ .klen = 20,
+ .iv = "\x00\x00\x00\x00\x00\x00\x00\x03",
+ .ptext = "\x00\x01\x02\x03\x04\x05\x06\x07"
+ "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
+ "\x10\x11\x12\x13\x14\x15\x16",
+ .plen = 23,
+ .assoc = "\x01\x02\x03\x04\x00\x00\x00\x01"
+ "\x00\x00\x00\x00\x00\x00\x00\x03",
+ .alen = 16,
+ .ctext = "\xfc\xe1\x92\xcc\x77\xf8\xf8\x24"
+ "\x86\x45\x3d\x86\x7c\xc2\x2b\xf7"
+ "\xb3\x04\x62\xd7\x4f\xcd\xa1\x93"
+ "\xd5\x46\xd1\x3e\x5b\xbb\x7a\x0b"
+ "\xec\x7c\x23",
+ .clen = 35,
+ }, {
+ .key = "\x00\x01\x02\x03\x04\x05\x06\x07"
+ "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
+ "\xa0\xa1\xa2\xa3",
+ .klen = 20,
+ .iv = "\x00\x00\x00\x00\x00\x00\x00\x04",
+ .ptext = "\x00\x01\x02\x03\x04\x05\x06\x07"
+ "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
+ "\x10\x11\x12\x13\x14\x15\x16",
+ .plen = 23,
+ .assoc = "\x01\x02\x03\x04\x00\x00\x00\x01"
+ "\x00\x00\x00\x00\x00\x00\x00\x04",
+ .alen = 16,
+ .ctext = "\xae\x7d\x94\xcb\xe3\xdb\x7e\xb3"
+ "\x27\x7e\x91\x5c\xbb\xf3\x6d\x40"
+ "\x79\x78\x75\x54\x23\xc7\x8f\xfc"
+ "\x07\x91\x6b\xac\xce\x8d\x52\x6e"
+ "\x29\x14\xd1\xec\x81\xac\xb5",
+ .clen = 39,
+ }, {
+ .key = "\x00\x01\x02\x03\x04\x05\x06\x07"
+ "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
+ "\x10\x11\x12\x13\x14\x15\x16\x17"
+ "\xa0\xa1\xa2\xa3",
+ .klen = 28,
+ .iv = "\x00\x00\x00\x00\x00\x00\x00\x02",
+ .ptext = "\x00\x01\x02\x03\x04\x05\x06\x07"
+ "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
+ "\x10\x11\x12\x13\x14\x15\x16",
+ .plen = 23,
+ .assoc = "\x01\x02\x03\x04\x00\x00\x00\x01"
+ "\x00\x00\x00\x00\x00\x00\x00\x02",
+ .alen = 16,
+ .ctext = "\x03\x65\x6c\xd9\x51\x6d\x0f\xb3"
+ "\x14\x79\x76\x1b\x7b\x98\x82\x7c"
+ "\xe7\xbc\x9f\xc9\x0e\x30\xc8\x9d"
+ "\x3b\xaa\x49\x2f\x1c\x2f\x4b",
+ .clen = 31,
+ }, {
+ .key = "\x00\x01\x02\x03\x04\x05\x06\x07"
+ "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
+ "\x10\x11\x12\x13\x14\x15\x16\x17"
+ "\xa0\xa1\xa2\xa3",
+ .klen = 28,
+ .iv = "\x00\x00\x00\x00\x00\x00\x00\x03",
+ .ptext = "\x00\x01\x02\x03\x04\x05\x06\x07"
+ "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
+ "\x10\x11\x12\x13\x14\x15\x16",
+ .plen = 23,
+ .assoc = "\x01\x02\x03\x04\x00\x00\x00\x01"
+ "\x00\x00\x00\x00\x00\x00\x00\x03",
+ .alen = 16,
+ .ctext = "\xb5\x5a\xcd\x47\xb0\x7e\x43\x36"
+ "\x60\x8f\xa9\xdd\xb1\x13\xcf\xdd"
+ "\x0e\x18\x8d\xb6\xaf\xd6\x9c\xc1"
+ "\x80\x94\xd4\xf7\xf7\xa4\xfe\xf7"
+ "\x6e\x1f\xae",
+ .clen = 35,
+ }, {
+ .key = "\x00\x01\x02\x03\x04\x05\x06\x07"
+ "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
+ "\x10\x11\x12\x13\x14\x15\x16\x17"
+ "\xa0\xa1\xa2\xa3",
+ .klen = 28,
+ .iv = "\x00\x00\x00\x00\x00\x00\x00\x04",
+ .ptext = "\x00\x01\x02\x03\x04\x05\x06\x07"
+ "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
+ "\x10\x11\x12\x13\x14\x15\x16",
+ .plen = 23,
+ .assoc = "\x01\x02\x03\x04\x00\x00\x00\x01"
+ "\x00\x00\x00\x00\x00\x00\x00\x04",
+ .alen = 16,
+ .ctext = "\x33\xef\x88\x18\xb5\xc7\xb8\xf1"
+ "\x17\x5e\xed\xc2\x1f\x9c\xf6\x69"
+ "\x78\x7d\x1a\x74\x78\xd4\xc5\xca"
+ "\xab\xd1\x23\xb9\x14\xc8\xea\x4e"
+ "\xfe\x99\xb4\xda\x2b\x49\x49",
+ .clen = 39,
+ }, {
+ .key = "\x00\x01\x02\x03\x04\x05\x06\x07"
+ "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
+ "\x10\x11\x12\x13\x14\x15\x16\x17"
+ "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
+ "\xa0\xa1\xa2\xa3",
+ .klen = 36,
+ .iv = "\x00\x00\x00\x00\x00\x00\x00\x02",
+ .ptext = "\x00\x01\x02\x03\x04\x05\x06\x07"
+ "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
+ "\x10\x11\x12\x13\x14\x15\x16",
+ .plen = 23,
+ .assoc = "\x01\x02\x03\x04\x00\x00\x00\x01"
+ "\x00\x00\x00\x00\x00\x00\x00\x02",
+ .alen = 16,
+ .ctext = "\x5a\xa6\xcd\x5b\xe9\x06\xa9\xfa"
+ "\x30\x64\x41\xb4\x87\x14\x09\xa2"
+ "\x1a\x4b\xc9\x1a\x1a\x32\x85\xb1"
+ "\xf3\xd9\xdc\x47\x67\x12\x28",
+ .clen = 31,
+ }, {
+ .key = "\x00\x01\x02\x03\x04\x05\x06\x07"
+ "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
+ "\x10\x11\x12\x13\x14\x15\x16\x17"
+ "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
+ "\xa0\xa1\xa2\xa3",
+ .klen = 36,
+ .iv = "\x00\x00\x00\x00\x00\x00\x00\x03",
+ .ptext = "\x00\x01\x02\x03\x04\x05\x06\x07"
+ "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
+ "\x10\x11\x12\x13\x14\x15\x16",
+ .plen = 23,
+ .assoc = "\x01\x02\x03\x04\x00\x00\x00\x01"
+ "\x00\x00\x00\x00\x00\x00\x00\x03",
+ .alen = 16,
+ .ctext = "\x84\x9e\x7c\xb1\x13\x59\x93\x1d"
+ "\x1d\x80\x6e\xce\xf1\x09\x7b\x90"
+ "\x9f\x17\xc1\x85\x9b\x81\x16\x37"
+ "\x5d\x7e\x98\x87\xa9\x5e\xf6\x51"
+ "\x41\x3d\x39",
+ .clen = 35,
+ }, {
+ .key = "\x00\x01\x02\x03\x04\x05\x06\x07"
+ "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
+ "\x10\x11\x12\x13\x14\x15\x16\x17"
+ "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
+ "\xa0\xa1\xa2\xa3",
+ .klen = 36,
+ .iv = "\x00\x00\x00\x00\x00\x00\x00\x04",
+ .ptext = "\x00\x01\x02\x03\x04\x05\x06\x07"
+ "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
+ "\x10\x11\x12\x13\x14\x15\x16",
+ .plen = 23,
+ .assoc = "\x01\x02\x03\x04\x00\x00\x00\x01"
+ "\x00\x00\x00\x00\x00\x00\x00\x04",
+ .alen = 16,
+ .ctext = "\x11\x31\x6c\xde\xf3\xec\x76\xae"
+ "\x8b\x00\x28\xc0\x59\x07\xe3\x90"
+ "\x39\x40\xda\x87\x4d\xc8\x50\x05"
+ "\x76\x91\xc0\x1a\x43\x90\xbb\xe6"
+ "\xdd\x74\x29\x89\xb8\xa6\x05",
+ .clen = 39,
+ }
+};
+
static const struct cipher_testvec chacha20_tv_template[] = {
{ /* RFC7539 A.2. Test Vector #1 */
.key = "\x00\x00\x00\x00\x00\x00\x00\x00"
--
2.43.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH ipsec-next v4 3/4] xfrm: add ARIA CBC and CTR support
2026-11-30 6:27 [PATCH ipsec-next v4 0/4] xfrm: add ARIA CBC, CTR and GCM support Hong In-su
2026-11-30 6:27 ` [PATCH ipsec-next v4 1/4] nfp: reject unsupported IPsec encryption algorithms Hong In-su
2026-11-30 6:27 ` [PATCH ipsec-next v4 2/4] crypto: testmgr - add ARIA RFC3686 and RFC4106 test vectors Hong In-su
@ 2026-11-30 6:27 ` Hong In-su
2026-11-30 6:27 ` [PATCH ipsec-next v4 4/4] xfrm: add ARIA GCM support Hong In-su
2026-11-30 7:46 ` [PATCH ipsec-next v4 0/4] xfrm: add ARIA CBC, CTR and " Antony Antony
4 siblings, 0 replies; 7+ messages in thread
From: Hong In-su @ 2026-11-30 6:27 UTC (permalink / raw)
To: steffen.klassert, herbert
Cc: davem, edumazet, kuba, pabeni, horms, sd, andrew+netdev, csh0052,
oss-drivers, linux-crypto, netdev, ipsec, linux-kernel, his1415
The kernel crypto API already provides ARIA implementations, but XFRM
does not have algorithm descriptors for them. Consequently, ARIA cannot
be selected for ESP through XFRM.
Add XFRM algorithm descriptors for CBC and RFC3686 CTR modes using the
existing cbc(aria) and rfc3686(ctr(aria)) crypto algorithms.
The CBC and CTR modes have been tested with IPsec using strongSwan.
Signed-off-by: Hong In-su <his1415@pribit.com>
---
net/xfrm/xfrm_algo.c | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/net/xfrm/xfrm_algo.c b/net/xfrm/xfrm_algo.c
index 70434495f23f..98ef2c48982a 100644
--- a/net/xfrm/xfrm_algo.c
+++ b/net/xfrm/xfrm_algo.c
@@ -512,6 +512,32 @@ static struct xfrm_algo_desc ealg_list[] = {
.sadb_alg_maxbits = 256
}
},
+{
+ .name = "cbc(aria)",
+
+ .uinfo = {
+ .encr = {
+ .geniv = "echainiv",
+ .blockbits = 128,
+ .defkeybits = 128,
+ }
+ },
+
+ .pfkey_supported = 0,
+},
+{
+ .name = "rfc3686(ctr(aria))",
+
+ .uinfo = {
+ .encr = {
+ .geniv = "seqiv",
+ .blockbits = 128,
+ .defkeybits = 160, /* 128-bit key + 32-bit nonce */
+ }
+ },
+
+ .pfkey_supported = 0,
+},
{
.name = "cbc(twofish)",
.compat = "twofish",
--
2.43.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH ipsec-next v4 4/4] xfrm: add ARIA GCM support
2026-11-30 6:27 [PATCH ipsec-next v4 0/4] xfrm: add ARIA CBC, CTR and GCM support Hong In-su
` (2 preceding siblings ...)
2026-11-30 6:27 ` [PATCH ipsec-next v4 3/4] xfrm: add ARIA CBC and CTR support Hong In-su
@ 2026-11-30 6:27 ` Hong In-su
2026-11-30 7:46 ` [PATCH ipsec-next v4 0/4] xfrm: add ARIA CBC, CTR and " Antony Antony
4 siblings, 0 replies; 7+ messages in thread
From: Hong In-su @ 2026-11-30 6:27 UTC (permalink / raw)
To: steffen.klassert, herbert
Cc: davem, edumazet, kuba, pabeni, horms, sd, andrew+netdev, csh0052,
oss-drivers, linux-crypto, netdev, ipsec, linux-kernel, his1415
The kernel crypto API already supports rfc4106(gcm(aria)), but XFRM
does not have the corresponding algorithm descriptors.
Add XFRM AEAD algorithm descriptors for ARIA GCM with 64-bit, 96-bit
and 128-bit ICV lengths.
Tested with strongSwan using 256-bit ARIA keys and all three
supported ICV lengths.
Signed-off-by: Hong In-su <his1415@pribit.com>
---
net/xfrm/xfrm_algo.c | 36 ++++++++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)
diff --git a/net/xfrm/xfrm_algo.c b/net/xfrm/xfrm_algo.c
index 98ef2c48982a..d74f86d4e672 100644
--- a/net/xfrm/xfrm_algo.c
+++ b/net/xfrm/xfrm_algo.c
@@ -82,6 +82,42 @@ static struct xfrm_algo_desc aead_list[] = {
.sadb_alg_maxbits = 256
}
},
+{
+ .name = "rfc4106(gcm(aria))",
+
+ .uinfo = {
+ .aead = {
+ .geniv = "seqiv",
+ .icv_truncbits = 64,
+ }
+ },
+
+ .pfkey_supported = 0,
+},
+{
+ .name = "rfc4106(gcm(aria))",
+
+ .uinfo = {
+ .aead = {
+ .geniv = "seqiv",
+ .icv_truncbits = 96,
+ }
+ },
+
+ .pfkey_supported = 0,
+},
+{
+ .name = "rfc4106(gcm(aria))",
+
+ .uinfo = {
+ .aead = {
+ .geniv = "seqiv",
+ .icv_truncbits = 128,
+ }
+ },
+
+ .pfkey_supported = 0,
+},
{
.name = "rfc4309(ccm(aes))",
--
2.43.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH ipsec-next v4 0/4] xfrm: add ARIA CBC, CTR and GCM support
2026-11-30 6:27 [PATCH ipsec-next v4 0/4] xfrm: add ARIA CBC, CTR and GCM support Hong In-su
` (3 preceding siblings ...)
2026-11-30 6:27 ` [PATCH ipsec-next v4 4/4] xfrm: add ARIA GCM support Hong In-su
@ 2026-11-30 7:46 ` Antony Antony
2026-11-30 8:18 ` Hong In-su
4 siblings, 1 reply; 7+ messages in thread
From: Antony Antony @ 2026-11-30 7:46 UTC (permalink / raw)
To: Hong In-su
Cc: steffen.klassert, herbert, davem, edumazet, kuba, pabeni, horms,
sd, andrew+netdev, csh0052, oss-drivers, linux-crypto, netdev,
ipsec, linux-kernel, Antony Antony
On Mon, Nov 30, 2026 at 06:27:18AM +0000, Hong In-su wrote:
> This series adds ARIA CBC, CTR and GCM support to XFRM, allowing
> the existing crypto API implementations to be used for IPsec ESP.
>
> Following the Sashiko review of v3, this revision adds two
> preparatory patches before the XFRM changes.
>
> The first patch prevents the NFP IPsec offload driver from treating
> unrecognized encryption algorithms without a SADB algorithm ID as
> the NULL cipher. It returns -EOPNOTSUPP to allow fallback to
> software crypto.
>
> The second patch adds crypto API test vectors for
> rfc3686(ctr(aria)) and rfc4106(gcm(aria)).
>
> The XFRM changes in patches 3 and 4 are unchanged from v3.
>
> Testing:
> - CBC and CTR were previously tested with strongSwan.
> - GCM was previously tested with strongSwan using 256-bit ARIA
Is ARIA supported in upstream strongSwan? I couldn't find it.
Also, where are the IKEv2 Code Points to negotiate ARIA in IKEv2?
I have only seen an expired Informational draft
(draft-nsri-ipsecme-aria-ipsec-00), and no push to make it a standard
RFC or get IANA IKEv2 Code Point?
Also noticed the ARIA AEAD is not part of TLS 1.3; it is defined only for
TLS 1.2 (RFC 6209). I wonder why it is being extended to IPsec now?
Without an IETF-assigned IKEv2 code point, interoperation would be
hard. Are you planning to get a code point?
> keys and 64-bit, 96-bit and 128-bit ICVs.
> - The new RFC3686 and RFC4106 test vectors cover all three ARIA
> key lengths (128, 192 and 256 bits) and all three supported
> ICV lengths for GCM.
> - Both algorithms passed the crypto API self-tests under QEMU
> x86_64 with CONFIG_CRYPTO_SELFTESTS and
> CONFIG_CRYPTO_SELFTESTS_FULL enabled.
> - The complete v4 series was build-tested and boot-tested.
> - The NFP change was compile-tested only, as I do not have
> access to NFP hardware.
> - All four patches passed checkpatch.pl --strict.
>
> Changes in v4:
> - Add a preparatory NFP offload fix.
> - Add RFC3686 and RFC4106 ARIA test vectors.
> - No changes to the XFRM patches.
>
> Changes in v3:
> - Change the target tree from net-next to ipsec-next.
> - Remove the CBC compatibility alias.
> - Add ARIA GCM support in a separate patch.
>
> Changes in v2:
> - Remove the CTR compatibility alias.
> - Change the CBC default key length to 128 bits.
> - Clarify that the CTR key length includes the 32-bit nonce.
>
> Previous versions:
> v3: https://lore.kernel.org/netdev/20261127020448.55891-1-his1415@pribit.com/
> v2: https://lore.kernel.org/netdev/20260916023135.26043-1-his1415@pribit.com/
> v1: https://lore.kernel.org/netdev/20260909054530.7861-1-his1415@pribit.com/
>
> Hong In-su (4):
> nfp: reject unsupported IPsec encryption algorithms
> crypto: testmgr - add ARIA RFC3686 and RFC4106 test vectors
> xfrm: add ARIA CBC and CTR support
> xfrm: add ARIA GCM support
>
> crypto/testmgr.c | 17 ++
> crypto/testmgr.h | 266 ++++++++++++++++++
> .../net/ethernet/netronome/nfp/crypto/ipsec.c | 5 +
> net/xfrm/xfrm_algo.c | 62 ++++
> 4 files changed, 350 insertions(+)
>
>
> base-commit: 4d12fa4df5c15cebc587644e84b8f972874e66f1
> --
> 2.43.0
>
>
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH ipsec-next v4 0/4] xfrm: add ARIA CBC, CTR and GCM support
2026-11-30 7:46 ` [PATCH ipsec-next v4 0/4] xfrm: add ARIA CBC, CTR and " Antony Antony
@ 2026-11-30 8:18 ` Hong In-su
0 siblings, 0 replies; 7+ messages in thread
From: Hong In-su @ 2026-11-30 8:18 UTC (permalink / raw)
To: antony
Cc: steffen.klassert, herbert, davem, edumazet, kuba, pabeni, horms,
sd, andrew+netdev, csh0052, oss-drivers, linux-crypto, netdev,
ipsec, linux-kernel, his1415
Hi Antony,
Thanks for your questions.
ARIA is not supported by upstream strongSwan. The tests were
performed using a locally modified version of strongSwan.
I should have made this clear in the cover letter.
We use ARIA in VPN products developed for the Korean market,
where there is a practical need for ARIA support.
There are currently no IANA-assigned IKEv2 transform IDs for
ARIA. Our implementation uses locally defined transform IDs,
and interoperability with standard IKEv2 implementations
has not been tested.
The motivation for this series is to allow the existing
ARIA implementations in the Linux crypto API to be used
through XFRM without maintaining local kernel patches.
The proposed XFRM changes are independent of IKEv2 transform
ID assignments and can also be used with manually configured SAs.
As a VPN software developer, my current work is focused on
implementation rather than protocol standardization.
I am not currently in a position to pursue IETF standardization
or IANA code point assignments for ARIA.
Thanks,
Hong In-su
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2026-11-30 8:20 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-30 6:27 [PATCH ipsec-next v4 0/4] xfrm: add ARIA CBC, CTR and GCM support Hong In-su
2026-11-30 6:27 ` [PATCH ipsec-next v4 1/4] nfp: reject unsupported IPsec encryption algorithms Hong In-su
2026-11-30 6:27 ` [PATCH ipsec-next v4 2/4] crypto: testmgr - add ARIA RFC3686 and RFC4106 test vectors Hong In-su
2026-11-30 6:27 ` [PATCH ipsec-next v4 3/4] xfrm: add ARIA CBC and CTR support Hong In-su
2026-11-30 6:27 ` [PATCH ipsec-next v4 4/4] xfrm: add ARIA GCM support Hong In-su
2026-11-30 7:46 ` [PATCH ipsec-next v4 0/4] xfrm: add ARIA CBC, CTR and " Antony Antony
2026-11-30 8:18 ` Hong In-su
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox