ok-john / fiat-shamir-heuristic

Go implementation of non-interactive proofs of knowledge using the fiat-shamir heuristic.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

fiat-shamir-heuristic

Go implementation of non-interactive proofs of knowledge using the fiat-shamir heuristic.

Install

go get github.com/ok-john/fiat-shamir-heuristic

Usage

package main

import (
	"math/big"

	fsh "github.com/ok-john/fiat-shamir-heuristic"
)

func main() {

	// the value you are generating a non-interactive proof of knowledge of.
	message := (&big.Int{}).SetBytes([]byte("you look beautiful today."))

	// the order of the underlying cyclic group.
	order := fsh.Secp256k1Order()

	// Generates the proof.
	proof, err := fsh.Proove(message, order)
	if err != nil {
		panic(err)
	}

	// Verifies the proof.
	if !proof.Verify() {
		panic("failed to verify proof")
	}
}

About

Go implementation of non-interactive proofs of knowledge using the fiat-shamir heuristic.

License:MIT License


Languages

Language:Go 100.0%