MCPcopy Create free account
hub / github.com/RustCrypto/utils / Dbl

Interface Dbl

dbl/src/lib.rs:25–41  ·  view source on GitHub ↗

Double and inverse double over `GF(2^n)` with the lexicographically first polynomial among the irreducible degree `n` polynomials having a minimum number of coefficients. This trait is implemented using big-endian byte order for 64, 128 and 256 bit block sizes.

Source from the content-addressed store, hash-verified

23///
24/// This trait is implemented using big-endian byte order for 64, 128 and 256 bit block sizes.
25pub trait Dbl: sealed::Sealed {
26 /// Double block. (alternatively: multiply block by x)
27 ///
28 /// If most significant bit of the block equals to zero will return
29 /// `block<<1`, otherwise `(block<<1)^C`, where `C` is the non-leading
30 /// coefficients of the lexicographically first irreducible degree-b binary
31 /// polynomial with the minimal number of ones.
32 #[must_use]
33 fn dbl(self) -> Self;
34
35 /// Reverse double block. (alternatively: divide block by x)
36 ///
37 /// If least significant bit of the block equals to zero will return
38 /// `block>>1`, otherwise `(block>>1)^(1<<n)^(C>>1)`
39 #[must_use]
40 fn inv_dbl(self) -> Self;
41}
42
43impl Dbl for Array<u8, U8> {
44 #[inline]

Callers

nothing calls this directly

Implementers 1

lib.rsdbl/src/lib.rs

Calls

no outgoing calls

Tested by

no test coverage detected