/// Verifies that conversions between a value and a test vector work as
/// expected.
///
/// Note that when serialising and parsing, the result should be the same as the
/// original reduced mod the size of the field.
Verifies that conversions between a value and a test vector work as
expected.

Note that when serialising and parsing, the result should be the same as the
original reduced mod the size of the field.
Verifies that conversions between a value and a test vector work as expected . Note that when serialising and parsing the result should be the same as the original reduced mod the size of the field .
fn fr_serde_should_be_correct(hex_test_vector: &str, value: &BIG, test_name: &str) {
    let serialised = miracl_fr_to_bytes(value).0;
    assert_eq!(
        hex_test_vector,
        hex::encode(&serialised[..]),
        "Serialisation does not match for {}",
        test_name
    );
    let bytes = hex::decode(hex_test_vector).expect("Invalid test vector hex encoding");
    let bytes = fr_bytes_from_vec(&bytes);
    let parsed = miracl_fr_from_bytes(bytes).expect("Failed to parse test vector");
    let value_reduced = reduced_mod(value);
    assert!(
        is_equal(&value_reduced, &parsed),
        "Parsed value does not match for {}",
        test_name,
    );
}
fn fr_serde_should_be_correct ( hex_test_vector : & str , value : & BIG , test_name : & str ) { let serialised = miracl_fr_to_bytes ( value ) . 0 ; assert_eq ! ( hex_test_vector hex encode ( serialised [ ] ) " " test_name ) ; let bytes = hex :: decode ( hex_test_vector ) . expect ( " " ) ; let bytes = fr_bytes_from_vec ( & bytes ) ; let parsed = miracl_fr_from_bytes ( bytes ) . expect ( " " ) ; let value_reduced = reduced_mod ( value ) ; assert ! ( is_equal ( value_reduced parsed ) " " test_name ) ; }
Verifies that conversions between a value and a test vector work as
expected.
Verifies that conversions between a value and a test vector work as expected .
hex_test_vector
&str
value
&BIG
test_name
&str