diff --git a/umbral-pre/src/capsule.rs b/umbral-pre/src/capsule.rs index b2d937f9..f508b049 100644 --- a/umbral-pre/src/capsule.rs +++ b/umbral-pre/src/capsule.rs @@ -73,7 +73,7 @@ impl Capsule { } /// Generates a symmetric key and its associated KEM ciphertext - pub(crate) fn from_pubkey(pk: &PublicKey) -> (Capsule, CurvePoint) { + pub(crate) fn from_public_key(pk: &PublicKey) -> (Capsule, CurvePoint) { let g = CurvePoint::generator(); let priv_r = CurveScalar::random_nonzero(); @@ -205,7 +205,7 @@ mod tests { let receiving_sk = SecretKey::random(); let receiving_pk = PublicKey::from_secret_key(&receiving_sk); - let (capsule, key_seed) = Capsule::from_pubkey(&delegating_pk); + let (capsule, key_seed) = Capsule::from_public_key(&delegating_pk); let kfrags = generate_kfrags(&delegating_sk, &receiving_pk, &signing_sk, 2, 3, true, true); @@ -242,7 +242,7 @@ mod tests { .is_none()); // Mismatched capsule - let (capsule2, _key_seed) = Capsule::from_pubkey(&delegating_pk); + let (capsule2, _key_seed) = Capsule::from_public_key(&delegating_pk); assert!(capsule2 .open_reencrypted(&receiving_sk, &delegating_pk, &cfrags) .is_none()); diff --git a/umbral-pre/src/pre.rs b/umbral-pre/src/pre.rs index 13470b9b..dd639f76 100644 --- a/umbral-pre/src/pre.rs +++ b/umbral-pre/src/pre.rs @@ -13,7 +13,7 @@ use alloc::boxed::Box; /// and encapsulates the key for later reencryption. /// Returns the KEM [`Capsule`] and the ciphertext. pub fn encrypt(pk: &PublicKey, plaintext: &[u8]) -> Option<(Capsule, Box<[u8]>)> { - let (capsule, key_seed) = Capsule::from_pubkey(pk); + let (capsule, key_seed) = Capsule::from_public_key(pk); // TODO (#43): add salt and info here? let dem = DEM::new(&key_seed.to_array(), None, None); let capsule_bytes = capsule.to_array();