1use libc::*;
2
3use super::super::*;
4
5cfg_if! {
6 if #[cfg(any(ossl110, libressl280))] {
7 pub enum DSA_SIG {}
8 } else {
9 #[repr(C)]
10 pub struct DSA_SIG {
11 pub r: *mut BIGNUM,
12 pub s: *mut BIGNUM,
13 }
14 }
15}
16
17extern "C" {
18 pub fn DSA_new() -> *mut DSA;
19 pub fn DSA_free(dsa: *mut DSA);
20 pub fn DSA_up_ref(dsa: *mut DSA) -> c_int;
21 pub fn DSA_size(dsa: *const DSA) -> c_int;
22 pub fn DSA_sign(
23 dummy: c_int,
24 dgst: *const c_uchar,
25 len: c_int,
26 sigret: *mut c_uchar,
27 siglen: *mut c_uint,
28 dsa: *mut DSA,
29 ) -> c_int;
30 pub fn DSA_verify(
31 dummy: c_int,
32 dgst: *const c_uchar,
33 len: c_int,
34 sigbuf: *const c_uchar,
35 siglen: c_int,
36 dsa: *mut DSA,
37 ) -> c_int;
38
39 pub fn d2i_DSAPublicKey(a: *mut *mut DSA, pp: *mut *const c_uchar, length: c_long) -> *mut DSA;
40 pub fn d2i_DSAPrivateKey(a: *mut *mut DSA, pp: *mut *const c_uchar, length: c_long)
41 -> *mut DSA;
42
43 pub fn DSA_generate_parameters_ex(
44 dsa: *mut DSA,
45 bits: c_int,
46 seed: *const c_uchar,
47 seed_len: c_int,
48 counter_ref: *mut c_int,
49 h_ret: *mut c_ulong,
50 cb: *mut BN_GENCB,
51 ) -> c_int;
52
53 pub fn DSA_generate_key(dsa: *mut DSA) -> c_int;
54 pub fn i2d_DSAPublicKey(a: *const DSA, pp: *mut *mut c_uchar) -> c_int;
55 pub fn i2d_DSAPrivateKey(a: *const DSA, pp: *mut *mut c_uchar) -> c_int;
56
57 #[cfg(any(ossl110, libressl273))]
58 pub fn DSA_get0_pqg(
59 d: *const DSA,
60 p: *mut *const BIGNUM,
61 q: *mut *const BIGNUM,
62 q: *mut *const BIGNUM,
63 );
64 #[cfg(any(ossl110, libressl273))]
65 pub fn DSA_set0_pqg(d: *mut DSA, p: *mut BIGNUM, q: *mut BIGNUM, q: *mut BIGNUM) -> c_int;
66 #[cfg(any(ossl110, libressl273))]
67 pub fn DSA_get0_key(d: *const DSA, pub_key: *mut *const BIGNUM, priv_key: *mut *const BIGNUM);
68 #[cfg(any(ossl110, libressl273))]
69 pub fn DSA_set0_key(d: *mut DSA, pub_key: *mut BIGNUM, priv_key: *mut BIGNUM) -> c_int;
70 pub fn d2i_DSA_SIG(
71 sig: *mut *mut DSA_SIG,
72 pp: *mut *const c_uchar,
73 length: c_long,
74 ) -> *mut DSA_SIG;
75 pub fn i2d_DSA_SIG(a: *const DSA_SIG, pp: *mut *mut c_uchar) -> c_int;
76
77 pub fn DSA_SIG_new() -> *mut DSA_SIG;
78 pub fn DSA_SIG_free(sig: *mut DSA_SIG);
79
80 #[cfg(any(ossl110, libressl273))]
81 pub fn DSA_SIG_get0(sig: *const DSA_SIG, pr: *mut *const BIGNUM, ps: *mut *const BIGNUM);
82
83 #[cfg(any(ossl110, libressl273))]
84 pub fn DSA_SIG_set0(sig: *mut DSA_SIG, pr: *mut BIGNUM, ps: *mut BIGNUM) -> c_int;
85}
86