#![allow(non_upper_case_globals)]
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
use crate::common::{CryptoResult, Crypto_CipherMode, Crypto_DataBlob};
use crate::sym_key::OH_CryptoSymKey;
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
impl CryptoSymCipher_ParamsType {
pub const CRYPTO_IV_DATABLOB: CryptoSymCipher_ParamsType = CryptoSymCipher_ParamsType(100);
pub const CRYPTO_AAD_DATABLOB: CryptoSymCipher_ParamsType = CryptoSymCipher_ParamsType(101);
pub const CRYPTO_TAG_DATABLOB: CryptoSymCipher_ParamsType = CryptoSymCipher_ParamsType(102);
}
#[repr(transparent)]
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct CryptoSymCipher_ParamsType(pub ::core::ffi::c_uint);
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
#[repr(C)]
pub struct OH_CryptoSymCipher {
_unused: [u8; 0],
}
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
#[repr(C)]
pub struct OH_CryptoSymCipherParams {
_unused: [u8; 0],
}
extern "C" {
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub fn OH_CryptoSymCipherParams_Create(
params: *mut *mut OH_CryptoSymCipherParams,
) -> CryptoResult;
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub fn OH_CryptoSymCipherParams_SetParam(
params: *mut OH_CryptoSymCipherParams,
paramsType: CryptoSymCipher_ParamsType,
value: *mut Crypto_DataBlob,
) -> CryptoResult;
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub fn OH_CryptoSymCipherParams_Destroy(params: *mut OH_CryptoSymCipherParams);
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub fn OH_CryptoSymCipher_Create(
algoName: *const ::core::ffi::c_char,
ctx: *mut *mut OH_CryptoSymCipher,
) -> CryptoResult;
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub fn OH_CryptoSymCipher_Init(
ctx: *mut OH_CryptoSymCipher,
mod_: Crypto_CipherMode,
key: *mut OH_CryptoSymKey,
params: *mut OH_CryptoSymCipherParams,
) -> CryptoResult;
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub fn OH_CryptoSymCipher_Update(
ctx: *mut OH_CryptoSymCipher,
in_: *mut Crypto_DataBlob,
out: *mut Crypto_DataBlob,
) -> CryptoResult;
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub fn OH_CryptoSymCipher_Final(
ctx: *mut OH_CryptoSymCipher,
in_: *mut Crypto_DataBlob,
out: *mut Crypto_DataBlob,
) -> CryptoResult;
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub fn OH_CryptoSymCipher_GetAlgoName(
ctx: *mut OH_CryptoSymCipher,
) -> *const ::core::ffi::c_char;
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub fn OH_CryptoSymCipher_Destroy(ctx: *mut OH_CryptoSymCipher);
}