tweetnacl_sys/
lib.rs

1#![no_std]
2
3pub use cty::{c_int, c_longlong, c_ulonglong};
4
5extern "C" {
6    pub fn crypto_auth_hmacsha512256_tweet(
7        out: *mut u8,
8        x: *const u8,
9        n: c_ulonglong,
10        x: *const u8,
11    ) -> c_int;
12    pub fn crypto_auth_hmacsha512256_tweet_verify(
13        x: *const u8,
14        x: *const u8,
15        n: c_ulonglong,
16        x: *const u8,
17    ) -> c_int;
18    pub fn crypto_box_curve25519xsalsa20poly1305_tweet(
19        out: *mut u8,
20        x: *const u8,
21        n: c_ulonglong,
22        x: *const u8,
23        x: *const u8,
24        x: *const u8,
25    ) -> c_int;
26    pub fn crypto_box_curve25519xsalsa20poly1305_tweet_open(
27        out: *mut u8,
28        x: *const u8,
29        n: c_ulonglong,
30        x: *const u8,
31        x: *const u8,
32        x: *const u8,
33    ) -> c_int;
34    pub fn crypto_box_curve25519xsalsa20poly1305_tweet_keypair(out: *mut u8, out: *mut u8)
35        -> c_int;
36    pub fn crypto_box_curve25519xsalsa20poly1305_tweet_beforenm(
37        out: *mut u8,
38        x: *const u8,
39        x: *const u8,
40    ) -> c_int;
41    pub fn crypto_box_curve25519xsalsa20poly1305_tweet_afternm(
42        out: *mut u8,
43        x: *const u8,
44        n: c_ulonglong,
45        x: *const u8,
46        x: *const u8,
47    ) -> c_int;
48    pub fn crypto_box_curve25519xsalsa20poly1305_tweet_open_afternm(
49        out: *mut u8,
50        x: *const u8,
51        n: c_ulonglong,
52        x: *const u8,
53        x: *const u8,
54    ) -> c_int;
55    pub fn crypto_core_salsa20_tweet(
56        out: *mut u8,
57        x: *const u8,
58        x: *const u8,
59        x: *const u8,
60    ) -> c_int;
61    pub fn crypto_core_hsalsa20_tweet(
62        out: *mut u8,
63        x: *const u8,
64        x: *const u8,
65        x: *const u8,
66    ) -> c_int;
67    pub fn crypto_hashblocks_sha512_tweet(out: *mut u8, x: *const u8, n: c_ulonglong) -> c_int;
68    pub fn crypto_hashblocks_sha256_tweet(out: *mut u8, x: *const u8, n: c_ulonglong) -> c_int;
69    pub fn crypto_hash_sha512_tweet(out: *mut u8, x: *const u8, n: c_ulonglong) -> c_int;
70    pub fn crypto_hash_sha256_tweet(out: *mut u8, x: *const u8, n: c_ulonglong) -> c_int;
71    pub fn crypto_onetimeauth_poly1305_tweet(
72        out: *mut u8,
73        x: *const u8,
74        n: c_ulonglong,
75        x: *const u8,
76    ) -> c_int;
77    pub fn crypto_onetimeauth_poly1305_tweet_verify(
78        x: *const u8,
79        x: *const u8,
80        n: c_ulonglong,
81        x: *const u8,
82    ) -> c_int;
83    pub fn crypto_scalarmult_curve25519_tweet(out: *mut u8, x: *const u8, x: *const u8) -> c_int;
84    pub fn crypto_scalarmult_curve25519_tweet_base(out: *mut u8, x: *const u8) -> c_int;
85    pub fn crypto_secretbox_xsalsa20poly1305_tweet(
86        out: *mut u8,
87        x: *const u8,
88        n: c_ulonglong,
89        x: *const u8,
90        x: *const u8,
91    ) -> c_int;
92    pub fn crypto_secretbox_xsalsa20poly1305_tweet_open(
93        out: *mut u8,
94        x: *const u8,
95        n: c_ulonglong,
96        x: *const u8,
97        x: *const u8,
98    ) -> c_int;
99    pub fn crypto_sign_ed25519_tweet(
100        out: *mut u8,
101        n: *mut c_ulonglong,
102        x: *const u8,
103        n: c_ulonglong,
104        x: *const u8,
105    ) -> c_int;
106    pub fn crypto_sign_ed25519_tweet_open(
107        out: *mut u8,
108        n: *mut c_ulonglong,
109        x: *const u8,
110        n: c_ulonglong,
111        x: *const u8,
112    ) -> c_int;
113    pub fn crypto_sign_ed25519_tweet_keypair(out: *mut u8, out: *mut u8) -> c_int;
114    pub fn crypto_stream_xsalsa20_tweet(
115        out: *mut u8,
116        n: c_ulonglong,
117        x: *const u8,
118        x: *const u8,
119    ) -> c_int;
120    pub fn crypto_stream_xsalsa20_tweet_xor(
121        out: *mut u8,
122        x: *const u8,
123        n: c_ulonglong,
124        x: *const u8,
125        x: *const u8,
126    ) -> c_int;
127    pub fn crypto_stream_salsa20_tweet(
128        out: *mut u8,
129        n: c_ulonglong,
130        x: *const u8,
131        x: *const u8,
132    ) -> c_int;
133    pub fn crypto_stream_salsa20_tweet_xor(
134        out: *mut u8,
135        x: *const u8,
136        n: c_ulonglong,
137        x: *const u8,
138        x: *const u8,
139    ) -> c_int;
140    pub fn crypto_verify_16_tweet(x: *const u8, x: *const u8) -> c_int;
141    pub fn crypto_verify_32_tweet(x: *const u8, x: *const u8) -> c_int;
142
143    pub fn crypto_sign_ed25519_tweet_keypair_seed(x: *mut u8, x: *mut u8, x: *const u8) -> c_int;
144    pub fn crypto_modL_tweet(r: *mut u8, x: *mut c_longlong);
145}