From 81f7b7effe02b6d545e6aa1e4b90feec279369c4 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Tue, 23 Jun 2026 17:27:23 +0200 Subject: [PATCH] crypto.aes_ccm: fix the IEEE 802.15.4 test vector Also make sure the test runs. Spotted by @TibboddiT - Thanks! By the way, the cbc_mac test didn't run either, so make sure it does. Fixes #35903 --- lib/std/crypto.zig | 3 +++ lib/std/crypto/aes_ccm.zig | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/std/crypto.zig b/lib/std/crypto.zig index 4c552df4bdd2877c9b858731ff03ea9bedbf1e64..0c50efba4c7ae48379828c87280a1e3eac41d677 100644 --- a/lib/std/crypto.zig +++ b/lib/std/crypto.zig @@ -282,6 +282,8 @@ test { _ = aead.aes_ocb.Aes128Ocb; _ = aead.aes_ocb.Aes256Ocb; + _ = aead.aes_ccm; + _ = aead.chacha_poly.ChaCha20Poly1305; _ = aead.chacha_poly.ChaCha12Poly1305; _ = aead.chacha_poly.ChaCha8Poly1305; @@ -294,6 +296,7 @@ test { _ = auth.hmac; _ = auth.cmac; + _ = auth.cbc_mac; _ = auth.siphash; _ = core.aes; diff --git a/lib/std/crypto/aes_ccm.zig b/lib/std/crypto/aes_ccm.zig index 2f14e61d6092054858c3e3bb5c4cfd3a706a3519..a06ce51221c0926664669fc76e86d83d1c1bc7a9 100644 --- a/lib/std/crypto/aes_ccm.zig +++ b/lib/std/crypto/aes_ccm.zig @@ -823,7 +823,7 @@ test "Aes128Ccm0 - IEEE 802.15.4 Data Frame (Encryption-only)" { var plaintext: [4]u8 = undefined; _ = try hexToBytes(&plaintext, "61626364"); var ad: [26]u8 = undefined; - _ = try hexToBytes(&ad, "69DC84214302000000004DEAC010000000048DEAC04050000"); + _ = try hexToBytes(&ad, "69DC842143020000000048DEAC010000000048DEAC0405000000"); // Expected ciphertext from IEEE spec var expected_ciphertext: [4]u8 = undefined; -- 2.54.0