Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // PublicKeySize is the size in bytes of the public key. PublicKeySize int = C.CRYPTO_PUBLICKEYBYTES // PrivateKeySize is the size in bytes of the private key. PrivateKeySize int = C.CRYPTO_SECRETKEYBYTES // SignatureSize is the size in bytes of the signature. SignatureSize int = C.CRYPTO_BYTES // ErrPublicKeySize indicates the raw data is not the correct size for a public key. ErrPublicKeySize error = fmt.Errorf("%s: raw public key data size is wrong", Name()) // ErrPrivateKeySize indicates the raw data is not the correct size for a private key. ErrPrivateKeySize error = fmt.Errorf("%s: raw private key data size is wrong", Name()) )
Functions ¶
func Name ¶
func Name() string
Name returns the string naming of the current Sphincs+ that this binding is being used with.
func NewKeypair ¶
func NewKeypair() (*PrivateKey, *PublicKey)
NewKeypair generates a new Sphincs+ keypair.
Types ¶
type PrivateKey ¶
type PrivateKey struct {
// contains filtered or unexported fields
}
PrivateKey is a private Sphincs+ key.
func (*PrivateKey) Bytes ¶
func (p *PrivateKey) Bytes() []byte
Bytes returns the PrivateKey as a byte slice.
func (*PrivateKey) FromBytes ¶
func (p *PrivateKey) FromBytes(data []byte) error
FromBytes loads a PrivateKey from the given byte slice.
func (*PrivateKey) Sign ¶
func (p *PrivateKey) Sign(message []byte) []byte
Sign signs the given message and returns the signature.
Click to show internal directories.
Click to hide internal directories.