This commit is contained in:
Sam Kim
2021-10-13 10:03:47 -04:00
committed by Michael Vines
parent aea95e8ff3
commit 500423626d

View File

@@ -12,6 +12,7 @@ use {
scalar::Scalar, scalar::Scalar,
}, },
ed25519_dalek::SecretKey as SigningKey, ed25519_dalek::SecretKey as SigningKey,
solana_sdk::pubkey::Pubkey,
serde::{Deserialize, Serialize}, serde::{Deserialize, Serialize},
solana_sdk::pubkey::Pubkey, solana_sdk::pubkey::Pubkey,
std::collections::HashMap, std::collections::HashMap,
@@ -57,14 +58,6 @@ impl ElGamal {
} }
} }
#[cfg(not(target_arch = "bpf"))]
#[allow(non_snake_case)]
pub fn from_signing_key(signing_key: &SigningKey, label: &'static [u8]) -> Self {
let secret = ElGamalSecretKey::new(signing_key, label);
let public = ElGamalPubkey::new(&secret);
Self { secret, public }
}
/// On input a public key and a message to be encrypted, the function /// On input a public key and a message to be encrypted, the function
/// returns an ElGamal ciphertext of the message under the public key. /// returns an ElGamal ciphertext of the message under the public key.
#[cfg(not(target_arch = "bpf"))] #[cfg(not(target_arch = "bpf"))]