hashcard

package
v0.0.0-...-da44765 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const ContextsMaxLen = 1024

Variables

This section is empty.

Functions

func DeInitHashCard

func DeInitHashCard(ctx context.Context)

func DeInitRngCard

func DeInitRngCard(ctx context.Context)

func GetHash

func GetHash(ctx context.Context, p, s, buf []byte, len uint64) []byte

hash的长度为16字节

func GetHashHw

func GetHashHw(ctx context.Context, p, s, buf []byte, len uint64) []byte

func GetHashSw

func GetHashSw(ctx context.Context, p, s, buf []byte, len uint64) []byte

func GetP

func GetP(ctx context.Context) []byte

func GetRng

func GetRng(ctx context.Context, rngLlen uint) (outRng []byte, err error)

hash的长度为16字节

func GetRngHw

func GetRngHw(ctx context.Context, rngLlen uint) (outRng []byte, err error)

func GetTxnID

func GetTxnID() primitive.ObjectID

func InitHashCard

func InitHashCard(ctx context.Context)

func InitRngCard

func InitRngCard(ctx context.Context)

func SHA256

func SHA256(data []byte) string

func Xor

func Xor(a, b []byte) ([]byte, error)

Types

type QArgs1to1

type QArgs1to1 struct {
	Potid []byte
	Sotid []byte
	Totid []byte
	Parti []byte
	Sarti []byte
	Tarti []byte
	Psign []byte
	Sab   []byte
	Sac   []byte
	Tab   []byte
	Tac   []byte
	TxnID primitive.ObjectID
}

func NewQArgs1to1

func NewQArgs1to1(ctx context.Context) *QArgs1to1

type QArgs1toN

type QArgs1toN struct {
	Potca []byte
	Sotca []byte
	Totca []byte
	Parti []byte
	Sarti []byte
	Tarti []byte
	TxnID primitive.ObjectID
}

func NewQArgs1toNforSign

func NewQArgs1toNforSign(ctx context.Context) *QArgs1toN

func NewQArgs1toNforVerify

func NewQArgs1toNforVerify(ctx context.Context) *QArgs1toN

Jump to

Keyboard shortcuts

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