From d94347449f4dfdc4f43d15249e016eacdb01f11f Mon Sep 17 00:00:00 2001 From: Justin Smith Date: Thu, 6 Feb 2025 13:02:53 -0500 Subject: [PATCH] Remove unused code --- aws-lc-rs/src/bn.rs | 14 -------------- aws-lc-rs/src/unstable.rs | 11 ----------- aws-lc-rs/src/unstable/kdf.rs | 11 ----------- aws-lc-rs/src/unstable/kem.rs | 31 ------------------------------- 4 files changed, 67 deletions(-) delete mode 100644 aws-lc-rs/src/unstable/kdf.rs delete mode 100644 aws-lc-rs/src/unstable/kem.rs diff --git a/aws-lc-rs/src/bn.rs b/aws-lc-rs/src/bn.rs index 6b54192b0ec..d84e0639959 100644 --- a/aws-lc-rs/src/bn.rs +++ b/aws-lc-rs/src/bn.rs @@ -13,20 +13,6 @@ impl TryFrom<&[u8]> for LcPtr { } } -impl TryFrom for LcPtr { - type Error = (); - - fn try_from(value: u64) -> Result { - unsafe { - let mut bn = LcPtr::new(BN_new())?; - if 1 != BN_set_u64(*bn.as_mut(), value) { - return Err(()); - } - Ok(bn) - } - } -} - impl TryFrom<&[u8]> for DetachableLcPtr { type Error = (); diff --git a/aws-lc-rs/src/unstable.rs b/aws-lc-rs/src/unstable.rs index e608608cc4e..566a4083fea 100644 --- a/aws-lc-rs/src/unstable.rs +++ b/aws-lc-rs/src/unstable.rs @@ -4,16 +4,5 @@ #![cfg(feature = "unstable")] #![allow(missing_docs)] -//! Unstable aws-lc-rs features. -//! -//! # ⚠️ Warning -//! Features contained within this module, or child modules are subject to changes, relocation, -//! or removal across minor releases, and thus are not subject to semantic versioning policies. -#[deprecated(note = "use `aws_lc_rs::kdf` instead")] -pub mod kdf; - -#[deprecated(note = "use `aws_lc_rs::kem` instead")] -pub mod kem; - #[cfg(not(feature = "fips"))] pub mod signature; diff --git a/aws-lc-rs/src/unstable/kdf.rs b/aws-lc-rs/src/unstable/kdf.rs deleted file mode 100644 index 83c7dcde947..00000000000 --- a/aws-lc-rs/src/unstable/kdf.rs +++ /dev/null @@ -1,11 +0,0 @@ -/* - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0 OR ISC - */ - -#[deprecated(note = "use `aws_lc_rs::kdf` instead")] -pub use crate::kdf::{ - get_kbkdf_ctr_hmac_algorithm, get_sskdf_digest_algorithm, get_sskdf_hmac_algorithm, - kbkdf_ctr_hmac, sskdf_digest, sskdf_hmac, KbkdfCtrHmacAlgorithm, KbkdfCtrHmacAlgorithmId, - SskdfDigestAlgorithm, SskdfDigestAlgorithmId, SskdfHmacAlgorithm, SskdfHmacAlgorithmId, -}; diff --git a/aws-lc-rs/src/unstable/kem.rs b/aws-lc-rs/src/unstable/kem.rs deleted file mode 100644 index 2facb2888d2..00000000000 --- a/aws-lc-rs/src/unstable/kem.rs +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 OR ISC - -use core::fmt::Debug; - -use crate::kem::Algorithm; - -#[deprecated(note = "use aws_lc_rs::kem::{ML_KEM_512, ML_KEM_768, ML_KEM_1024}")] -pub use crate::kem::{ML_KEM_1024, ML_KEM_512, ML_KEM_768}; - -#[non_exhaustive] -#[derive(Clone, Copy, Debug, PartialEq)] -pub enum AlgorithmId {} - -impl crate::kem::AlgorithmIdentifier for AlgorithmId { - #[inline] - fn nid(self) -> i32 { - unreachable!("There are no AlgorithmIds") - } -} - -impl crate::sealed::Sealed for AlgorithmId {} - -/// Retrieve an unstable KEM [`Algorithm`] using the [`AlgorithmId`] specified by `id`. -/// May return [`None`] if support for the algorithm has been removed from the unstable module. -/// # ⚠️ Warning -/// This function currently only returns [`None`]. -#[must_use] -pub const fn get_algorithm(_id: AlgorithmId) -> Option<&'static Algorithm> { - None -}