Merge pull request #1222 from kubo39/EVP-APIs-encrypt-and-decrypt

Add EVP_EncryptInit_ex/EVP_EncryptFinish_ex, and the equivalently named
This commit is contained in:
Steven Fackler 2020-01-27 08:55:44 -05:00 committed by GitHub
commit bb1cf5ef19
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 24 additions and 0 deletions

View File

@ -122,6 +122,13 @@ extern "C" {
npubk: c_int,
) -> c_int;
pub fn EVP_SealFinal(ctx: *mut EVP_CIPHER_CTX, out: *mut c_uchar, outl: *mut c_int) -> c_int;
pub fn EVP_EncryptInit_ex(
ctx: *mut EVP_CIPHER_CTX,
cipher: *const EVP_CIPHER,
impl_: *mut ENGINE,
key: *const c_uchar,
iv: *const c_uchar,
) -> c_int;
pub fn EVP_EncryptUpdate(
ctx: *mut EVP_CIPHER_CTX,
out: *mut c_uchar,
@ -129,6 +136,11 @@ extern "C" {
in_: *const u8,
inl: c_int,
) -> c_int;
pub fn EVP_EncryptFinal_ex(
ctx: *mut EVP_CIPHER_CTX,
out: *mut c_uchar,
outl: *mut c_int,
) -> c_int;
pub fn EVP_OpenInit(
ctx: *mut EVP_CIPHER_CTX,
type_: *const EVP_CIPHER,
@ -138,6 +150,13 @@ extern "C" {
priv_: *mut EVP_PKEY,
) -> c_int;
pub fn EVP_OpenFinal(ctx: *mut EVP_CIPHER_CTX, out: *mut c_uchar, outl: *mut c_int) -> c_int;
pub fn EVP_DecryptInit_ex(
ctx: *mut EVP_CIPHER_CTX,
cipher: *const EVP_CIPHER,
impl_: *mut ENGINE,
key: *const c_uchar,
iv: *const c_uchar,
) -> c_int;
pub fn EVP_DecryptUpdate(
ctx: *mut EVP_CIPHER_CTX,
out: *mut c_uchar,
@ -145,6 +164,11 @@ extern "C" {
in_: *const u8,
inl: c_int,
) -> c_int;
pub fn EVP_DecryptFinal_ex(
ctx: *mut EVP_CIPHER_CTX,
outm: *mut c_uchar,
outl: *mut c_int
) -> c_int;
}
cfg_if! {
if #[cfg(any(ossl111b, libressl280))] {