Skip to content

Commit edab7b9

Browse files
committed
Remove duplicate of create_session_shared_secret_from_seed function
1 parent ef783dd commit edab7b9

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

nucypher-core/src/dkg.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -618,18 +618,18 @@ impl ProtocolObjectInner<'_> for EncryptedThresholdDecryptionResponse {
618618

619619
impl ProtocolObject<'_> for EncryptedThresholdDecryptionResponse {}
620620

621-
pub fn create_session_shared_secret_from_seed(seed: u8) -> SessionSharedSecret {
622-
use rand::rngs::StdRng;
623-
use rand_core::SeedableRng;
624-
use x25519_dalek::{PublicKey, StaticSecret};
625-
626-
let mut rng = <StdRng as SeedableRng>::from_seed([seed; 32]);
627-
let static_secret_a = StaticSecret::random_from_rng(&mut rng);
628-
let static_secret_b = StaticSecret::random_from_rng(&mut rng);
629-
let public_key_b = PublicKey::from(&static_secret_b);
630-
let shared_secret = static_secret_a.diffie_hellman(&public_key_b);
631-
SessionSharedSecret::new(shared_secret)
632-
}
621+
// pub fn create_session_shared_secret_from_seed(seed: u8) -> SessionSharedSecret {
622+
// use rand::rngs::StdRng;
623+
// use rand_core::SeedableRng;
624+
// use x25519_dalek::{PublicKey, StaticSecret};
625+
626+
// let mut rng = <StdRng as SeedableRng>::from_seed([seed; 32]);
627+
// let static_secret_a = StaticSecret::random_from_rng(&mut rng);
628+
// let static_secret_b = StaticSecret::random_from_rng(&mut rng);
629+
// let public_key_b = PublicKey::from(&static_secret_b);
630+
// let shared_secret = static_secret_a.diffie_hellman(&public_key_b);
631+
// SessionSharedSecret::new(shared_secret)
632+
// }
633633

634634
#[cfg(test)]
635635
mod tests {
@@ -639,10 +639,10 @@ mod tests {
639639
use crate::dkg::{
640640
decrypt_with_shared_secret, encrypt_with_shared_secret, DecryptionError,
641641
EncryptedThresholdDecryptionRequest, EncryptedThresholdDecryptionResponse, NonceSize,
642-
ThresholdDecryptionRequest, ThresholdDecryptionResponse, create_session_shared_secret_from_seed,
642+
ThresholdDecryptionRequest, ThresholdDecryptionResponse,
643643
};
644644
#[cfg(feature = "test_vectors")]
645-
use crate::test_vectors::{TestVector, generate_test_vectors};
645+
use crate::test_vectors::{TestVector, create_session_shared_secret_from_seed, generate_test_vectors};
646646
use crate::{AuthenticatedData, Conditions};
647647
use alloc::boxed::Box;
648648
#[cfg(feature = "test_vectors")]

nucypher-core/src/test_vectors.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ pub struct TestVector {
2828
/// This is a helper function used by `generate_test_vectors` to create
2929
/// deterministic session shared secrets for testing.
3030
#[cfg(feature = "test_vectors")]
31-
fn create_session_shared_secret_from_seed(seed: u8) -> SessionSharedSecret {
31+
pub fn create_session_shared_secret_from_seed(seed: u8) -> SessionSharedSecret {
3232
use rand::rngs::StdRng;
3333
use rand_core::SeedableRng;
3434
use x25519_dalek::{PublicKey, StaticSecret};

0 commit comments

Comments
 (0)