Skip to content

Commit

Permalink
crypto: test
Browse files Browse the repository at this point in the history
  • Loading branch information
cychuang0924 committed Sep 2, 2021
1 parent 4831138 commit 312b3b2
Show file tree
Hide file tree
Showing 28 changed files with 3,988 additions and 37 deletions.
Binary file added crypto/.DS_Store
Binary file not shown.
2 changes: 1 addition & 1 deletion crypto/binaryfield/message.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crypto/binaryquadraticform/message.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crypto/bip32/child/message.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crypto/bip32/master/message.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crypto/birkhoffinterpolation/bk.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crypto/circuit/message.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crypto/commitment/message.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions crypto/ecpointgrouplaw/point.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,8 @@ func (c EcPointMessage_Curve) GetEllipticCurve() (elliptic.Curve, error) {
return elliptic.P384(), nil
case EcPointMessage_S256:
return btcec.S256(), nil
case EcPointMessage_EDWARD25519:
return edwards.Edwards(), nil
}
return nil, ErrInvalidCurve
}
Expand All @@ -281,5 +283,9 @@ func ToCurve(c elliptic.Curve) (EcPointMessage_Curve, error) {
case btcec.S256():
return EcPointMessage_S256, nil
}
// TODO: Rewrite it to be a switch case.
if isSameCurve(c, edwards.Edwards()) {
return EcPointMessage_EDWARD25519, nil
}
return 0, ErrInvalidCurve
}
36 changes: 20 additions & 16 deletions crypto/ecpointgrouplaw/point.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crypto/ecpointgrouplaw/point.proto
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ message EcPointMessage {
P256 = 1;
P384 = 2;
S256 = 3;
EDWARD25519 = 4;
}
Curve curve = 1;
bytes x = 2;
Expand Down
2 changes: 1 addition & 1 deletion crypto/homo/cl/message.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crypto/homo/paillier/message.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crypto/ot/message.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added crypto/schnorrsignature/.DS_Store
Binary file not shown.
Loading

0 comments on commit 312b3b2

Please sign in to comment.