-
Notifications
You must be signed in to change notification settings - Fork 166
/
proof.go
769 lines (653 loc) · 19.9 KB
/
proof.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
// Package proof implements generic support for Sigma-protocols
// and discrete logarithm proofs in the Camenisch/Stadler framework.
// For the cryptographic foundations of this framework see
// "Proof Systems for General Statements about Discrete Logarithms" at
// ftp://ftp.inf.ethz.ch/pub/crypto/publications/CamSta97b.pdf.
package proof
import (
"errors"
"go.dedis.ch/kyber/v4"
)
// Suite defines the functionalities needed for this package to operate
// correctly. It provides a general abstraction to easily change the underlying
// implementations.
type Suite interface {
kyber.Group
kyber.HashFactory
kyber.Encoding
kyber.XOFFactory
kyber.Random
}
/*
A Predicate is a composable logic expression in a knowledge proof system,
representing a "knowledge specification set" in Camenisch/Stadler terminology.
Atomic predicates in this system are statements of the form P=x1*B1+...+xn+Bn,
indicating the prover knows secrets x1,...,xn that make the statement true,
where P and B1,...,Bn are public points known to the verifier.
These atomic Rep (representation) predicates may be combined
with logical And and Or combinators to form composite statements.
Predicate objects, once created, are immutable and safe to share
or reuse for any number of proofs and verifications.
After constructing a Predicate using the Rep, And, and Or functions below,
the caller invokes Prover() to create a Sigma-protocol prover.
Prover() requires maps defining the values of both the Scalar variables
and the public Point variables that the Predicate refers to.
If the statement contains logical Or operators, the caller must also pass
a map containing branch choices for each Or predicate
in the "proof-obligated path" down through the Or predicates.
See the examples provded for the Or function for more details.
Similarly, the caller may invoke Verifier() to create
a Sigma-protocol verifier for the predicate.
The caller must pass a map defining the values
of the public Point variables that the proof refers to.
The verifier need not be provided any secrets or branch choices, of course.
(If the verifier needed those then they wouldn't be secret, would they?)
Currently we require that all Or operators be above all And operators
in the expression - i.e., Or-of-And combinations are allowed,
but no And-of-Or predicates.
We could rewrite expressions into this form as Camenisch/Stadler suggest,
but that could run a risk of unexpected exponential blowup in the worst case.
We could avoid this risk by not rewriting the expression tree,
but instead generating Pedersen commits for variables that need to "cross"
from one OR-domain to another non-mutually-exclusive one.
For now we simply require expressions to be in the appropriate form.
*/
type Predicate interface {
// Create a Prover proving the statement this Predicate represents.
Prover(suite Suite, secrets map[string]kyber.Scalar,
points map[string]kyber.Point, choice map[Predicate]int) Prover
// Create a Verifier for the statement this Predicate represents.
Verifier(suite Suite, points map[string]kyber.Point) Verifier
// Produce a human-readable string representation of the predicate.
String() string
// precedence-sensitive helper stringifier.
precString(prec int) string
// prover/verifier: enumerate the variables named in a predicate
enumVars(prf *proof)
// prover: recursively produce all commitments
commit(prf *proof, w kyber.Scalar, v []kyber.Scalar) error
// prover: given challenge, recursively produce all responses
respond(prf *proof, c kyber.Scalar, r []kyber.Scalar) error
// verifier: get all the commitments required in this predicate,
// and fill the r slice with empty secrets for responses needed.
getCommits(prf *proof, r []kyber.Scalar) error
// verifier: check all commitments against challenges and responses
verify(prf *proof, c kyber.Scalar, r []kyber.Scalar) error
}
// stringification precedence levels
const (
precNone = iota
precOr
precAnd
precAtom
)
// Internal prover/verifier state
type proof struct {
s Suite
nsvars int // number of Scalar variables
npvars int // number of Point variables
svar, pvar []string // Scalar and Point variable names
sidx, pidx map[string]int // Maps from strings to variable indexes
pval map[string]kyber.Point // values of public Point variables
// prover-specific state
pc ProverContext
sval map[string]kyber.Scalar // values of private Scalar variables
choice map[Predicate]int // OR branch choices set by caller
pp map[Predicate]*proverPred // per-predicate prover state
// verifier-specific state
vc VerifierContext
vp map[Predicate]*verifierPred // per-predicate verifier state
}
type proverPred struct {
w kyber.Scalar // secret pre-challenge
v []kyber.Scalar // secret blinding factor for each variable
wi []kyber.Scalar // OR predicates: individual sub-challenges
}
type verifierPred struct {
V kyber.Point // public commitment produced by verifier
r []kyber.Scalar // per-variable responses produced by verifier
}
////////// Rep predicate //////////
// A term describes a point-multiplication term in a representation expression.
type term struct {
S string // Scalar multiplier for this term
B string // Generator for this term
}
type repPred struct {
P string // Public point of which a representation is known
T []term // Terms comprising the known representation
}
// Rep creates a predicate stating that the prover knows
// a representation of a point P with respect to
// one or more secrets and base point pairs.
//
// In its simplest usage, Rep indicates that the prover knows a secret x
// that is the (elliptic curve) discrete logarithm of a public point P
// with respect to a well-known base point B:
//
// Rep(P,x,B)
//
// Rep can take any number of (Scalar,Base) variable name pairs, however.
// A Rep statement of the form Rep(P,x1,B1,...,xn,Bn)
// indicates that the prover knows secrets x1,...,xn
// such that point P is the sum x1*B1+...+xn*Bn.
//
func Rep(P string, SB ...string) Predicate {
if len(SB)&1 != 0 {
panic("mismatched Scalar")
}
t := make([]term, len(SB)/2)
for i := range t {
t[i].S = SB[i*2]
t[i].B = SB[i*2+1]
}
return &repPred{P, t}
}
// Return a string representation of this proof-of-representation predicate,
// mainly for debugging.
func (rp *repPred) String() string {
return rp.precString(precNone)
}
func (rp *repPred) precString(prec int) string {
s := rp.P + "="
for i := range rp.T {
if i > 0 {
s += "+"
}
t := &rp.T[i]
s += t.S
s += "*"
s += t.B
}
return s
}
func (rp *repPred) enumVars(prf *proof) {
prf.enumPointVar(rp.P)
for i := range rp.T {
prf.enumScalarVar(rp.T[i].S)
prf.enumPointVar(rp.T[i].B)
}
}
func (rp *repPred) commit(prf *proof, w kyber.Scalar, pv []kyber.Scalar) error {
// Create per-predicate prover state
v := prf.makeScalars(pv)
pp := &proverPred{w, v, nil}
prf.pp[rp] = pp
// Compute commit V=wY+v1G1+...+vkGk
V := prf.s.Point()
if w != nil { // We're on a non-obligated branch
V.Mul(w, prf.pval[rp.P])
} else { // We're on a proof-obligated branch, so w=0
V.Null()
}
P := prf.s.Point()
for i := 0; i < len(rp.T); i++ {
t := rp.T[i] // current term
s := prf.sidx[t.S]
// Choose a blinding secret the first time
// we encounter each variable
if v[s] == nil {
v[s] = prf.s.Scalar()
prf.pc.PriRand(v[s])
}
P.Mul(v[s], prf.pval[t.B])
V.Add(V, P)
}
// Encode and send the commitment to the verifier
return prf.pc.Put(V)
}
func (rp *repPred) respond(prf *proof, c kyber.Scalar,
pr []kyber.Scalar) error {
pp := prf.pp[rp]
// Create a response array for this OR-domain if not done already
r := prf.makeScalars(pr)
for i := range rp.T {
t := rp.T[i] // current term
s := prf.sidx[t.S]
// Produce a correct response for each variable
// the first time we encounter that variable.
if r[s] == nil {
if pp.w != nil {
// We're on a non-proof-obligated branch:
// w was our challenge, v[s] is our response.
r[s] = pp.v[s]
continue
}
// We're on a proof-obligated branch,
// so we need to calculate the correct response
// as r = v-cx where x is the secret variable
ri := prf.s.Scalar()
ri.Mul(c, prf.sval[t.S])
ri.Sub(pp.v[s], ri)
r[s] = ri
}
}
// Send our responses if we created the array (i.e., if pr == nil)
return prf.sendResponses(pr, r)
}
func (rp *repPred) getCommits(prf *proof, pr []kyber.Scalar) error {
// Create per-predicate verifier state
V := prf.s.Point()
r := prf.makeScalars(pr)
vp := &verifierPred{V, r}
prf.vp[rp] = vp
// Get the commitment for this representation
if e := prf.vc.Get(vp.V); e != nil {
return e
}
// Fill in the r vector with the responses we'll need.
for i := range rp.T {
t := rp.T[i] // current term
s := prf.sidx[t.S]
if r[s] == nil {
r[s] = prf.s.Scalar()
}
}
return nil
}
func (rp *repPred) verify(prf *proof, c kyber.Scalar, pr []kyber.Scalar) error {
vp := prf.vp[rp]
r := vp.r
// Get the needed responses if a parent didn't already
if e := prf.getResponses(pr, r); e != nil {
return e
}
// Recompute commit V=cY+r1G1+...+rkGk
V := prf.s.Point()
V.Mul(c, prf.pval[rp.P])
P := prf.s.Point()
for i := 0; i < len(rp.T); i++ {
t := rp.T[i] // current term
s := prf.sidx[t.S]
P.Mul(r[s], prf.pval[t.B])
V.Add(V, P)
}
if !V.Equal(vp.V) {
return errors.New("invalid proof: commit mismatch")
}
return nil
}
func (rp *repPred) Prover(suite Suite, secrets map[string]kyber.Scalar,
points map[string]kyber.Point,
choice map[Predicate]int) Prover {
return proof{}.init(suite, rp).prover(rp, secrets, points, choice)
}
func (rp *repPred) Verifier(suite Suite,
points map[string]kyber.Point) Verifier {
return proof{}.init(suite, rp).verifier(rp, points)
}
////////// And predicate //////////
type andPred []Predicate
// And predicate states that all of the constituent sub-predicates are true.
// And predicates may contain Rep predicates and/or other And predicates.
func And(sub ...Predicate) Predicate {
and := andPred(sub)
return &and
}
// Return a string representation of this AND predicate, mainly for debugging.
func (ap *andPred) String() string {
return ap.precString(precNone)
}
func (ap *andPred) precString(prec int) string {
sub := []Predicate(*ap)
s := sub[0].precString(precAnd)
for i := 1; i < len(sub); i++ {
s = s + " && " + sub[i].precString(precAnd)
}
if prec != precNone && prec != precAnd {
s = "(" + s + ")"
}
return s
}
func (ap *andPred) enumVars(prf *proof) {
sub := []Predicate(*ap)
for i := range sub {
sub[i].enumVars(prf)
}
}
func (ap *andPred) commit(prf *proof, w kyber.Scalar, pv []kyber.Scalar) error {
sub := []Predicate(*ap)
// Create per-predicate prover state
v := prf.makeScalars(pv)
//pp := proverPred{w,v,nil}
//prf.pp[ap] = pp
// Recursively generate commitments
for i := 0; i < len(sub); i++ {
if e := sub[i].commit(prf, w, v); e != nil {
return e
}
}
return nil
}
func (ap *andPred) respond(prf *proof, c kyber.Scalar, pr []kyber.Scalar) error {
sub := []Predicate(*ap)
//pp := prf.pp[ap]
// Recursively compute responses in all sub-predicates
r := prf.makeScalars(pr)
for i := range sub {
if e := sub[i].respond(prf, c, r); e != nil {
return e
}
}
return prf.sendResponses(pr, r)
}
func (ap *andPred) getCommits(prf *proof, pr []kyber.Scalar) error {
sub := []Predicate(*ap)
// Create per-predicate verifier state
r := prf.makeScalars(pr)
vp := &verifierPred{nil, r}
prf.vp[ap] = vp
for i := range sub {
if e := sub[i].getCommits(prf, r); e != nil {
return e
}
}
return nil
}
func (ap *andPred) verify(prf *proof, c kyber.Scalar, pr []kyber.Scalar) error {
sub := []Predicate(*ap)
vp := prf.vp[ap]
r := vp.r
if e := prf.getResponses(pr, r); e != nil {
return e
}
for i := range sub {
if e := sub[i].verify(prf, c, r); e != nil {
return e
}
}
return nil
}
func (ap *andPred) Prover(suite Suite, secrets map[string]kyber.Scalar,
points map[string]kyber.Point,
choice map[Predicate]int) Prover {
return proof{}.init(suite, ap).prover(ap, secrets, points, choice)
}
func (ap *andPred) Verifier(suite Suite,
points map[string]kyber.Point) Verifier {
return proof{}.init(suite, ap).verifier(ap, points)
}
////////// Or predicate //////////
type orPred []Predicate
// Or predicate states that the prover knows
// at least one of the sub-predicates to be true,
// but the proof does not reveal any information about which.
func Or(sub ...Predicate) Predicate {
or := orPred(sub)
return &or
}
// Return a string representation of this OR predicate, mainly for debugging.
func (op *orPred) String() string {
return op.precString(precNone)
}
func (op *orPred) precString(prec int) string {
sub := []Predicate(*op)
s := sub[0].precString(precOr)
for i := 1; i < len(sub); i++ {
s = s + " || " + sub[i].precString(precOr)
}
if prec != precNone && prec != precOr {
s = "(" + s + ")"
}
return s
}
func (op *orPred) enumVars(prf *proof) {
sub := []Predicate(*op)
for i := range sub {
sub[i].enumVars(prf)
}
}
func (op *orPred) commit(prf *proof, w kyber.Scalar, pv []kyber.Scalar) error {
sub := []Predicate(*op)
if pv != nil { // only happens within an AND expression
return errors.New("can't have OR predicates within AND predicates")
}
// Create per-predicate prover state
wi := make([]kyber.Scalar, len(sub))
pp := &proverPred{w, nil, wi}
prf.pp[op] = pp
// Choose pre-challenges for our subs.
if w == nil {
// We're on a proof-obligated branch;
// choose random pre-challenges for only non-obligated subs.
choice, ok := prf.choice[op]
if !ok || choice < 0 || choice >= len(sub) {
return errors.New("no choice of proof branch for OR-predicate " +
op.String())
}
for i := 0; i < len(sub); i++ {
if i != choice {
wi[i] = prf.s.Scalar()
prf.pc.PriRand(wi[i])
} // else wi[i] == nil for proof-obligated sub
}
} else {
// Since w != nil, we're in a non-obligated branch,
// so choose random pre-challenges for all subs
// such that they add up to the master pre-challenge w.
last := len(sub) - 1 // index of last sub
wl := prf.s.Scalar().Set(w)
for i := 0; i < last; i++ { // choose all but last
wi[i] = prf.s.Scalar()
prf.pc.PriRand(wi[i])
wl.Sub(wl, wi[i])
}
wi[last] = wl
}
// Now recursively choose commitments within each sub
for i := 0; i < len(sub); i++ {
// Fresh variable-blinding secrets for each pre-commitment
if e := sub[i].commit(prf, wi[i], nil); e != nil {
return e
}
}
return nil
}
func (op *orPred) respond(prf *proof, c kyber.Scalar, pr []kyber.Scalar) error {
sub := []Predicate(*op)
pp := prf.pp[op]
if pr != nil {
return errors.New("OR predicates can't be nested in anything else")
}
ci := pp.wi
if pp.w == nil {
// Calculate the challenge for the proof-obligated subtree
cs := prf.s.Scalar().Set(c)
choice := prf.choice[op]
for i := 0; i < len(sub); i++ {
if i != choice {
cs.Sub(cs, ci[i])
}
}
ci[choice] = cs
}
// If there's more than one choice, send all our sub-challenges.
if len(sub) > 1 {
if e := prf.pc.Put(ci); e != nil {
return e
}
}
// Recursively compute responses in all subtrees
for i := range sub {
if e := sub[i].respond(prf, ci[i], nil); e != nil {
return e
}
}
return nil
}
// Get from the verifier all the commitments needed for this predicate
func (op *orPred) getCommits(prf *proof, pr []kyber.Scalar) error {
sub := []Predicate(*op)
for i := range sub {
if e := sub[i].getCommits(prf, nil); e != nil {
return e
}
}
return nil
}
func (op *orPred) verify(prf *proof, c kyber.Scalar, pr []kyber.Scalar) error {
sub := []Predicate(*op)
if pr != nil {
return errors.New("OR predicates can't be in anything else")
}
// Get the prover's sub-challenges
nsub := len(sub)
ci := make([]kyber.Scalar, nsub)
if nsub > 1 {
if e := prf.vc.Get(ci); e != nil {
return e
}
// Make sure they add up to the parent's composite challenge
csum := prf.s.Scalar().Zero()
for i := 0; i < nsub; i++ {
csum.Add(csum, ci[i])
}
if !csum.Equal(c) {
return errors.New("invalid proof: bad sub-challenges")
}
} else { // trivial single-sub OR
ci[0] = c
}
// Recursively verify all subs
for i := range sub {
if e := sub[i].verify(prf, ci[i], nil); e != nil {
return e
}
}
return nil
}
func (op *orPred) Prover(suite Suite, secrets map[string]kyber.Scalar,
points map[string]kyber.Point,
choice map[Predicate]int) Prover {
return proof{}.init(suite, op).prover(op, secrets, points, choice)
}
func (op *orPred) Verifier(suite Suite,
points map[string]kyber.Point) Verifier {
return proof{}.init(suite, op).verifier(op, points)
}
/*
type lin struct {
a1,a2,b kyber.Scalar
x1,x2 PriVar
}
*/
// Construct a predicate asserting a linear relationship a1x1+a2x2=b,
// where a1,a2,b are public values and x1,x2 are secrets.
/*
func (p *Prover) Linear(a1,a2,b kyber.Scalar, x1,x2 PriVar) {
return &lin{a1,a2,b,x1,x2}
}
*/
func (prf proof) init(suite Suite, pred Predicate) *proof {
prf.s = suite
// Enumerate all the variables in a consistent order.
// Reserve variable index 0 for convenience.
prf.svar = []string{""}
prf.pvar = []string{""}
prf.sidx = make(map[string]int)
prf.pidx = make(map[string]int)
pred.enumVars(&prf)
prf.nsvars = len(prf.svar)
prf.npvars = len(prf.pvar)
return &prf
}
func (prf *proof) enumScalarVar(name string) {
if prf.sidx[name] == 0 {
prf.sidx[name] = len(prf.svar)
prf.svar = append(prf.svar, name)
}
}
func (prf *proof) enumPointVar(name string) {
if prf.pidx[name] == 0 {
prf.pidx[name] = len(prf.pvar)
prf.pvar = append(prf.pvar, name)
}
}
// Make a response-array if that wasn't already done in a parent predicate.
func (prf *proof) makeScalars(pr []kyber.Scalar) []kyber.Scalar {
if pr == nil {
return make([]kyber.Scalar, prf.nsvars)
}
return pr
}
// Transmit our response-array if a corresponding makeScalars() created it.
func (prf *proof) sendResponses(pr []kyber.Scalar, r []kyber.Scalar) error {
if pr == nil {
for i := range r {
// Send responses only for variables
// that were used in this OR-domain.
if r[i] != nil {
if e := prf.pc.Put(r[i]); e != nil {
return e
}
}
}
}
return nil
}
// In the verifier, get the responses at the top of an OR-domain,
// if a corresponding makeScalars() call created it.
func (prf *proof) getResponses(pr []kyber.Scalar, r []kyber.Scalar) error {
if pr == nil {
for i := range r {
if r[i] != nil {
if e := prf.vc.Get(r[i]); e != nil {
return e
}
}
}
}
return nil
}
func (prf *proof) prove(p Predicate, sval map[string]kyber.Scalar,
pval map[string]kyber.Point,
choice map[Predicate]int, pc ProverContext) error {
prf.pc = pc
prf.sval = sval
prf.pval = pval
prf.choice = choice
prf.pp = make(map[Predicate]*proverPred)
// Generate all commitments
if e := p.commit(prf, nil, nil); e != nil {
return e
}
// Generate top-level challenge from public randomness
c := prf.s.Scalar()
if e := pc.PubRand(c); e != nil {
return e
}
// Generate all responses based on master challenge
return p.respond(prf, c, nil)
}
func (prf *proof) verify(p Predicate, pval map[string]kyber.Point,
vc VerifierContext) error {
prf.vc = vc
prf.pval = pval
prf.vp = make(map[Predicate]*verifierPred)
// Get the commitments from the verifier,
// and calculate the sets of responses we'll need for each OR-domain.
if e := p.getCommits(prf, nil); e != nil {
return e
}
// Produce the top-level challenge
c := prf.s.Scalar()
if e := vc.PubRand(c); e != nil {
return e
}
// Check all the responses and sub-challenges against the commitments.
return p.verify(prf, c, nil)
}
// Produce a higher-order Prover embodying a given proof predicate.
func (prf *proof) prover(p Predicate, sval map[string]kyber.Scalar,
pval map[string]kyber.Point,
choice map[Predicate]int) Prover {
return Prover(func(ctx ProverContext) error {
return prf.prove(p, sval, pval, choice, ctx)
})
}
// Produce a higher-order Verifier embodying a given proof predicate.
func (prf *proof) verifier(p Predicate, pval map[string]kyber.Point) Verifier {
return Verifier(func(ctx VerifierContext) error {
return prf.verify(p, pval, ctx)
})
}