add to_bytes_le Uxx arrays
@@ -320,6 +320,20 @@ macro_rules! _secret_array {
}
out
}
+
+ #[primitive(hacspec)]
+ pub fn to_bytes_le(self) -> Seq<U8> {
+ const FACTOR: usize = core::mem::size_of::<$t>();
+ let mut out : Seq<U8> = Seq::new($l * FACTOR);
+ for i in 0..$l {
+ let tmp : $t = self[i];
+ let tmp = <$t>::to_bytes_le(&[tmp]);
+ for j in 0..FACTOR {
+ out[i * FACTOR + j] = tmp[j];
+ }
+ }
+ out
+ }
}
impl $name {
#[external(hacspec)]
