Skip to content

Commit

Permalink
Expose chacha20_poly1305 on LibreSSL
Browse files Browse the repository at this point in the history
  • Loading branch information
alex committed Aug 10, 2023
1 parent 7daab5b commit 028937f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion openssl-sys/src/handwritten/evp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ extern "C" {
pub fn EVP_aes_256_wrap_pad() -> *const EVP_CIPHER;
#[cfg(all(ossl110, not(osslconf = "OPENSSL_NO_CHACHA")))]
pub fn EVP_chacha20() -> *const EVP_CIPHER;
#[cfg(all(ossl110, not(osslconf = "OPENSSL_NO_CHACHA")))]
#[cfg(all(any(ossl110, libressl360), not(osslconf = "OPENSSL_NO_CHACHA")))]
pub fn EVP_chacha20_poly1305() -> *const EVP_CIPHER;
#[cfg(not(osslconf = "OPENSSL_NO_SEED"))]
pub fn EVP_seed_cbc() -> *const EVP_CIPHER;
Expand Down
2 changes: 1 addition & 1 deletion openssl/src/cipher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ impl Cipher {
unsafe { CipherRef::from_ptr(ffi::EVP_chacha20() as *mut _) }
}

#[cfg(all(ossl110, not(osslconf = "OPENSSL_NO_CHACHA")))]
#[cfg(all(any(ossl110, libressl360), not(osslconf = "OPENSSL_NO_CHACHA")))]
pub fn chacha20_poly1305() -> &'static CipherRef {
unsafe { CipherRef::from_ptr(ffi::EVP_chacha20_poly1305() as *mut _) }
}
Expand Down
2 changes: 1 addition & 1 deletion openssl/src/symm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ impl Cipher {
}

/// Requires OpenSSL 1.1.0 or newer.
#[cfg(all(ossl110, not(osslconf = "OPENSSL_NO_CHACHA")))]
#[cfg(all(any(ossl110, libressl360), not(osslconf = "OPENSSL_NO_CHACHA")))]
pub fn chacha20_poly1305() -> Cipher {
unsafe { Cipher(ffi::EVP_chacha20_poly1305()) }
}
Expand Down

0 comments on commit 028937f

Please sign in to comment.