From 9277cc6be66ac2e0928bece554657ac8bcec7924 Mon Sep 17 00:00:00 2001 From: James Kwong <161430705+james-kwong@users.noreply.github.com> Date: Thu, 25 Dec 2025 02:04:24 -0800 Subject: [PATCH] Change IV length range for XChaCha20 cipher Updated the valid range of initialization vector lengths for the XChaCha20 cipher from 12 bytes to 24 bytes, which is the correct value. Signed-off-by: James Kwong <161430705+james-kwong@users.noreply.github.com> --- Sources/CryptoSwift/AEAD/AEADXChaCha20Poly1305.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/CryptoSwift/AEAD/AEADXChaCha20Poly1305.swift b/Sources/CryptoSwift/AEAD/AEADXChaCha20Poly1305.swift index 03e0d725..8c83685c 100644 --- a/Sources/CryptoSwift/AEAD/AEADXChaCha20Poly1305.swift +++ b/Sources/CryptoSwift/AEAD/AEADXChaCha20Poly1305.swift @@ -24,8 +24,8 @@ public final class AEADXChaCha20Poly1305: AEAD { /// The key length (in bytes) required for the XChaCha20 cipher (32 bytes). public static let kLen = 32 // key length - /// The valid range of initialization vector lengths for the XChaCha20 cipher (12 bytes). - public static var ivRange = Range(12...12) + /// The valid range of initialization vector lengths for the XChaCha20 cipher (24 bytes). Extended from ChaCha20's 12 bytes. + public static var ivRange = Range(24...24) /// Encrypts the given plaintext using the XChaCha20 cipher and generates an authentication /// tag using the Poly1305 MAC.