Skip to main content

packed_u32_elements_to_bytes

Function packed_u32_elements_to_bytes 

Source
pub fn packed_u32_elements_to_bytes(elements: &[Goldilocks]) -> Vec<u8> 
Expand description

Converts u32-packed field elements back to bytes in little-endian format.

This is the inverse of bytes_to_packed_u32_elements. Each field element is expected to contain a u32 value, which is unpacked into 4 bytes.

§Arguments

  • elements: The field elements to convert

§Returns

A vector of bytes representing the unpacked data.

§Examples

let original = vec![0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08];
let elements = bytes_to_packed_u32_elements(&original);
let bytes = packed_u32_elements_to_bytes(&elements);
assert_eq!(bytes, original);