pub fn field_to_bytes<I, F>(elems: I) -> impl Iterator<Item = u8>
Expand description
Deterministic, infallible inverse of bytes_to_field
.
The composition of field_to_bytes
with bytes_to_field
might contain
extra zero bytes.
§Example
[doctest ignored because it’s a private module.]
ⓘ
let bytes = [1, 2, 3];
let mut bytes_iter = field_to_bytes(bytes_to_field::<_, Fr254>(bytes));
assert_eq!(bytes_iter.next(), Some(1));
assert_eq!(bytes_iter.next(), Some(2));
assert_eq!(bytes_iter.next(), Some(3));
for _ in 0..28 {
assert_eq!(bytes_iter.next(), Some(0));
}
assert_eq!(bytes_iter.next(), None);
§Panics
Panics under the conditions listed at bytes_to_field
.