pub fn bytes_to_elements_exact(bytes: &[u8]) -> Option<Vec<Felt>>Expand description
Converts bytes to field elements with validation.
This function validates that:
- The input bytes length is divisible by
Felt::NUM_BYTES - All
Felt::NUM_BYTES-byte sequences represent valid field elements
§Arguments
bytes- Byte slice that must be a multiple ofFelt::NUM_BYTESin length
§Returns
Option<Vec<Felt>> - Vector of Felt elements if all validations pass, or None otherwise