graviola 0.3.4

graviola is a modern, fast cryptography library
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// Written for Graviola by Joe Birr-Pixton, 2024.
// SPDX-License-Identifier: Apache-2.0 OR ISC OR MIT-0

use crate::low::generic;
use crate::low::x86_64;

pub(crate) fn sha512_compress_blocks(state: &mut [u64; 8], blocks: &[u8]) {
    // nb. avx2 is in our required set.
    if let Some(token) = x86_64::cpu::HaveBmi2::check() {
        x86_64::sha512::sha512_compress_blocks(state, blocks, token)
    } else {
        generic::sha512::sha512_compress_blocks(state, blocks)
    }
}