use crate::*;
pub(crate) fn new() -> Item {
let docs = docs! {
};
let name = "hash".into();
let items = vec![
item! {
enum Algorithm {
Sha256 = 0,
Sha384 = 1,
}
},
#[cfg(feature = "api-crypto-hash")]
item! {
fn is_supported "chs" {
algorithm: usize,
} -> bool
},
#[cfg(feature = "api-crypto-hash")]
item! {
fn initialize "chi" {
algorithm: usize,
} -> usize
},
#[cfg(feature = "api-crypto-hash")]
item! {
fn update "chu" {
id: usize,
data: *const u8,
length: usize,
} -> ()
},
#[cfg(feature = "api-crypto-hash")]
item! {
fn finalize "chf" {
id: usize,
digest: *mut u8,
} -> ()
},
#[cfg(feature = "api-crypto-hmac")]
item! {
fn is_hmac_supported "cht" {
algorithm: usize,
} -> bool
},
#[cfg(feature = "api-crypto-hmac")]
item! {
fn hmac_initialize "chj" {
algorithm: usize,
key: *const u8,
key_len: usize,
} -> usize
},
#[cfg(feature = "api-crypto-hmac")]
item! {
fn hmac_update "chv" {
id: usize,
data: *const u8,
length: usize,
} -> ()
},
#[cfg(feature = "api-crypto-hmac")]
item! {
fn hmac_finalize "chg" {
id: usize,
hmac: *mut u8,
} -> ()
},
#[cfg(feature = "api-crypto-hkdf")]
item! {
fn is_hkdf_supported "chr" {
algorithm: usize,
} -> bool
},
#[cfg(feature = "api-crypto-hkdf")]
item! {
fn hkdf_expand "che" {
algorithm: usize,
prk: *const u8,
prk_len: usize,
info: *const u8,
info_len: usize,
okm: *mut u8,
okm_len: usize,
} -> ()
},
];
Item::Mod(Mod { docs, name, items })
}