pub fn group_order() -> [u8; 32] {
    // Decimal representation
    let d = BigUint::parse_bytes(b"27742317777372353535851937790883648493", 10).unwrap();

    // Hexadecimal representation
    let str_d = d.to_str_radix(16);

    // Encode FieldElement
    let mut encoded = [0u8; 32];

    // Set bit 2^{252}
    encoded[0] = 0x10;

    // Fill bits [16, 32)
    for i in 0..16 {
        encoded[i + 16] = u8::from_str_radix(&str_d[i * 2..i * 2 + 2], 16).unwrap();
    }

    // Show content of encoded.
    println!("L: {:02x}", encoded.iter().format("|"));

    encoded
}
/// See RFC 7748: group order.
/// L = 2^{252} + 27742317777372353535851937790883648493.
See RFC 7748: group order.
See RFC 7748 : group order .
pub fn group_order() -> [u8; 32] {
    // Decimal representation
    let d = BigUint::parse_bytes(b"27742317777372353535851937790883648493", 10).unwrap();
    // Hexadecimal representation
    let str_d = d.to_str_radix(16);
    // Encode FieldElement
    let mut encoded = [0u8; 32];
    // Set bit 2^{252}
    encoded[0] = 0x10;
    // Fill bits [16, 32)
    for i in 0..16 {
        encoded[i + 16] = u8::from_str_radix(&str_d[i * 2..i * 2 + 2], 16).unwrap();
    }
    // Show content of encoded.
    println!("L: {:02x}", encoded.iter().format("|"));
    encoded
}
pub fn group_order ( ) -> [ u8 ; 32 ] { // Decimal representation let d = BigUint :: parse_bytes ( b" " , 10 ) . unwrap ( ) ; // Hexadecimal representation let str_d = d . to_str_radix ( 16 ) ; // Encode FieldElement let mut encoded = [ 0u8 ; 32 ] ; // Set bit 2^{252} encoded [ 0 ] = 0x10 ; // Fill bits [16, 32) for i in 0 .. 16 { encoded [ i + 16 ] = u8 :: from_str_radix ( & str_d [ i * 2 .. i * 2 + 2 ] , 16 ) . unwrap ( ) ; } // Show content of encoded. println ! ( " " encoded iter ( ) format ( " " ) ) ; encoded }
See RFC 7748: group order.
See RFC 7748 : group order .