From bddc60a6c77b9edfaab1d94328206e0f96b82f3c Mon Sep 17 00:00:00 2001 From: Andy Leiserson Date: Tue, 5 Dec 2023 09:56:38 -0800 Subject: [PATCH] PR feedback --- ipa-core/src/ff/ec_prime_field.rs | 12 ------------ ipa-core/src/protocol/prss/crypto.rs | 7 ++++++- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/ipa-core/src/ff/ec_prime_field.rs b/ipa-core/src/ff/ec_prime_field.rs index 5a1ffb091..06be2e829 100644 --- a/ipa-core/src/ff/ec_prime_field.rs +++ b/ipa-core/src/ff/ec_prime_field.rs @@ -139,18 +139,6 @@ impl From for Fp25519 { } } -/* -/// BA256 mod field prime -impl BA256 { - #[must_use] - pub fn mod_fp25519(&self) -> Self { - let mut buf: GenericArray = [0u8; 32].into(); - Fp25519::from(*self).serialize(&mut buf); - BA256::deserialize(&buf) - } -} -*/ - ///conversion from and to unsigned integers, preserving entropy, for testing purposes only #[cfg(test)] macro_rules! sc_hash_impl { diff --git a/ipa-core/src/protocol/prss/crypto.rs b/ipa-core/src/protocol/prss/crypto.rs index 18973dc1c..9293fa306 100644 --- a/ipa-core/src/protocol/prss/crypto.rs +++ b/ipa-core/src/protocol/prss/crypto.rs @@ -26,7 +26,12 @@ pub trait FromRandomU128 { /// Trait for things that can be generated by PRSS. /// -/// The exact semantics of the generation depend on the value being generated. +/// The exact semantics of the generation depend on the value being generated, but like +/// `rand::distributions::Standard`, a uniform distribution is typical. When implementing +/// this trait, consider the consequences if the implementation were to be used in +/// an unexpected way. For example, an implementation that draws from a subset of the +/// possible values could be dangerous, if used in an unexpected context where +/// security relies on sampling from the full space. /// /// At a high level, there are two kinds of PRSS generation: /// 1. Raw values: In this case, two values are generated, one using the randomness that is shared