INNER CODE UNIT · Rust

clmul_test_vectors

ethereum/mpz · crates/clmul/src/lib.rs:200

    fn clmul_test_vectors() {
        use super::backend::Clmul;

        let xmm1_high: [u8; 16] = 0x7b5b546573745665_u128.to_le_bytes();
        let xmm1_low: [u8; 16] = 0x63746f725d53475d_u128.to_le_bytes();
        let xmm2_high: [u8; 16] = 0x4869285368617929_u128.to_le_bytes();
        let xmm2_low: [u8; 16] = 0x5b477565726f6e5d_u128.to_le_bytes();

        assert_eq!(
            Clmul::new(&xmm2_low).clmul(Clmul::new(&xmm1_low)),
            (
                Clmul::new(&0x1d4d84c85c3440c0929633d5d36f0451_u128.to_le_bytes()),
                Clmul::new(&[0u8; 16]),
            ),
        );

        assert_eq!(
            Clmul::new(&xmm2_high).clmul(Clmul::new(&xmm1_low)),

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…