Skip to content

Commit d1b5a80

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

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/serialization.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,17 @@ 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
60+
///
61+
/// I2OSP(byte, 1) + I2OSP(x, self.field_bytes_length)
62+
///
63+
/// with I2OSP as described in RFC8017.
64+
///
5965
/// # Parameters
6066
/// - `scalars`: A slice of scalar field elements to serialize.
6167
///
6268
/// # Returns
63-
/// - A `Vec<u8>` containing the scalar bytes in little-endian order.
69+
/// - A `Vec<u8>` containing the scalar bytes in big-endian order.
6470
pub fn serialize_scalars<G: Group>(scalars: &[G::Scalar]) -> Vec<u8> {
6571
let mut bytes = Vec::new();
6672
for scalar in scalars {

0 commit comments

Comments
 (0)