Skip to content

Commit 1ea720c

Browse files
authored
Merge pull request #2140 from alex/cipher-symmetry
Expose several additional ciphers for symmetry with symm
2 parents 93d172b + eec7eeb commit 1ea720c

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

openssl/src/cipher.rs

+44
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,11 @@ impl Cipher {
166166
unsafe { CipherRef::from_ptr(ffi::EVP_aes_128_xts() as *mut _) }
167167
}
168168

169+
#[cfg(not(boringssl))]
170+
pub fn aes_256_xts() -> &'static CipherRef {
171+
unsafe { CipherRef::from_ptr(ffi::EVP_aes_256_xts() as *mut _) }
172+
}
173+
169174
#[cfg(not(boringssl))]
170175
pub fn aes_128_ctr() -> &'static CipherRef {
171176
unsafe { CipherRef::from_ptr(ffi::EVP_aes_128_ctr() as *mut _) }
@@ -364,15 +369,29 @@ impl Cipher {
364369
unsafe { CipherRef::from_ptr(ffi::EVP_des_ede3() as *mut _) }
365370
}
366371

372+
pub fn des_ede3_ecb() -> &'static CipherRef {
373+
unsafe { CipherRef::from_ptr(ffi::EVP_des_ede3_ecb() as *mut _) }
374+
}
375+
367376
pub fn des_ede3_cbc() -> &'static CipherRef {
368377
unsafe { CipherRef::from_ptr(ffi::EVP_des_ede3_cbc() as *mut _) }
369378
}
370379

380+
#[cfg(not(boringssl))]
381+
pub fn des_ede3_cfb8() -> &'static CipherRef {
382+
unsafe { CipherRef::from_ptr(ffi::EVP_des_ede3_cfb8() as *mut _) }
383+
}
384+
371385
#[cfg(not(boringssl))]
372386
pub fn des_ede3_cfb64() -> &'static CipherRef {
373387
unsafe { CipherRef::from_ptr(ffi::EVP_des_ede3_cfb64() as *mut _) }
374388
}
375389

390+
#[cfg(not(boringssl))]
391+
pub fn des_ede3_ofb() -> &'static CipherRef {
392+
unsafe { CipherRef::from_ptr(ffi::EVP_des_ede3_ofb() as *mut _) }
393+
}
394+
376395
#[cfg(not(osslconf = "OPENSSL_NO_RC4"))]
377396
pub fn rc4() -> &'static CipherRef {
378397
unsafe { CipherRef::from_ptr(ffi::EVP_rc4() as *mut _) }
@@ -393,6 +412,11 @@ impl Cipher {
393412
unsafe { CipherRef::from_ptr(ffi::EVP_camellia_128_cbc() as *mut _) }
394413
}
395414

415+
#[cfg(not(osslconf = "OPENSSL_NO_CAMELLIA"))]
416+
pub fn camellia128_ofb() -> &'static CipherRef {
417+
unsafe { CipherRef::from_ptr(ffi::EVP_camellia_128_ofb() as *mut _) }
418+
}
419+
396420
#[cfg(not(osslconf = "OPENSSL_NO_CAMELLIA"))]
397421
pub fn camellia192_cfb128() -> &'static CipherRef {
398422
unsafe { CipherRef::from_ptr(ffi::EVP_camellia_192_cfb128() as *mut _) }
@@ -408,6 +432,11 @@ impl Cipher {
408432
unsafe { CipherRef::from_ptr(ffi::EVP_camellia_192_cbc() as *mut _) }
409433
}
410434

435+
#[cfg(not(osslconf = "OPENSSL_NO_CAMELLIA"))]
436+
pub fn camellia192_ofb() -> &'static CipherRef {
437+
unsafe { CipherRef::from_ptr(ffi::EVP_camellia_192_ofb() as *mut _) }
438+
}
439+
411440
#[cfg(not(osslconf = "OPENSSL_NO_CAMELLIA"))]
412441
pub fn camellia256_cfb128() -> &'static CipherRef {
413442
unsafe { CipherRef::from_ptr(ffi::EVP_camellia_256_cfb128() as *mut _) }
@@ -423,6 +452,11 @@ impl Cipher {
423452
unsafe { CipherRef::from_ptr(ffi::EVP_camellia_256_cbc() as *mut _) }
424453
}
425454

455+
#[cfg(not(osslconf = "OPENSSL_NO_CAMELLIA"))]
456+
pub fn camellia256_ofb() -> &'static CipherRef {
457+
unsafe { CipherRef::from_ptr(ffi::EVP_camellia_256_ofb() as *mut _) }
458+
}
459+
426460
#[cfg(not(osslconf = "OPENSSL_NO_CAST"))]
427461
pub fn cast5_cfb64() -> &'static CipherRef {
428462
unsafe { CipherRef::from_ptr(ffi::EVP_cast5_cfb64() as *mut _) }
@@ -438,6 +472,11 @@ impl Cipher {
438472
unsafe { CipherRef::from_ptr(ffi::EVP_cast5_cbc() as *mut _) }
439473
}
440474

475+
#[cfg(not(osslconf = "OPENSSL_NO_CAST"))]
476+
pub fn cast5_ofb() -> &'static CipherRef {
477+
unsafe { CipherRef::from_ptr(ffi::EVP_cast5_ofb() as *mut _) }
478+
}
479+
441480
#[cfg(not(osslconf = "OPENSSL_NO_IDEA"))]
442481
pub fn idea_cfb64() -> &'static CipherRef {
443482
unsafe { CipherRef::from_ptr(ffi::EVP_idea_cfb64() as *mut _) }
@@ -453,6 +492,11 @@ impl Cipher {
453492
unsafe { CipherRef::from_ptr(ffi::EVP_idea_cbc() as *mut _) }
454493
}
455494

495+
#[cfg(not(osslconf = "OPENSSL_NO_IDEA"))]
496+
pub fn idea_ofb() -> &'static CipherRef {
497+
unsafe { CipherRef::from_ptr(ffi::EVP_idea_ofb() as *mut _) }
498+
}
499+
456500
#[cfg(all(any(ossl110, libressl310), not(osslconf = "OPENSSL_NO_CHACHA")))]
457501
pub fn chacha20() -> &'static CipherRef {
458502
unsafe { CipherRef::from_ptr(ffi::EVP_chacha20() as *mut _) }

0 commit comments

Comments
 (0)