Skip to content

Commit a8e5a27

Browse files
committed
fix(docs): scalar serialization is big endian.
1 parent af0d37b commit a8e5a27

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/serialization.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,19 @@ pub fn deserialize_elements<G: Group + GroupEncoding>(data: &[u8], count: usize)
5656

5757
/// Serialize a slice of scalar field elements into a byte vector.
5858
///
59+
/// This function is equivalent to
60+
///
61+
/// ```ignore
62+
/// I2OSP(byte, 1) + I2OSP(x, self.field_bytes_length)
63+
/// ```
64+
///
65+
/// with I2OSP as described in RFC8017.
66+
///
5967
/// # Parameters
6068
/// - `scalars`: A slice of scalar field elements to serialize.
6169
///
6270
/// # Returns
63-
/// - A `Vec<u8>` containing the scalar bytes in little-endian order.
71+
/// - A `Vec<u8>` containing the scalar bytes in big-endian order.
6472
pub fn serialize_scalars<G: Group>(scalars: &[G::Scalar]) -> Vec<u8> {
6573
let mut bytes = Vec::new();
6674
for scalar in scalars {

0 commit comments

Comments
 (0)