mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-17 10:20:44 +00:00
crypto: fix docstrings and comments
This commit is contained in:
parent
efad15f9f4
commit
136e87fa4c
4 changed files with 4 additions and 4 deletions
|
|
@ -29,7 +29,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// BUG(agl): this implementation is not constant time.
|
// 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
|
// 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.
|
// output of an operation, but cannot be used as an input.
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ func randSig() []byte {
|
||||||
}
|
}
|
||||||
|
|
||||||
// tests for malleability
|
// 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) {
|
func compactSigCheck(t *testing.T, sig []byte) {
|
||||||
var b = int(sig[32])
|
var b = int(sig[32])
|
||||||
if b < 0 {
|
if b < 0 {
|
||||||
|
|
|
||||||
|
|
@ -164,7 +164,7 @@ type btCurve struct {
|
||||||
*btcec.KoblitzCurve
|
*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 {
|
func (curve btCurve) Marshal(x, y *big.Int) []byte {
|
||||||
byteLen := (curve.Params().BitSize + 7) / 8
|
byteLen := (curve.Params().BitSize + 7) / 8
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,7 @@ func TestVerifySignature(t *testing.T) {
|
||||||
wrongkey := common.CopyBytes(testpubkey)
|
wrongkey := common.CopyBytes(testpubkey)
|
||||||
wrongkey[10]++
|
wrongkey[10]++
|
||||||
if VerifySignature(wrongkey, testmsg, sig) {
|
if VerifySignature(wrongkey, testmsg, sig) {
|
||||||
t.Errorf("signature valid with with wrong public key")
|
t.Errorf("signature valid with wrong public key")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue