mirror of
https://boringssl.googlesource.com/boringssl
synced 2026-07-21 14:43:51 +00:00
bssl-crypto: Stop gating ML-DSA on a Rust feature flag
This was done because some Rust consumer had too old of a Rust compiler, but it's been a year now. Retire this. Update-Note: bssl-crypto now depends on at least Rust 1.82, if it hadn't already taken on a newer dependency by now. Change-Id: I25bab38508ed712c5cdd6c3ffc708188ce769da9 Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/94687 Commit-Queue: Xiangfei Ding <xfding@google.com> Auto-Submit: David Benjamin <davidben@google.com> Presubmit-BoringSSL-Verified: boringssl-scoped@luci-project-accounts.iam.gserviceaccount.com <boringssl-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Xiangfei Ding <xfding@google.com>
This commit is contained in:
committed by
boringssl-scoped@luci-project-accounts.iam.gserviceaccount.com
parent
4868e33ed7
commit
2a8e861745
@@ -13,5 +13,3 @@ default = []
|
||||
# `std` depends on the Rust `std` crate, but adds some useful trait impls if
|
||||
# available.
|
||||
std = []
|
||||
# `mlalgs` enables ML-KEM and ML-DSA support. This requires Rust 1.82.
|
||||
mlalgs = []
|
||||
|
||||
@@ -27,9 +27,7 @@
|
||||
extern crate alloc;
|
||||
extern crate core;
|
||||
|
||||
#[cfg(feature = "mlalgs")]
|
||||
use alloc::boxed::Box;
|
||||
|
||||
use alloc::vec::Vec;
|
||||
use core::ffi::c_void;
|
||||
|
||||
@@ -50,9 +48,7 @@ pub mod ed25519;
|
||||
pub mod hkdf;
|
||||
pub mod hmac;
|
||||
pub mod hpke;
|
||||
#[cfg(feature = "mlalgs")]
|
||||
pub mod mldsa;
|
||||
#[cfg(feature = "mlalgs")]
|
||||
pub mod mlkem;
|
||||
pub mod pkcs8;
|
||||
pub mod rsa;
|
||||
@@ -256,7 +252,6 @@ where
|
||||
/// Requires that the given function completely initializes the value.
|
||||
///
|
||||
/// Safety: the argument must fully initialize the pointed-to `T`.
|
||||
#[cfg(feature = "mlalgs")]
|
||||
unsafe fn initialized_boxed_struct<T, F>(init: F) -> Box<T>
|
||||
where
|
||||
F: FnOnce(*mut T),
|
||||
@@ -272,7 +267,6 @@ where
|
||||
///
|
||||
/// Safety: the argument must fully initialize the pointed-to `T` if it returns
|
||||
/// true. If it returns false then there are no safety requirements.
|
||||
#[cfg(feature = "mlalgs")]
|
||||
unsafe fn initialized_boxed_struct_fallible<T, F>(init: F) -> Option<Box<T>>
|
||||
where
|
||||
F: FnOnce(*mut T) -> bool,
|
||||
@@ -409,7 +403,6 @@ impl Drop for Buffer {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "mlalgs")]
|
||||
fn as_cbs(buf: &[u8]) -> bssl_sys::CBS {
|
||||
bssl_sys::CBS {
|
||||
data: buf.as_ffi_ptr(),
|
||||
@@ -467,7 +460,6 @@ pub fn cbb_to_buffer<F: FnOnce(*mut bssl_sys::CBB)>(initial_capacity: usize, fun
|
||||
unsafe { Buffer::new(ptr, len) }
|
||||
}
|
||||
|
||||
#[cfg(feature = "mlalgs")]
|
||||
/// Calls `func` with a `CBB` pointer that has been initialized to a vector
|
||||
/// of `len` bytes. That function must write exactly `len` bytes to the
|
||||
/// `CBB`. Those bytes are then returned as a vector.
|
||||
|
||||
@@ -28,5 +28,3 @@ features = ["ring"]
|
||||
|
||||
[features]
|
||||
default = []
|
||||
# `mlalgs` enables ML-KEM and ML-DSA support. This requires Rust 1.82.
|
||||
mlalgs = ["bssl-crypto/mlalgs"]
|
||||
|
||||
@@ -19,10 +19,6 @@
|
||||
//! - [ECDH_P256] for elliptic curve based Diffie-Hellman ECDH-P256
|
||||
//! - [ECDH_P384] for elliptic curve based Diffie-Hellman ECDH-P384
|
||||
//! - [X25519] for X25519
|
||||
//!
|
||||
//! If `mlalgs` feature is enabled, we also support the following post-quantum hybrid key exchange
|
||||
//! groups, for TLS 1.3.
|
||||
//!
|
||||
//! - [X25519MLKEM768] for X25519MLKEM768
|
||||
|
||||
use alloc::{
|
||||
@@ -38,9 +34,7 @@ use rustls::{
|
||||
crypto::{ActiveKeyExchange, SharedSecret, SupportedKxGroup},
|
||||
};
|
||||
|
||||
#[cfg(feature = "mlalgs")]
|
||||
mod mlkem;
|
||||
#[cfg(feature = "mlalgs")]
|
||||
pub use mlkem::X25519MLKEM768;
|
||||
|
||||
/// Elliptic Curve Diffie-Hellman key exchange group
|
||||
|
||||
@@ -314,7 +314,6 @@ impl CryptoProviderBuilder {
|
||||
self
|
||||
}
|
||||
|
||||
#[cfg(feature = "mlalgs")]
|
||||
/// Include post-quantum MLKEM hybrid key exchange groups, with a lower priority than previously
|
||||
/// registered groups.
|
||||
pub fn with_mlkem_groups(mut self) -> Self {
|
||||
|
||||
@@ -158,7 +158,6 @@ fn all_key_agreement_algorithms() {
|
||||
super::key_exchange::ECDH_P256,
|
||||
super::key_exchange::ECDH_P384,
|
||||
super::key_exchange::X25519,
|
||||
#[cfg(feature = "mlalgs")]
|
||||
super::key_exchange::X25519MLKEM768,
|
||||
] {
|
||||
test_cipher_suite(
|
||||
|
||||
@@ -43,6 +43,3 @@ default = ["std"]
|
||||
# `std` depends on the Rust `std` crate, but adds some useful trait impls if
|
||||
# available.
|
||||
std = ["bssl-crypto/std", "once_cell/std", "libc"]
|
||||
|
||||
# `mlalgs` enables ML-KEM and ML-DSA support. This requires Rust 1.82.
|
||||
mlalgs = ["bssl-crypto/mlalgs"]
|
||||
|
||||
@@ -20,5 +20,3 @@ default = ["std"]
|
||||
# `std` depends on the Rust `std` crate, but adds some useful trait impls if
|
||||
# available.
|
||||
std = ["bssl-crypto/std"]
|
||||
# `mlalgs` enables ML-KEM and ML-DSA support. This requires Rust 1.82.
|
||||
mlalgs = ["bssl-crypto/mlalgs"]
|
||||
|
||||
Reference in New Issue
Block a user