Documentation
¶
Index ¶
- func AuthClaimFromPubKey(X, Y *big.Int) (*core.Claim, error)
- func AuthClaimFullInfo(ctx context.Context, privKeyHex string, challenge *big.Int) (*core.ID, *core.Claim, *merkletree.Hash, *merkletree.MerkleTree, ...)
- func AuthV2ClaimFromPubKey(X, Y *big.Int) (*core.Claim, error)
- func CalcStateFromRoots(claimsTree *merkletree.MerkleTree, optTrees ...*merkletree.MerkleTree) (*merkletree.Hash, error)
- func CoreSchemaFromStr(t testing.TB, schemaIntStr string) core.SchemaHash
- func DefaultUserClaim(t testing.TB, subject core.ID) *core.Claim
- func ExtractPubXY(privKHex string) (key *babyjub.PrivateKey, x, y *big.Int)
- func GISTTree(ctx context.Context) *merkletree.MerkleTree
- func Generate(ctx context.Context, privKHex string) (*core.ID, *merkletree.MerkleTree, *merkletree.MerkleTree, ...)
- func HashToStr(siblings []*merkletree.Hash) []string
- func IDFromState(state *big.Int) (*core.ID, error)
- func IDFromStr(t testing.TB, idStr string) *core.ID
- func MTHashFromStr(t testing.TB, hashStr string) *merkletree.Hash
- func PrepareIntArray(arr []*big.Int, length int) []*big.Int
- func PrepareSiblingsStr(siblings []*merkletree.Hash, levels int) []string
- func PrepareStrArray(siblings []string, levels int) []string
- func SignBBJJ(key *babyjub.PrivateKey, sigInput []byte) (*babyjub.Signature, error)
- func SignPoseidon(pk *babyjub.PrivateKey, data []byte) ([]byte, error)
- func TestData(t *testing.T, fileName string, data string, generate bool) string
- func UserStateCommitmentClaim(t testing.TB, secret *big.Int) *core.Claim
- type IdentityTest
- func (it *IdentityTest) AddClaim(t testing.TB, claim *core.Claim)
- func (it *IdentityTest) ClaimMTPRaw(t testing.TB, claim *core.Claim) (proof *merkletree.Proof, value *big.Int)
- func (it *IdentityTest) ClaimRevMTP(claim *core.Claim) (sibling []string, nodeAux *NodeAuxValue, err error)
- func (it *IdentityTest) ClaimRevMTPRaw(t testing.TB, claim *core.Claim) (proof *merkletree.Proof, value *big.Int)
- func (it *IdentityTest) SignBBJJ(challenge []byte) (*babyjub.Signature, error)
- func (it *IdentityTest) SignClaim(t testing.TB, claim *core.Claim) *babyjub.Signature
- func (it *IdentityTest) SignClaimBBJJ(claim *core.Claim) (*babyjub.Signature, error)
- func (it *IdentityTest) State(t testing.TB) *merkletree.Hash
- type NodeAuxValue
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthClaimFullInfo ¶
func AuthClaimFullInfo(ctx context.Context, privKeyHex string, challenge *big.Int) (*core.ID, *core.Claim, *merkletree.Hash, *merkletree.MerkleTree, *merkletree.MerkleTree, *merkletree.MerkleTree, *merkletree.Proof, *merkletree.Proof, *babyjub.Signature, error)
This method is to generate auth claim, identity, all its trees, state and sign a challenge with the claim private key.
func CalcStateFromRoots ¶
func CalcStateFromRoots(claimsTree *merkletree.MerkleTree, optTrees ...*merkletree.MerkleTree) (*merkletree.Hash, error)
func CoreSchemaFromStr ¶
func CoreSchemaFromStr(t testing.TB, schemaIntStr string) core.SchemaHash
func ExtractPubXY ¶
func ExtractPubXY(privKHex string) (key *babyjub.PrivateKey, x, y *big.Int)
func MTHashFromStr ¶
func PrepareSiblingsStr ¶
func PrepareStrArray ¶
func SignPoseidon ¶
func SignPoseidon(pk *babyjub.PrivateKey, data []byte) ([]byte, error)
SignPoseidon signs prepared data ( value in field Q)
Types ¶
type IdentityTest ¶
type IdentityTest struct { ID core.ID Clt *merkletree.MerkleTree Ret *merkletree.MerkleTree Rot *merkletree.MerkleTree AuthClaim *core.Claim PK *babyjub.PrivateKey }
func NewIdentity ¶
func NewIdentity(t testing.TB, privKHex string) *IdentityTest
func (*IdentityTest) ClaimMTPRaw ¶
func (it *IdentityTest) ClaimMTPRaw(t testing.TB, claim *core.Claim) (proof *merkletree.Proof, value *big.Int)
ClaimMTPRaw returns the merkle proof of a claim
func (*IdentityTest) ClaimRevMTP ¶
func (it *IdentityTest) ClaimRevMTP(claim *core.Claim) (sibling []string, nodeAux *NodeAuxValue, err error)
func (*IdentityTest) ClaimRevMTPRaw ¶
func (*IdentityTest) SignBBJJ ¶
func (it *IdentityTest) SignBBJJ(challenge []byte) (*babyjub.Signature, error)
func (*IdentityTest) SignClaimBBJJ ¶
func (*IdentityTest) State ¶
func (it *IdentityTest) State(t testing.TB) *merkletree.Hash
type NodeAuxValue ¶
type NodeAuxValue struct { Key *merkletree.Hash Value *merkletree.Hash NoAux string }
func PrepareProof ¶
func PrepareProof(proof *merkletree.Proof) ([]string, NodeAuxValue)
Click to show internal directories.
Click to hide internal directories.