We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9fd570d commit 0c3868eCopy full SHA for 0c3868e
dh/curve4q/curve4Q.go
@@ -20,8 +20,10 @@ func KeyGen(public, secret *Key) {
20
func Shared(shared, secret, public *Key) bool {
21
var P, Q fourq.Point
22
ok := P.Unmarshal((*[Size]byte)(public))
23
+ if !ok {
24
+ return false
25
+ }
26
Q.ScalarMult((*[Size]byte)(secret), &P)
27
Q.Marshal((*[Size]byte)(shared))
- ok = ok && Q.IsOnCurve()
- return ok
28
+ return !Q.IsIdentity() && Q.IsOnCurve()
29
}
0 commit comments