From b7506971044827889162bdaca6b0f1d49af9724b Mon Sep 17 00:00:00 2001 From: Marcin Kostrzewa Date: Mon, 25 Sep 2023 18:47:42 +0200 Subject: [PATCH] add a command to extract a vk --- main.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/main.go b/main.go index 0c74aed..c55944b 100644 --- a/main.go +++ b/main.go @@ -132,6 +132,30 @@ func main() { return ps.ExportSolidity(output) }, }, + { + Name: "export-vk", + Flags: []cli.Flag{ + &cli.StringFlag{Name: "keys-file", Usage: "proving system file", Required: true}, + &cli.StringFlag{Name: "output", Usage: "output file", Required: true}, + }, + Action: func(context *cli.Context) error { + keys := context.String("keys-file") + ps, err := prover.ReadSystemFromFile(keys) + if err != nil { + return err + } + outPath := context.String("output") + + file, err := os.Create(outPath) + defer file.Close() + if err != nil { + return err + } + output := file + _, err = ps.VerifyingKey.WriteTo(output) + return err + }, + }, { Name: "gen-test-params", Flags: []cli.Flag{