File: crypto_auth.rs

package info (click to toggle)
rust-libsodium-sys 0.2.7-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid, trixie
  • size: 420 kB
  • sloc: makefile: 10; ansic: 1
file content (24 lines) | stat: -rw-r--r-- 540 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// crypto_auth.h

use libsodium_sys::*;
use std::ffi::CStr;

#[test]
fn test_crypto_auth_bytes() {
    assert!(unsafe { crypto_auth_bytes() } == crypto_auth_BYTES as usize)
}

#[test]
fn test_crypto_auth_keybytes() {
    assert!(unsafe { crypto_auth_keybytes() } == crypto_auth_KEYBYTES as usize)
}

#[test]
fn test_crypto_auth_primitive() {
    unsafe {
        let s = crypto_auth_primitive();
        let s = CStr::from_ptr(s);
        let p = CStr::from_bytes_with_nul(crypto_auth_PRIMITIVE).unwrap();
        assert_eq!(s, p);
    }
}