Skip to main content

bytes

Standalone Functions

bytes_to_fields

bytes_to_fields(input);

For example, [1, 10, 3] is encoded as [1 * 256^2 + 10 * 256 + 3]

Parameters

NameType
input[u8; N]

fields_to_bytes

fields_to_bytes(input);

TODO(#8618): Optimize for public use.

Parameters

NameType
input[Field; M]

test_bytes_to_1_field

test_bytes_to_1_field();

Takes no parameters.

test_1_field_to_bytes

test_1_field_to_bytes();

Takes no parameters.

test_3_small_fields_to_bytes

test_3_small_fields_to_bytes();

Takes no parameters.

test_3_small_fields_to_less_bytes

test_3_small_fields_to_less_bytes();

Takes no parameters.

test_bytes_to_2_fields

test_bytes_to_2_fields();

Takes no parameters.

test_2_fields_to_bytes

test_2_fields_to_bytes();

Takes no parameters.

test_large_random_input_to_fields_and_back

test_large_random_input_to_fields_and_back(input);

Parameters

NameType
input[u8; 128]

test_large_random_input_to_bytes_and_back

test_large_random_input_to_bytes_and_back(input1, input2, input3, input4, input5, input6, );

Parameters

NameType
input1[u64; 5]
input2[u64; 5]
input3[u64; 5]
input4[u32; 5]
input5[u16; 5]
input6[u8; 5]

test_too_few_destination_bytes

test_too_few_destination_bytes();

Takes no parameters.

test_fields_to_bytes_value_too_large

test_fields_to_bytes_value_too_large();

Takes no parameters.

test_fields_to_bytes_max_value

test_fields_to_bytes_max_value();

Takes no parameters.