hashes 0.1.9

Rust implementation of cryptographic hash function algorithms
Documentation
use super::{
    algorithm::define_hash_algorithm,
    sha256::{MessageLen, Word, K, N_CHUNK_BYTES, N_ROUNDS},
};

pub const N_DIGEST_WORDS: usize = 7; // 224 bits

pub const INITIAL_DIGEST: [Word; N_INNER_DIGEST_WORDS] = [
    0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939, 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4,
];

define_hash_algorithm!();

crate::test_macros::define_hash_tests!(
    [
        [
            0xd1, 0x4a, 0x02, 0x8c, 0x2a, 0x3a, 0x2b, 0xc9, 0x47, 0x61, 0x02, 0xbb, 0x28, 0x82,
            0x34, 0xc4, 0x15, 0xa2, 0xb0, 0x1f, 0x82, 0x8e, 0xa6, 0x2a, 0xc5, 0xb3, 0xe4, 0x2f
        ],
        [
            0x23, 0x09, 0x7d, 0x22, 0x34, 0x05, 0xd8, 0x22, 0x86, 0x42, 0xa4, 0x77, 0xbd, 0xa2,
            0x55, 0xb3, 0x2a, 0xad, 0xbc, 0xe4, 0xbd, 0xa0, 0xb3, 0xf7, 0xe3, 0x6c, 0x9d, 0xa7
        ],
        [
            0x75, 0x38, 0x8b, 0x16, 0x51, 0x27, 0x76, 0xcc, 0x5d, 0xba, 0x5d, 0xa1, 0xfd, 0x89,
            0x01, 0x50, 0xb0, 0xc6, 0x45, 0x5c, 0xb4, 0xf5, 0x8b, 0x19, 0x52, 0x52, 0x25, 0x25
        ],
        [
            0xc9, 0x7c, 0xa9, 0xa5, 0x59, 0x85, 0x0c, 0xe9, 0x7a, 0x04, 0xa9, 0x6d, 0xef, 0x6d,
            0x99, 0xa9, 0xe0, 0xe0, 0xe2, 0xab, 0x14, 0xe6, 0xb8, 0xdf, 0x26, 0x5f, 0xc0, 0xb3
        ],
        [
            0x20, 0x79, 0x46, 0x55, 0x98, 0x0c, 0x91, 0xd8, 0xbb, 0xb4, 0xc1, 0xea, 0x97, 0x61,
            0x8a, 0x4b, 0xf0, 0x3f, 0x42, 0x58, 0x19, 0x48, 0xb2, 0xee, 0x4e, 0xe7, 0xad, 0x67
        ]
    ],
    [
        0xb5, 0x98, 0x97, 0x13, 0xca, 0x4f, 0xe4, 0x7a, 0x00, 0x9f, 0x86, 0x21, 0x98, 0x0b, 0x34,
        0xe6, 0xd6, 0x3e, 0xd3, 0x06, 0x3b, 0x2a, 0x0a, 0x2c, 0x86, 0x7d, 0x8a, 0x85
    ]
);