pbc

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Success            = 200
	Error              = 201
	ErrorParam         = 202
	ErrorParamNotFound = 203
)

Variables

View Source
var (
	Key_Ssk          = []byte{55, 32, 220, 181, 208, 19, 253, 239, 98, 230, 99, 252, 121, 44, 39, 145, 251, 44, 7, 84}
	Key_Spk          = []byte{} /* 128 elements not displayed */
	Key_SharedParams = []byte{} /* 359 elements not displayed */
	Key_SharedG      = []byte{} /* 128 elements not displayed */
)

Functions

func GenerateAuthenticator

func GenerateAuthenticator(i int64, s int64, T0 T0, piece []byte, Alpha *pbc.Element, pairing *pbc.Pairing, segmentSize int64) []byte

func Split

func Split(filefullpath string, blocksize, filesize int64) ([][]byte, uint64, error)

Types

type FileTagT

type FileTagT struct {
	T0        `json:"t0"`
	Signature []byte `json:"signature"`
}

type HashNameAndI

type HashNameAndI struct {
	Name string
	I    int64
}

type PBCKeyPair

type PBCKeyPair struct {
	Spk          []byte
	Ssk          []byte
	SharedParams string
	SharedG      []byte
	Alpha        *pbc.Element
	V            *pbc.Element
	G            *pbc.Element
}

func Keygen

func Keygen() PBCKeyPair

type PoDR2Commit

type PoDR2Commit struct {
	FilePath  string `json:"file_path"`
	BlockSize int64  `json:"block_size"`
}

func (PoDR2Commit) PoDR2ProofCommit

func (commit PoDR2Commit) PoDR2ProofCommit(ssk []byte, sharedParams string, segmentSize int64) (<-chan PoDR2CommitResponse, error)

type PoDR2CommitResponse

type PoDR2CommitResponse struct {
	T         FileTagT       `json:"file_tag_t"`
	Sigmas    [][]byte       `json:"sigmas"`
	StatueMsg PoDR2StatueMsg `json:"statue_msg"`
}

type PoDR2Prove

type PoDR2Prove struct {
	QSlice []QElement `json:"q_slice"`
	T      FileTagT   `json:"file_tag_t"`
	Sigmas [][]byte   `json:"sigmas"`
	Matrix [][]byte   `json:"matrix"`
	S      int64      `json:"s"`
}

func (PoDR2Prove) PoDR2ProofProve

func (prove PoDR2Prove) PoDR2ProofProve(spk []byte, sharedParams string, sharedG []byte, segmentSize int64) <-chan PoDR2ProveResponse

type PoDR2ProveResponse

type PoDR2ProveResponse struct {
	Sigma     []byte         `json:"sigmas"`
	MU        [][]byte       `json:"mu"`
	StatueMsg PoDR2StatueMsg `json:"statue_msg"`
}

type PoDR2StatueMsg

type PoDR2StatueMsg struct {
	StatusCode int    `json:"status"`
	Msg        string `json:"msg"`
}

type PoDR2Verify

type PoDR2Verify struct {
	T      FileTagT   `json:"file_tag_t"`
	QSlice []QElement `json:"q_slice"`
	MU     [][]byte   `json:"mu"`
	Sigma  []byte     `json:"sigmas"`
}

func (PoDR2Verify) PoDR2ProofVerify

func (verify PoDR2Verify) PoDR2ProofVerify(SharedG, spk []byte, sharedParams string) bool

type QElement

type QElement struct {
	I int64
	V []byte
}

func PoDR2ChallengeGenerate

func PoDR2ChallengeGenerate(N int64, SharedParams string) []QElement

func PoDR2ChallengeGenerateFromChain

func PoDR2ChallengeGenerateFromChain(blockindex types.Bytes, blockrandom []types.Bytes) ([]QElement, error)

type T0

type T0 struct {
	Name []byte   `json:"name"`
	N    int64    `json:"n"`
	U    [][]byte `json:"u"`
}

type TagInfo

type TagInfo struct {
	T      FileTagT
	Sigmas [][]byte `json:"sigmas"`
}

Jump to

Keyboard shortcuts

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