go_ec_pederson_commitment

package module
v0.0.0-...-b9e4e3f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 3, 2020 License: MIT Imports: 3 Imported by: 0

README

go-ec-pederson-commitment

This is a Go implementation of the EC-based Pederson commitment scheme

golang 实现的EC pederson-commitment

EC 曲线使用的是 Edwards25519,由 ristretto 包提供,文档参考 https://pkg.go.dev/github.com/bwesterb/go-ristretto?tab=doc ,GitHub库 https://github.com/bwesterb/go-ristretto

另外参考了 https://github.com/threehook/go-pedersen-commitment 的实现,均已star

这里的封装是为了实现我自己的一些需求,同时也分享出来给需要的朋友

pederson-commitment 原论文可见 https://link.springer.com/content/pdf/10.1007%2F3-540-46766-1_9.pdf

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Commit

func Commit(G, H ristretto.Point, secret []byte, r ristretto.Scalar) (commit ristretto.Point)

计算 秘密 的 Pederson 承诺, 返回曲线上的点

func CommitToString

func CommitToString(GString, HString, rString string, secret []byte) (commitString string, err error)

计算 秘密 的 Pederson 承诺, 返回字符串

func Open

func Open(comm, G, H ristretto.Point, secret []byte, r ristretto.Scalar) bool

通过原始参数验证承诺

func OpenByString

func OpenByString(commString, GString, HString, rString string, secret []byte) bool

通过Marshal和hex编码的字符串参数 以及big.Int转字符串得到的 r值 验证承诺

func ParamsGen

func ParamsGen() (G, H ristretto.Point)

生成两个曲线上的点,用于计算承诺

func ParamsGenToString

func ParamsGenToString() (GString, HString string)

func RandomGen

func RandomGen() (r ristretto.Scalar)

生成一个随机阶数

func RandomGenToNumberString

func RandomGenToNumberString() string

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL