func TestHighBitIgnored(t *testing.T) {
	var s, u [32]byte
	rand.Read(s[:])
	rand.Read(u[:])

	var hi0, hi1 [32]byte

	u[31] &= 0x7f
	ScalarMult(&hi0, &s, &u)

	u[31] |= 0x80
	ScalarMult(&hi1, &s, &u)

	if !bytes.Equal(hi0[:], hi1[:]) {
		t.Errorf("high bit of group point should not affect result")
	}
}
// TestHighBitIgnored tests the following requirement in RFC 7748:
//
//	When receiving such an array, implementations of X25519 (but not X448) MUST
//	mask the most significant bit in the final byte.
//
// Regression test for issue #30095.
TestHighBitIgnored tests the following requirement in RFC 7748.

When receiving such an array, implementations of X25519 (but not X448) MUST
mask the most significant bit in the final byte.

Regression test for issue #30095.
// TestHighBitIgnored tests the following requirement in RFC 7748 : // // When receiving such an array implementations of X25519 ( but not X448 ) MUST // mask the most significant bit in the final byte . // // Regression test for issue #30095 .
func TestHighBitIgnored(t *testing.T) {
	var s, u [32]byte
	rand.Read(s[:])
	rand.Read(u[:])
	var hi0, hi1 [32]byte
	u[31] &= 0x7f
	ScalarMult(&hi0, &s, &u)
	u[31] |= 0x80
	ScalarMult(&hi1, &s, &u)
	if !bytes.Equal(hi0[:], hi1[:]) {
		t.Errorf("high bit of group point should not affect result")
	}
}
func TestHighBitIgnored ( t * testing . T ) { var s , u [ 32 ] byte rand . Read ( s [ : ] ) rand . Read ( u [ : ] ) var hi0 , hi1 [ 32 ] byte u [ 31 ] &= 0x7f ScalarMult ( & hi0 , & s , & u ) u [ 31 ] |= 0x80 ScalarMult ( & hi1 , & s , & u ) if ! bytes . Equal ( hi0 [ : ] , hi1 [ : ] ) { t . Errorf ( " " ) } }
TestHighBitIgnored tests the following requirement in RFC 7748.
TestHighBitIgnored tests the following requirement in RFC 7748 .