rscrypto 0.3.0

Pure Rust cryptography: RSA, Ed25519, X25519, SHA-2/3, BLAKE3, AES-GCM, ChaCha20-Poly1305, Argon2, HMAC/HKDF, CRC. no_std, WASM, hardware acceleration.
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);
  }
}