Documentation
¶
Index ¶
- Constants
- func DecryptAESGCM(key, ciphertext []byte) ([]byte, error)
- func EncryptAESGCM(key, plaintext []byte) ([]byte, error)
- func FirstStepAlice(secretMessage string, r *secp256k1.PrivateKey) (*secp256k1.PublicKey, *secp256k1.PrivateKey)
- func GetKeySetPublicKeys(keySet *KeySet) map[uint64]string
- func HashToCurve(secretMessage []byte) *secp256k1.PublicKey
- func LegacyHashToCurve(secretMessage []byte) *secp256k1.PublicKey
- func SecondStepBob(B_ secp256k1.PublicKey, a secp256k1.PrivateKey) *secp256k1.PublicKey
- func ThirdStepAlice(c_ secp256k1.PublicKey, r secp256k1.PrivateKey, A secp256k1.PublicKey) *secp256k1.PublicKey
- func Verify(a secp256k1.PrivateKey, c secp256k1.PublicKey, secretMessage string, ...) bool
- type KeySet
- type PrivateKey
- type PrivateKeyList
- type PublicKey
- type PublicKeyList
Constants ¶
const MaxOrder = 64
Variables ¶
This section is empty.
Functions ¶
func DecryptAESGCM ¶ added in v0.1.9
DecryptAESGCM decrypts the ciphertext using AES-GCM with the provided key. The function expects the input ciphertext to include the nonce. It returns the decrypted plaintext or an error if the decryption fails. AES-GCM provides both confidentiality and integrity.
func EncryptAESGCM ¶ added in v0.1.9
EncryptAESGCM encrypts the plaintext using AES-GCM with the provided key. The function returns the ciphertext, which includes the nonce. The nonce is randomly generated for each encryption and is used for ensuring uniqueness. AES-GCM provides both confidentiality and integrity.
func FirstStepAlice ¶
func FirstStepAlice(secretMessage string, r *secp256k1.PrivateKey) (*secp256k1.PublicKey, *secp256k1.PrivateKey)
FirstStepAlice creates blinded secrets and produces outputs
func GetKeySetPublicKeys ¶ added in v0.1.7
GetKeySetPublicKeys will return current public keys for all amounts
func HashToCurve ¶
func HashToCurve(secretMessage []byte) *secp256k1.PublicKey
HashToCurve will generate a public key on the curve.
func LegacyHashToCurve ¶
func LegacyHashToCurve(secretMessage []byte) *secp256k1.PublicKey
backwards compatibility with old hash_to_curve < 0.3.3 LegacyHashToCurve will generate a public key on the curve.
func SecondStepBob ¶
func SecondStepBob(B_ secp256k1.PublicKey, a secp256k1.PrivateKey) *secp256k1.PublicKey
SecondStepBob signs blinded secrets and produces promises
func ThirdStepAlice ¶
func ThirdStepAlice(c_ secp256k1.PublicKey, r secp256k1.PrivateKey, A secp256k1.PublicKey) *secp256k1.PublicKey
ThirdStepAlice Alice unbinds blinded signatures and produces proofs
func Verify ¶
func Verify(a secp256k1.PrivateKey, c secp256k1.PublicKey, secretMessage string, curveFunc func(msg []byte) *secp256k1.PublicKey) bool
Verify that secret was signed by bob. curveFunc should be legacyHashToCurve for client version < 0.3.3 this could be removed and replaced with static invocation of hashToCurve
Types ¶
type KeySet ¶
type KeySet struct { Id string `gorm:"primaryKey"` DerivationPath string PublicKeys PublicKeyList `gorm:"-"` PrivateKeys PrivateKeyList `gorm:"-"` MintUrl string ValidFrom time.Time ValidTo time.Time FirstSeen time.Time Active bool }
func (*KeySet) DeriveKeySetId ¶
func (k *KeySet) DeriveKeySetId()
func (*KeySet) DeriveKeys ¶
func (*KeySet) DerivePublicKeys ¶
func (k *KeySet) DerivePublicKeys()
func (*KeySet) SetPublicKeyList ¶ added in v0.1.7
type PrivateKey ¶
type PrivateKey struct { Amount uint64 Key *secp256k1.PrivateKey }
type PrivateKeyList ¶
type PrivateKeyList []PrivateKey
func (PrivateKeyList) GetKeyByAmount ¶
func (s PrivateKeyList) GetKeyByAmount(amount uint64) *PrivateKey
func (PrivateKeyList) Len ¶
func (p PrivateKeyList) Len() int
func (PrivateKeyList) Less ¶
func (p PrivateKeyList) Less(i, j int) bool
func (PrivateKeyList) Swap ¶
func (p PrivateKeyList) Swap(i, j int)
type PublicKeyList ¶
type PublicKeyList []PublicKey
func (PublicKeyList) GetKeyByAmount ¶
func (s PublicKeyList) GetKeyByAmount(amount uint64) *PublicKey
func (PublicKeyList) Len ¶
func (s PublicKeyList) Len() int
func (PublicKeyList) Less ¶
func (s PublicKeyList) Less(i, j int) bool
func (PublicKeyList) Swap ¶
func (s PublicKeyList) Swap(i, j int)