INNER CODE UNIT · Rust

c

orion-rs/orion · src/hazardous/dsa/ml_dsa/internal/mod.rs:211

                let c = |k: usize| t1[idx].coefficients[4 * i + k].0;
                encpoly[5 * i] = c(0) as u8;
                encpoly[5 * i + 1] = ((c(0) >> 8) | (c(1) << 2)) as u8;
                encpoly[5 * i + 2] = ((c(1) >> 6) | (c(2) << 4)) as u8;
                encpoly[5 * i + 3] = ((c(2) >> 4) | (c(3) << 6)) as u8;
                encpoly[5 * i + 4] = (c(3) >> 2) as u8;
            }
        }

        pk
    }

    /// FIPS-204, Algorithm 23.
    fn pk_decode<const K: usize>(pk: &[u8]) -> Result<([u8; 32], Vector<K>), UnknownCryptoError> {
        if pk.len() != Self::PUBLIC_KEY_SIZE {
            return Err(UnknownCryptoError);
        }

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…