From 22509a1b722b477b7e492697310fbe6981ffa36a Mon Sep 17 00:00:00 2001 From: Tsung-Yu Hsieh <139031640+Pumpkin12699@users.noreply.github.com> Date: Mon, 28 Jul 2025 20:41:09 +0800 Subject: [PATCH] Fix index out of bounds error in SecretKey::check() method - Changed self.key[1] and self.key[2] to self.key[0] and self.key[1] - The key array has length 2, so indices 0 and 1 are valid - This prevents runtime panic during validation operations --- src/single.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/single.rs b/src/single.rs index aba500b..7806dcc 100644 --- a/src/single.rs +++ b/src/single.rs @@ -381,7 +381,7 @@ where { fn check(&self) -> Result<(), SerializationError> { //TODO probabaly turn into vartime and check that because vartime impl valid - match (self.key[1].check(), self.key[2].check()) { + match (self.key[0].check(), self.key[1].check()) { (Ok(()), Ok(())) => Ok(()), _ => Err(SerializationError::InvalidData), }