Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Blake224Hash ¶
*
Blake224Hash computes the Blake2b-224 hash of the provided byte slice. Params: b ([]byte): The input byte slice to hash. len (int): The length of the hash. Returns: ([]byte, error): The computed hash and an error if computation fails, nil otherwise.
func Sign ¶
*
Sign function signs a message using the provided key and returns the signature. Params: message ([]byte): The message to sign. sk ([]byte): The signing key, which can be either an extended or an ed25519 private key. Returns: []byte: The signature of the message. error: An error if the signing fails.
Types ¶
type PaymentKeyPair ¶
type PaymentKeyPair struct { VerificationKey VerificationKey SigningKey SigningKey }
func PaymentKeyPairGenerate ¶
func PaymentKeyPairGenerate() (*PaymentKeyPair, error)
*
PaymentKeyPairGenerate generates a PaymentKey pair with a randomly generated key pair. Returns: PaymentKeyPair: A newly generated PaymentKeyPair. error: An error if the payment fails.
type PaymentSigningKey ¶
type PaymentSigningKey SigningKey
type PaymentVerificationKey ¶
type PaymentVerificationKey VerificationKey
type SigningKey ¶
type SigningKey struct {
Payload []byte
}
type StakeSigningKey ¶
type StakeSigningKey SigningKey
type StakeVerificationKey ¶
type StakeVerificationKey VerificationKey
type VerificationKey ¶
type VerificationKey struct {
Payload []byte
}
func VerificationKeyFromCbor ¶
func VerificationKeyFromCbor(cbor_string string) (*VerificationKey, error)
*
VerificationKeyFromCbor creates a VerificationKey instance from a CBOR-encoded string. Params: cbor_string (string): The CBOR-encoded string. Returns: (*VerificationKey, error): A VerificationKey instance and an error if decoding or unmarshaling fails, nil otherwise.
func (VerificationKey) Hash ¶
func (vk VerificationKey) Hash() (serialization.PubKeyHash, error)
*
Hash computes the has of the VerificationKey and returns it as public key. Returns: (serialization.PubKeyHash, error): The computed hash and an error if computation fails, nil otherwise.
func (*VerificationKey) MarshalCBOR ¶
func (vk *VerificationKey) MarshalCBOR() ([]byte, error)
*
MarshalCBOR marshals the VerificationKey instance into CBOR data. Returns: ([]byte, error): The CBOR-encoded data and error if marshaling fails, nil otherwise.
func (*VerificationKey) UnmarshalCBOR ¶
func (vk *VerificationKey) UnmarshalCBOR(data []byte) error
*
UnmarshalCBOR function unmarshals data into a VerificationKey instance. Params: data ([]byte): The CBOR data to unmarshal. Returns: error: An error if unmarshaling fails, nil otherwise.
Click to show internal directories.
Click to hide internal directories.