Skip to content

Commit

Permalink
Fix some golang style
Browse files Browse the repository at this point in the history
  • Loading branch information
claucece committed Dec 4, 2019
1 parent 9426dfb commit b0a0e9c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion crypto/batch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func TestInvalidBatchProofP256(t *testing.T) {
}

// and a 100th point with a different discrete log
m, Mx, My, err := elliptic.GenerateKey(curve, rand.Reader)
m, Mx, My, _ := elliptic.GenerateKey(curve, rand.Reader)
Zx, Zy := curve.ScalarMult(Mx, My, m)
M[99] = &Point{Curve: curve, X: Mx, Y: My}
Z[99] = &Point{Curve: curve, X: Zx, Y: Zy}
Expand Down
5 changes: 2 additions & 3 deletions crypto/curve.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,8 @@ func (p *Point) Unmarshal(curve elliptic.Curve, data []byte) error {
p.Curve = curve
p.X, p.Y = x, y
return nil
} else {
return ErrInvalidPoint
}
return ErrInvalidPoint
}
if len(data) == (2*byteLen)+1 && data[0] == 0x04 {
// Uncompressed point
Expand Down Expand Up @@ -182,7 +181,7 @@ func randScalar(curve elliptic.Curve, rand io.Reader) ([]byte, *big.Int, error)

// When in doubt, do what agl does in elliptic.go. Presumably
// new(big.Int).SetBytes(b).Mod(N) would introduce bias, so we're sampling.
for true {
for {
_, err := io.ReadFull(rand, buf)
if err != nil {
return nil, nil, err
Expand Down
2 changes: 1 addition & 1 deletion issuer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ func tokenIssuance(t *testing.T, h2cObj crypto.H2CObject) {
dleq.G = G
dleq.H = H
Q := signTokens(bP, key)
dleq.M, dleq.Z, err = recomputeComposites(G, H, bP, Q, h2cObj.Hash(), h2cObj.Curve())
dleq.M, dleq.Z, _ = recomputeComposites(G, H, bP, Q, h2cObj.Hash(), h2cObj.Curve())
if !dleq.Verify() {
t.Fatal("DLEQ proof failed to verify")
}
Expand Down

0 comments on commit b0a0e9c

Please sign in to comment.