From 8e97c11dd661bdd8257d5d785b2d5721a43832b7 Mon Sep 17 00:00:00 2001 From: dan Date: Fri, 8 Sep 2023 15:30:27 +0300 Subject: [PATCH] chore: misc comments --- mpz-core/src/cointoss/receiver.rs | 2 +- ot/mpz-ot-core/src/kos/receiver.rs | 5 ++++- ot/mpz-ot-core/src/kos/sender.rs | 5 ++++- .../mpz-share-conversion-core/src/fields/p256.rs | 1 + 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/mpz-core/src/cointoss/receiver.rs b/mpz-core/src/cointoss/receiver.rs index 7e287de7..6e1ec26a 100644 --- a/mpz-core/src/cointoss/receiver.rs +++ b/mpz-core/src/cointoss/receiver.rs @@ -90,7 +90,7 @@ pub mod receiver_state { opaque_debug::implement!(Initialized); - /// The receiver's state after receiving the sender's commitment. + /// The receiver's state after receiving the sender's commitment and revealing one's own seed. pub struct Received { pub(super) seeds: Vec, pub(super) commitment: Hash, diff --git a/ot/mpz-ot-core/src/kos/receiver.rs b/ot/mpz-ot-core/src/kos/receiver.rs index 939b0470..491b3911 100644 --- a/ot/mpz-ot-core/src/kos/receiver.rs +++ b/ot/mpz-ot-core/src/kos/receiver.rs @@ -689,7 +689,10 @@ pub mod state { opaque_debug::implement!(Initialized); - /// The receiver's state after base setup + /// The receiver's state after the setup phase. + /// + /// In this state the receiver performs OT extension (potentially multiple times). Also in this + /// state the receiver sends OT requests. pub struct Extension { /// Receiver's rngs pub(super) rngs: Vec<[ChaCha20Rng; 2]>, diff --git a/ot/mpz-ot-core/src/kos/sender.rs b/ot/mpz-ot-core/src/kos/sender.rs index 4f0358f8..ea93d90c 100644 --- a/ot/mpz-ot-core/src/kos/sender.rs +++ b/ot/mpz-ot-core/src/kos/sender.rs @@ -472,7 +472,10 @@ pub mod state { opaque_debug::implement!(Initialized); - /// The sender's state after base OT setup + /// The sender's state after the setup phase. + /// + /// In this state the sender performs OT extension (potentially multiple times). Also in this + /// state the sender responds to OT requests. pub struct Extension { /// Sender's base OT choices pub(super) delta: Block, diff --git a/share-conversion/mpz-share-conversion-core/src/fields/p256.rs b/share-conversion/mpz-share-conversion-core/src/fields/p256.rs index 16505295..f5fd009e 100644 --- a/share-conversion/mpz-share-conversion-core/src/fields/p256.rs +++ b/share-conversion/mpz-share-conversion-core/src/fields/p256.rs @@ -43,6 +43,7 @@ impl From for [u8; 32] { impl TryFrom<[u8; 32]> for P256 { type Error = ark_serialize::SerializationError; + /// Converts little-endian bytes into a P256 field element. fn try_from(value: [u8; 32]) -> Result { Fq::deserialize_with_mode(&value[..], Compress::No, Validate::Yes).map(P256) }