rscrypto 0.1.1

Pure Rust cryptography, hardware-accelerated: BLAKE3, SHA-2/3, AES-GCM, ChaCha20-Poly1305, Ed25519, X25519, HMAC, HKDF, Argon2, CRC. no_std, WASM, ten CPU architectures.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use super::{KEY_SIZE, NONCE_SIZE, xor_keystream_u32x4_impl};

define_target_feature_forwarder! {
  pub(super) fn xor_keystream(
    key: &[u8; KEY_SIZE],
    initial_counter: u32,
    nonce: &[u8; NONCE_SIZE],
    buffer: &mut [u8]
  ) {
    feature = "v";
    outer_safety = "backend selection guarantees the vector extension before this wrapper is chosen.";
    inner_safety = "the wrapper only reaches this function when the RISC-V vector extension is available.";
    call = xor_keystream_u32x4_impl(key, initial_counter, nonce, buffer);
  }
}