Skip to content

Commit 1bcf5b0

Browse files
committed
Document bitwise OR operation
1 parent fc70c3e commit 1bcf5b0

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

packages/crypto/src/bls12_318/constants.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,14 @@ mod test {
5353
point
5454
}
5555

56+
// Note about the bitwise OR operation on the X coordinates:
57+
//
58+
// The first bit of the x-coordinate sets the "compression" flag. The most significant three bits of a G1/G2 coordinate are used for storing some information.
59+
// If we didn't do that to the output, the constants wouldn't check out due to the constants being constructed by a standard adhereing BLS library,
60+
// where it set the compression flag since it's the standard way of serializing the points.
61+
//
62+
// Ref: https://github.com/zcash/librustzcash/blob/6e0364cd42a2b3d2b958a54771ef51a8db79dd29/pairing/src/bls12_381/README.md#serialization
63+
5664
#[test]
5765
fn g1_generator_correct() {
5866
// Source: <https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-pairing-friendly-curves-02#section-4.3.2>

0 commit comments

Comments
 (0)