Skip to content

Commit a65f366

Browse files
add comment explaining what a coordinate refers to
1 parent 9c822f2 commit a65f366

File tree

1 file changed

+4
-2
lines changed
  • crates/starknet-types-core/src/qm31

1 file changed

+4
-2
lines changed

crates/starknet-types-core/src/qm31/mod.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ impl fmt::Display for QM31Error {
3535

3636
/// Definition of a Quadruple Merseene 31.
3737
///
38-
/// The internal representation is composed of 4 coordinates, following a big-endian ordering.
39-
/// Each coordinate can be represented by 36 bits.
38+
/// The internal representation is composed of 4 limbs, following a big-endian ordering.
39+
/// Each of this limbs can be represented by 36 bits.
4040
#[repr(transparent)]
4141
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
4242
pub struct QM31([u64; 4]);
@@ -50,6 +50,8 @@ impl QM31 {
5050
}
5151

5252
/// Creates a [QM31] in its reduced form from four u64 coordinates.
53+
///
54+
/// A coordinate refers to a value in the M31 field.
5355
pub fn from_coordinates(coordinates: [u64; 4]) -> QM31 {
5456
Self([
5557
coordinates[0] % STWO_PRIME,

0 commit comments

Comments
 (0)