1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
/* automatically generated by rust-bindgen 0.69.0 */

pub const OQS_VERSION_TEXT: &[u8; 6] = b"0.9.0\0";
pub const OQS_COMPILE_BUILD_TARGET: &[u8; 30] = b"x86_64-Linux-6.2.0-1015-azure\0";
pub const OQS_BUILD_ONLY_LIB: u32 = 1;
pub const OQS_OPT_TARGET: &[u8; 5] = b"auto\0";
pub const OQS_USE_OPENSSL: u32 = 1;
pub const OQS_USE_SHA2_OPENSSL: u32 = 1;
pub const OQS_USE_ADX_INSTRUCTIONS: u32 = 1;
pub const OQS_USE_AES_INSTRUCTIONS: u32 = 1;
pub const OQS_USE_AVX_INSTRUCTIONS: u32 = 1;
pub const OQS_USE_AVX2_INSTRUCTIONS: u32 = 1;
pub const OQS_USE_AVX512_INSTRUCTIONS: u32 = 1;
pub const OQS_USE_BMI1_INSTRUCTIONS: u32 = 1;
pub const OQS_USE_BMI2_INSTRUCTIONS: u32 = 1;
pub const OQS_USE_PCLMULQDQ_INSTRUCTIONS: u32 = 1;
pub const OQS_USE_POPCNT_INSTRUCTIONS: u32 = 1;
pub const OQS_USE_SSE_INSTRUCTIONS: u32 = 1;
pub const OQS_USE_SSE2_INSTRUCTIONS: u32 = 1;
pub const OQS_USE_SSE3_INSTRUCTIONS: u32 = 1;
pub const OQS_ENABLE_SHA3_xkcp_low_avx2: u32 = 1;
pub const OQS_ENABLE_KEM_BIKE: u32 = 1;
pub const OQS_ENABLE_KEM_bike_l1: u32 = 1;
pub const OQS_ENABLE_KEM_bike_l3: u32 = 1;
pub const OQS_ENABLE_KEM_bike_l5: u32 = 1;
pub const OQS_ENABLE_KEM_FRODOKEM: u32 = 1;
pub const OQS_ENABLE_KEM_frodokem_640_aes: u32 = 1;
pub const OQS_ENABLE_KEM_frodokem_640_shake: u32 = 1;
pub const OQS_ENABLE_KEM_frodokem_976_aes: u32 = 1;
pub const OQS_ENABLE_KEM_frodokem_976_shake: u32 = 1;
pub const OQS_ENABLE_KEM_frodokem_1344_aes: u32 = 1;
pub const OQS_ENABLE_KEM_frodokem_1344_shake: u32 = 1;
pub const OQS_ENABLE_KEM_NTRUPRIME: u32 = 1;
pub const OQS_ENABLE_KEM_ntruprime_sntrup761: u32 = 1;
pub const OQS_ENABLE_KEM_ntruprime_sntrup761_avx2: u32 = 1;
pub const OQS_ENABLE_KEM_CLASSIC_MCELIECE: u32 = 1;
pub const OQS_ENABLE_KEM_classic_mceliece_348864: u32 = 1;
pub const OQS_ENABLE_KEM_classic_mceliece_348864_avx2: u32 = 1;
pub const OQS_ENABLE_KEM_classic_mceliece_348864f: u32 = 1;
pub const OQS_ENABLE_KEM_classic_mceliece_348864f_avx2: u32 = 1;
pub const OQS_ENABLE_KEM_classic_mceliece_460896: u32 = 1;
pub const OQS_ENABLE_KEM_classic_mceliece_460896_avx2: u32 = 1;
pub const OQS_ENABLE_KEM_classic_mceliece_460896f: u32 = 1;
pub const OQS_ENABLE_KEM_classic_mceliece_460896f_avx2: u32 = 1;
pub const OQS_ENABLE_KEM_classic_mceliece_6688128: u32 = 1;
pub const OQS_ENABLE_KEM_classic_mceliece_6688128_avx2: u32 = 1;
pub const OQS_ENABLE_KEM_classic_mceliece_6688128f: u32 = 1;
pub const OQS_ENABLE_KEM_classic_mceliece_6688128f_avx2: u32 = 1;
pub const OQS_ENABLE_KEM_classic_mceliece_6960119: u32 = 1;
pub const OQS_ENABLE_KEM_classic_mceliece_6960119_avx2: u32 = 1;
pub const OQS_ENABLE_KEM_classic_mceliece_6960119f: u32 = 1;
pub const OQS_ENABLE_KEM_classic_mceliece_6960119f_avx2: u32 = 1;
pub const OQS_ENABLE_KEM_classic_mceliece_8192128: u32 = 1;
pub const OQS_ENABLE_KEM_classic_mceliece_8192128_avx2: u32 = 1;
pub const OQS_ENABLE_KEM_classic_mceliece_8192128f: u32 = 1;
pub const OQS_ENABLE_KEM_classic_mceliece_8192128f_avx2: u32 = 1;
pub const OQS_ENABLE_KEM_HQC: u32 = 1;
pub const OQS_ENABLE_KEM_hqc_128: u32 = 1;
pub const OQS_ENABLE_KEM_hqc_128_avx2: u32 = 1;
pub const OQS_ENABLE_KEM_hqc_192: u32 = 1;
pub const OQS_ENABLE_KEM_hqc_192_avx2: u32 = 1;
pub const OQS_ENABLE_KEM_hqc_256: u32 = 1;
pub const OQS_ENABLE_KEM_hqc_256_avx2: u32 = 1;
pub const OQS_ENABLE_KEM_KYBER: u32 = 1;
pub const OQS_ENABLE_KEM_kyber_512: u32 = 1;
pub const OQS_ENABLE_KEM_kyber_512_avx2: u32 = 1;
pub const OQS_ENABLE_KEM_kyber_768: u32 = 1;
pub const OQS_ENABLE_KEM_kyber_768_avx2: u32 = 1;
pub const OQS_ENABLE_KEM_kyber_1024: u32 = 1;
pub const OQS_ENABLE_KEM_kyber_1024_avx2: u32 = 1;
pub const OQS_ENABLE_SIG_DILITHIUM: u32 = 1;
pub const OQS_ENABLE_SIG_dilithium_2: u32 = 1;
pub const OQS_ENABLE_SIG_dilithium_2_avx2: u32 = 1;
pub const OQS_ENABLE_SIG_dilithium_3: u32 = 1;
pub const OQS_ENABLE_SIG_dilithium_3_avx2: u32 = 1;
pub const OQS_ENABLE_SIG_dilithium_5: u32 = 1;
pub const OQS_ENABLE_SIG_dilithium_5_avx2: u32 = 1;
pub const OQS_ENABLE_SIG_FALCON: u32 = 1;
pub const OQS_ENABLE_SIG_falcon_512: u32 = 1;
pub const OQS_ENABLE_SIG_falcon_512_avx2: u32 = 1;
pub const OQS_ENABLE_SIG_falcon_1024: u32 = 1;
pub const OQS_ENABLE_SIG_falcon_1024_avx2: u32 = 1;
pub const OQS_ENABLE_SIG_SPHINCS: u32 = 1;
pub const OQS_ENABLE_SIG_sphincs_sha2_128f_simple: u32 = 1;
pub const OQS_ENABLE_SIG_sphincs_sha2_128f_simple_avx2: u32 = 1;
pub const OQS_ENABLE_SIG_sphincs_sha2_128s_simple: u32 = 1;
pub const OQS_ENABLE_SIG_sphincs_sha2_128s_simple_avx2: u32 = 1;
pub const OQS_ENABLE_SIG_sphincs_sha2_192f_simple: u32 = 1;
pub const OQS_ENABLE_SIG_sphincs_sha2_192f_simple_avx2: u32 = 1;
pub const OQS_ENABLE_SIG_sphincs_sha2_192s_simple: u32 = 1;
pub const OQS_ENABLE_SIG_sphincs_sha2_192s_simple_avx2: u32 = 1;
pub const OQS_ENABLE_SIG_sphincs_sha2_256f_simple: u32 = 1;
pub const OQS_ENABLE_SIG_sphincs_sha2_256f_simple_avx2: u32 = 1;
pub const OQS_ENABLE_SIG_sphincs_sha2_256s_simple: u32 = 1;
pub const OQS_ENABLE_SIG_sphincs_sha2_256s_simple_avx2: u32 = 1;
pub const OQS_ENABLE_SIG_sphincs_shake_128f_simple: u32 = 1;
pub const OQS_ENABLE_SIG_sphincs_shake_128f_simple_avx2: u32 = 1;
pub const OQS_ENABLE_SIG_sphincs_shake_128s_simple: u32 = 1;
pub const OQS_ENABLE_SIG_sphincs_shake_128s_simple_avx2: u32 = 1;
pub const OQS_ENABLE_SIG_sphincs_shake_192f_simple: u32 = 1;
pub const OQS_ENABLE_SIG_sphincs_shake_192f_simple_avx2: u32 = 1;
pub const OQS_ENABLE_SIG_sphincs_shake_192s_simple: u32 = 1;
pub const OQS_ENABLE_SIG_sphincs_shake_192s_simple_avx2: u32 = 1;
pub const OQS_ENABLE_SIG_sphincs_shake_256f_simple: u32 = 1;
pub const OQS_ENABLE_SIG_sphincs_shake_256f_simple_avx2: u32 = 1;
pub const OQS_ENABLE_SIG_sphincs_shake_256s_simple: u32 = 1;
pub const OQS_ENABLE_SIG_sphincs_shake_256s_simple_avx2: u32 = 1;
#[repr(i32)]
#[doc = " Represents return values from functions.\n\n Callers should compare with the symbol rather than the individual value.\n For example,\n\n     ret = OQS_KEM_encaps(...);\n     if (ret == OQS_SUCCESS) { ... }\n\n rather than\n\n     if (!OQS_KEM_encaps(...) { ... }\n"]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum OQS_STATUS {
    #[doc = " Used to indicate that some undefined error occurred."]
    OQS_ERROR = -1,
    #[doc = " Used to indicate successful return from function."]
    OQS_SUCCESS = 0,
    #[doc = " Used to indicate failures in external libraries (e.g., OpenSSL)."]
    OQS_EXTERNAL_LIB_ERROR_OPENSSL = 50,
}
#[repr(u32)]
#[doc = " CPU runtime detection flags"]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum OQS_CPU_EXT {
    OQS_CPU_EXT_INIT = 0,
    OQS_CPU_EXT_ADX = 1,
    OQS_CPU_EXT_AES = 2,
    OQS_CPU_EXT_AVX = 3,
    OQS_CPU_EXT_AVX2 = 4,
    OQS_CPU_EXT_AVX512 = 5,
    OQS_CPU_EXT_BMI1 = 6,
    OQS_CPU_EXT_BMI2 = 7,
    OQS_CPU_EXT_PCLMULQDQ = 8,
    OQS_CPU_EXT_VPCLMULQDQ = 9,
    OQS_CPU_EXT_POPCNT = 10,
    OQS_CPU_EXT_SSE = 11,
    OQS_CPU_EXT_SSE2 = 12,
    OQS_CPU_EXT_SSE3 = 13,
    OQS_CPU_EXT_ARM_AES = 14,
    OQS_CPU_EXT_ARM_SHA2 = 15,
    OQS_CPU_EXT_ARM_SHA3 = 16,
    OQS_CPU_EXT_ARM_NEON = 17,
    OQS_CPU_EXT_COUNT = 18,
}
extern "C" {
    #[doc = " Checks if the CPU supports a given extension\n\n \\return 1 if the given CPU extension is available, 0 otherwise."]
    pub fn OQS_CPU_has_extension(ext: OQS_CPU_EXT) -> ::libc::c_int;
}
extern "C" {
    #[doc = " This currently sets the values in the OQS_CPU_EXTENSIONS\n and prefetches the OpenSSL objects if necessary."]
    pub fn OQS_init();
}
extern "C" {
    #[doc = " This function frees prefetched OpenSSL objects"]
    pub fn OQS_destroy();
}
extern "C" {
    #[doc = " Return library version string."]
    pub fn OQS_version() -> *const ::libc::c_char;
}
extern "C" {
    #[doc = " Constant time comparison of byte sequences `a` and `b` of length `len`.\n Returns 0 if the byte sequences are equal or if `len`=0.\n Returns 1 otherwise.\n\n @param[in] a A byte sequence of length at least `len`.\n @param[in] b A byte sequence of length at least `len`.\n @param[in] len The number of bytes to compare."]
    pub fn OQS_MEM_secure_bcmp(
        a: *const ::libc::c_void,
        b: *const ::libc::c_void,
        len: usize,
    ) -> ::libc::c_int;
}
extern "C" {
    #[doc = " Zeros out `len` bytes of memory starting at `ptr`.\n\n Designed to be protected against optimizing compilers which try to remove\n \"unnecessary\" operations.  Should be used for all buffers containing secret\n data.\n\n @param[in] ptr The start of the memory to zero out.\n @param[in] len The number of bytes to zero out."]
    pub fn OQS_MEM_cleanse(ptr: *mut ::libc::c_void, len: usize);
}
extern "C" {
    #[doc = " Zeros out `len` bytes of memory starting at `ptr`, then frees `ptr`.\n\n Can be called with `ptr = NULL`, in which case no operation is performed.\n\n Designed to be protected against optimizing compilers which try to remove\n \"unnecessary\" operations.  Should be used for all buffers containing secret\n data.\n\n @param[in] ptr The start of the memory to zero out and free.\n @param[in] len The number of bytes to zero out."]
    pub fn OQS_MEM_secure_free(ptr: *mut ::libc::c_void, len: usize);
}
extern "C" {
    #[doc = " Frees `ptr`.\n\n Can be called with `ptr = NULL`, in which case no operation is performed.\n\n Should only be used on non-secret data.\n\n @param[in] ptr The start of the memory to free."]
    pub fn OQS_MEM_insecure_free(ptr: *mut ::libc::c_void);
}
extern "C" {
    #[doc = " Internal implementation of C11 aligned_alloc to work around compiler quirks.\n\n Allocates size bytes of uninitialized memory with a base pointer that is\n a multiple of alignment. Alignment must be a power of two and a multiple\n of sizeof(void *). Size must be a multiple of alignment."]
    pub fn OQS_MEM_aligned_alloc(alignment: usize, size: usize) -> *mut ::libc::c_void;
}
extern "C" {
    #[doc = " Free memory allocated with OQS_MEM_aligned_alloc."]
    pub fn OQS_MEM_aligned_free(ptr: *mut ::libc::c_void);
}