aboutsummaryrefslogtreecommitdiff
path: root/nizk/stage2/stage2.go
diff options
context:
space:
mode:
authorÖzgür Kesim <oec@kesim.org>2024-11-10 16:27:10 +0100
committerÖzgür Kesim <oec@kesim.org>2024-11-10 16:27:10 +0100
commit9f43ed15415f5063f2d7b2e14f407875ac7bc660 (patch)
tree0c94dc1bbafb45167f79c95617dc263ba4c1e561 /nizk/stage2/stage2.go
parent6c572f6037137c677c2c8c5143723a777a8747c5 (diff)
add simpler API to nizk stages
Diffstat (limited to 'nizk/stage2/stage2.go')
-rw-r--r--nizk/stage2/stage2.go11
1 files changed, 10 insertions, 1 deletions
diff --git a/nizk/stage2/stage2.go b/nizk/stage2/stage2.go
index a17000f..88bfa59 100644
--- a/nizk/stage2/stage2.go
+++ b/nizk/stage2/stage2.go
@@ -47,7 +47,16 @@ type Commitment struct {
Z_ *Point
}
-func NewStatement(typ Type, a, b, r, x, y, r_, x_, y_ *Scalar) *Statement {
+func NewStatement(typ Type) *Statement {
+ var s [8]*Scalar
+ for i := range s {
+ s[i] = Curve.RandomScalar()
+ }
+
+ return NewStatementFromScalars(typ, s[0], s[1], s[2], s[3], s[4], s[5], s[6], s[7])
+}
+
+func NewStatementFromScalars(typ Type, a, b, r, x, y, r_, x_, y_ *Scalar) *Statement {
if typ > Set || typ < None {
panic("unknown type")
}