libsodium_sys/src/
crypto_stream_salsa208.rs1pub const crypto_stream_salsa208_KEYBYTES: usize = 32;
4pub const crypto_stream_salsa208_NONCEBYTES: usize = 8;
5
6
7extern {
8 pub fn crypto_stream_salsa208(
9 c: *mut u8,
10 clen: c_ulonglong,
11 n: *const [u8; crypto_stream_salsa208_NONCEBYTES],
12 k: *const [u8; crypto_stream_salsa208_KEYBYTES]) -> c_int;
13 pub fn crypto_stream_salsa208_xor(
14 c: *mut u8,
15 m: *const u8,
16 mlen: c_ulonglong,
17 n: *const [u8; crypto_stream_salsa208_NONCEBYTES],
18 k: *const [u8; crypto_stream_salsa208_KEYBYTES]) -> c_int;
19 pub fn crypto_stream_salsa208_keybytes() -> size_t;
20 pub fn crypto_stream_salsa208_noncebytes() -> size_t;
21}
22
23
24#[test]
25fn test_crypto_stream_salsa208_keybytes() {
26 assert!(unsafe { crypto_stream_salsa208_keybytes() as usize } ==
27 crypto_stream_salsa208_KEYBYTES)
28}
29#[test]
30fn test_crypto_stream_salsa208_noncebytes() {
31 assert!(unsafe { crypto_stream_salsa208_noncebytes() as usize } ==
32 crypto_stream_salsa208_NONCEBYTES)
33}