Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // TypeBJP0 specifies the BJ-P0 // - first 2 bytes: `00000000 00000000` // - curve of k_op: babyjubjub // - hash function: `Poseidon` with 4+4 elements TypeBJP0 = [2]byte{0x00, 0x00} )
Functions ¶
func CalculateChecksum ¶
CalculateChecksum, returns the checksum for a given type and genesis_root, where checksum: hash( [type | root_genesis ] )
func CheckChecksum ¶
CheckChecksum returns a bool indicating if the ID.Checksum is consistent with the rest of the ID data
func DecomposeID ¶
DecomposeID returns type, genesis and checksum from an ID
func IdenState ¶
func IdenState(clr *merkletree.Hash, rer *merkletree.Hash, ror *merkletree.Hash) *merkletree.Hash
IdenState calculates the Identity State from the Claims Tree Root, Revocation Tree Root and Roots Tree Root.
Types ¶
type ID ¶
type ID [31]byte
ID is a byte array with [ type | root_genesis | checksum ] [2 bytes | 27 bytes | 2 bytes ] where the root_genesis are the first 28 bytes from the hash root_genesis
func IDFromBytes ¶
IDFromBytes returns the ID from a given byte array
func IDFromString ¶
IDFromString returns the ID from a given string
func IdGenesisFromIdenState ¶
func IdGenesisFromIdenState(hash *merkletree.Hash) *ID
IdGenesisFromIdenState calculates the genesis Id from an Identity State.