gost-crypto 0.2.0

Pure Rust: GOST 28147-89 block cipher and GOST R 34.11-94 hash (RustCrypto compatible)
Documentation
//! S-boxes for GOST 28147-89 and GOST R 34.11-94.

/// S-box type: 8 rows × 16 columns.
pub type Sbox = [[u8; 16]; 8];

/// S-box for id-GostR3411-94-CryptoProParamSet (RFC 4357 §11.2).
/// Used by КриптоПро CSP for GOST R 34.11-94 hashing.
pub const SBOX_CRYPTOPRO: Sbox = [
    [10, 4,  5,  6,  8,  1,  3,  7,  13, 12, 14, 0,  9,  2,  11, 15],
    [5,  15, 4,  0,  2,  13, 11, 9,  1,  7,  6,  3,  12, 14, 10, 8 ],
    [7,  15, 12, 14, 9,  4,  1,  0,  3,  11, 5,  2,  6,  10, 8,  13],
    [4,  10, 7,  12, 0,  15, 2,  8,  14, 1,  6,  5,  13, 11, 9,  3 ],
    [7,  6,  4,  11, 9,  12, 2,  10, 1,  8,  0,  14, 15, 13, 3,  5 ],
    [7,  6,  2,  4,  13, 9,  15, 0,  10, 1,  5,  11, 8,  14, 12, 3 ],
    [13, 14, 4,  1,  7,  0,  5,  10, 3,  12, 8,  15, 6,  2,  9,  11],
    [1,  3,  10, 9,  5,  11, 4,  15, 8,  6,  7,  14, 13, 0,  2,  12],
];

/// S-box for id-GostR3411-94-TestParamSet (RFC 5831 test vectors).
pub const SBOX_TEST: Sbox = [
    [4,  10, 9,  2,  13, 8,  0,  14, 6,  11, 1,  12, 7,  15, 5,  3 ],
    [14, 11, 4,  12, 6,  13, 15, 10, 2,  3,  8,  1,  0,  7,  5,  9 ],
    [5,  8,  1,  13, 10, 3,  4,  2,  14, 15, 12, 7,  6,  0,  9,  11],
    [7,  13, 10, 1,  0,  8,  9,  15, 14, 4,  6,  12, 11, 2,  5,  3 ],
    [6,  12, 7,  1,  5,  15, 13, 8,  4,  10, 9,  14, 0,  3,  11, 2 ],
    [4,  11, 10, 0,  7,  2,  1,  13, 3,  6,  8,  5,  9,  12, 15, 14],
    [13, 11, 4,  1,  3,  15, 5,  9,  0,  10, 14, 7,  6,  8,  2,  12],
    [1,  15, 13, 0,  5,  7,  10, 4,  9,  2,  3,  14, 6,  11, 8,  12],
];