package schnorr import ( "testing" . "kesim.org/seal/common" ) func TestSchnorr(t *testing.T) { a, e := Curve.ScalarFromReader(nil) if e != nil { t.Fatal(e) } A := G.Exp(a) id, e := Curve.ScalarFromReader(nil) if e != nil { t.Fatal(e) } ID := G.Exp(id) s := (*Statement)(a) c := (*Commitment)(A) pr := s.Proof(ID) if !c.Verify(pr, ID) { t.Fatalf("Verification failed!") } if c.Verify(pr, ID.Exp(a)) { t.Fatal("Verification didn't fail!") } }