utils

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2024 License: MIT Imports: 8 Imported by: 3

README

fp256bn-amcl-utils

Documentation

Index

Constants

View Source
const SEED_SIZE = 100

*

  • Random seed size

Variables

This section is empty.

Functions

func BigToBytes

func BigToBytes(big *FP256BN.BIG) []byte

func DiffHash added in v0.0.2

func DiffHash(a Hash, b Hash) error

func Ecp2ToBytes

func Ecp2ToBytes(ecp2 *FP256BN.ECP2) []byte

func EcpToBytes

func EcpToBytes(ecp *FP256BN.ECP) []byte

func G1

func G1() *FP256BN.ECP

func G2

func G2() *FP256BN.ECP2

func InitRandom

func InitRandom() *core.RAND

*

  • Initialize random.

func P

func P() *FP256BN.BIG

*

  • The order of this curve. *
  • The big numbers used in this library,
  • all values are taken reminder of this p.

func RandomBig

func RandomBig(rng *core.RAND) *FP256BN.BIG

func RandomBytes

func RandomBytes(rng *core.RAND, size int) []byte

func RandomECP

func RandomECP(rng *core.RAND) *FP256BN.ECP

Types

type Hash added in v0.0.2

type Hash struct {
	B [][]byte
}

func NewHash added in v0.0.2

func NewHash() Hash

func (*Hash) HashToECP added in v0.0.2

func (baseHash *Hash) HashToECP() (*FP256BN.ECP, uint32, error)

func (*Hash) SumToBIG added in v0.0.2

func (h *Hash) SumToBIG() *FP256BN.BIG

func (*Hash) SumToBytes added in v0.0.2

func (h *Hash) SumToBytes() []byte

func (*Hash) WriteBIG added in v0.0.2

func (h *Hash) WriteBIG(n ...*FP256BN.BIG)

func (*Hash) WriteBytes added in v0.0.2

func (h *Hash) WriteBytes(n ...[]byte)

func (*Hash) WriteECP added in v0.0.2

func (h *Hash) WriteECP(n ...*FP256BN.ECP)

func (*Hash) WriteECP2 added in v0.0.2

func (h *Hash) WriteECP2(n ...*FP256BN.ECP2)

Jump to

Keyboard shortcuts

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