Skip to content

Commit

Permalink
test2
Browse files Browse the repository at this point in the history
  • Loading branch information
cychuang0924 committed Sep 2, 2021
1 parent 312b3b2 commit c5cbbee
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion crypto/commitment/hash_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ var _ = Describe("hash", func() {
Expect(got.Equal(p)).Should(BeTrue())
})

It("failed to new by empty point", func() {
FIt("failed to new by empty point", func() {
c, err := NewCommitterByPoint(&pt.ECPoint{})
Expect(err).ShouldNot(BeNil())
Expect(c).Should(BeNil())
Expand Down
5 changes: 4 additions & 1 deletion crypto/ecpointgrouplaw/point.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,9 @@ func isIdentity(x *big.Int, y *big.Int) bool {
}

func isSameCurve(curve1 elliptic.Curve, curve2 elliptic.Curve) bool {
if curve1 == nil || curve2 == nil {
return false
}
return reflect.DeepEqual(curve1.Params(), curve2.Params())
}

Expand Down Expand Up @@ -283,7 +286,7 @@ func ToCurve(c elliptic.Curve) (EcPointMessage_Curve, error) {
case btcec.S256():
return EcPointMessage_S256, nil
}
// TODO: Rewrite it to be a switch case.
// TODO: Rewrite it to be a switch case.
if isSameCurve(c, edwards.Edwards()) {
return EcPointMessage_EDWARD25519, nil
}
Expand Down
4 changes: 2 additions & 2 deletions crypto/ecpointgrouplaw/point_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -456,8 +456,8 @@ var _ = Describe("Point", func() {
Expect(gotP).Should(BeNil())
})

It("ToPoint()", func() {
const UnSupportedEcPointMessage EcPointMessage_Curve = 4
FIt("ToPoint()", func() {
const UnSupportedEcPointMessage EcPointMessage_Curve = 100
msg := &EcPointMessage{
Curve: UnSupportedEcPointMessage,
}
Expand Down

0 comments on commit c5cbbee

Please sign in to comment.