diff --git a/sec1/src/point.rs b/sec1/src/point.rs index 17507922b..56c1e84e6 100644 --- a/sec1/src/point.rs +++ b/sec1/src/point.rs @@ -210,7 +210,7 @@ where } let (x_bytes, y_bytes) = self.bytes[1..].split_at(Size::to_usize()); - let x = Array::from_slice(x_bytes); + let x = Array::try_from(x_bytes).expect("size invariants were violated"); if self.is_compressed() { Coordinates::Compressed { @@ -222,7 +222,7 @@ where } else { Coordinates::Uncompressed { x, - y: Array::from_slice(y_bytes), + y: Array::try_from(y_bytes).expect("size invariants were violated"), } } }