crypto: fix docstrings and comments

This commit is contained in:
George Ma 2024-03-22 20:29:12 +08:00 committed by Daniel Liu
parent efad15f9f4
commit 136e87fa4c
4 changed files with 4 additions and 4 deletions

View file

@ -29,7 +29,7 @@ import (
)
// BUG(agl): this implementation is not constant time.
// TODO(agl): keep GF(p²) elements in Mongomery form.
// TODO(agl): keep GF(p²) elements in Montgomery form.
// G1 is an abstract cyclic group. The zero value is suitable for use as the
// output of an operation, but cannot be used as an input.

View file

@ -48,7 +48,7 @@ func randSig() []byte {
}
// tests for malleability
// highest bit of signature ECDSA s value must be 0, in the 33th byte
// the highest bit of signature ECDSA s value must be 0, in the 33th byte
func compactSigCheck(t *testing.T, sig []byte) {
var b = int(sig[32])
if b < 0 {

View file

@ -164,7 +164,7 @@ type btCurve struct {
*btcec.KoblitzCurve
}
// Marshall converts a point given as (x, y) into a byte slice.
// Marshal converts a point given as (x, y) into a byte slice.
func (curve btCurve) Marshal(x, y *big.Int) []byte {
byteLen := (curve.Params().BitSize + 7) / 8

View file

@ -71,7 +71,7 @@ func TestVerifySignature(t *testing.T) {
wrongkey := common.CopyBytes(testpubkey)
wrongkey[10]++
if VerifySignature(wrongkey, testmsg, sig) {
t.Errorf("signature valid with with wrong public key")
t.Errorf("signature valid with wrong public key")
}
}