Documentation ¶
Index ¶
- Constants
- Variables
- func GenerateKey() (publicKey []byte, secretKey []byte, err error)
- func Sign(secretKey []byte, message []byte) ([]byte, error)
- func Verify(message []byte, signature []byte, publicKey []byte) error
- type MockSig
- func (s MockSig) CombinePublicKeySignature(sigBytes []byte, pubKeyBytes []byte) (combinedSignature []byte, err error)
- func (s MockSig) DecodePublicKey(encoded []byte) (*signaturealgorithm.PublicKey, error)
- func (s MockSig) DeserializePrivateKey(priv []byte) (*signaturealgorithm.PrivateKey, error)
- func (s MockSig) DeserializePublicKey(pub []byte) (*signaturealgorithm.PublicKey, error)
- func (s MockSig) EncodePublicKey(pubKey *signaturealgorithm.PublicKey) []byte
- func (s MockSig) GenerateKey() (*signaturealgorithm.PrivateKey, error)
- func (s MockSig) HexToPrivateKey(hexkey string) (*signaturealgorithm.PrivateKey, error)
- func (s MockSig) HexToPrivateKeyNoError(hexkey string) *signaturealgorithm.PrivateKey
- func (s MockSig) HexToPublicKey(hexkey string) (*signaturealgorithm.PublicKey, error)
- func (s MockSig) LoadPrivateKeyFromFile(file string) (*signaturealgorithm.PrivateKey, error)
- func (s MockSig) PrivateKeyLength() int
- func (s MockSig) PrivateKeyToHex(priv *signaturealgorithm.PrivateKey) (string, error)
- func (s MockSig) PublicKeyAndSignatureFromCombinedSignature(digestHash []byte, sig []byte) (signature []byte, pubKey []byte, err error)
- func (s MockSig) PublicKeyBytesFromSignature(digestHash []byte, sig []byte) ([]byte, error)
- func (s MockSig) PublicKeyFromSignature(digestHash []byte, sig []byte) (*signaturealgorithm.PublicKey, error)
- func (s MockSig) PublicKeyLength() int
- func (s MockSig) PublicKeyStartValue() byte
- func (s MockSig) PublicKeyToAddress(p *signaturealgorithm.PublicKey) (common.Address, error)
- func (s MockSig) PublicKeyToAddressNoError(p *signaturealgorithm.PublicKey) common.Address
- func (s MockSig) PublicKeyToHex(pub *signaturealgorithm.PublicKey) (string, error)
- func (s MockSig) SavePrivateKeyToFile(file string, key *signaturealgorithm.PrivateKey) error
- func (s MockSig) SerializePrivateKey(priv *signaturealgorithm.PrivateKey) ([]byte, error)
- func (s MockSig) SerializePublicKey(pub *signaturealgorithm.PublicKey) ([]byte, error)
- func (s MockSig) Sign(digestHash []byte, prv *signaturealgorithm.PrivateKey) (sig []byte, err error)
- func (s MockSig) SignatureLength() int
- func (s MockSig) SignatureName() string
- func (s MockSig) SignatureStartValue() byte
- func (s MockSig) SignatureWithPublicKeyLength() int
- func (osig MockSig) ValidateSignatureValues(v byte, r, s *big.Int, homestead bool) bool
- func (s MockSig) Verify(pubKey []byte, digestHash []byte, signature []byte) bool
- func (s MockSig) Zeroize(prv *signaturealgorithm.PrivateKey)
Constants ¶
View Source
const ( OK = 0 CRYPTO_SECRETKEY_BYTES = 64 + 1281 + 897 CRYPTO_PUBLICKEY_BYTES = 32 + 897 CRYPTO_SIGNATURE_BYTES = 64 + 1281 + 897 //Nonce + 2 for size CRYPTO_MESSAGE_LEN = 32 //todo: validate this SIG_NAME = "Falcon-512-ed25519" )
Variables ¶
View Source
var ( ErrSignatureInitial = errors.New("signature mechanism is not supported by OQS") ErrInvalidMsgLen = errors.New("invalid message length, need max 64 bytes") ErrInvalidSignatureLen = errors.New("invalid signature length") ErrInvalidPublicKeyLen = errors.New("invalid public key length") ErrInvalidPrivateKeyLen = errors.New("invalid private key length") ErrInvalidRecoveryID = errors.New("invalid signature recovery id") ErrInvalidKey = errors.New("invalid private key") ErrInvalidPubkey = errors.New("invalid public key") ErrMismatchPublicKey = errors.New("mismatch public key") ErrSignFailed = errors.New("signing failed") ErrRecoverFailed = errors.New("recovery failed") ErrKeypairFailed = errors.New("can not generate keypair") ErrInvalidLen = errors.New("invalid length") ErrVerifyFailed = errors.New("verify length") ErrRecoverPublicKeyFailed = errors.New("recover public key length") )
Functions ¶
func GenerateKey ¶
Types ¶
type MockSig ¶
type MockSig struct {
// contains filtered or unexported fields
}
func CreateMockSig ¶
func CreateMockSig() MockSig
func (MockSig) CombinePublicKeySignature ¶
func (MockSig) DecodePublicKey ¶
func (s MockSig) DecodePublicKey(encoded []byte) (*signaturealgorithm.PublicKey, error)
func (MockSig) DeserializePrivateKey ¶
func (s MockSig) DeserializePrivateKey(priv []byte) (*signaturealgorithm.PrivateKey, error)
func (MockSig) DeserializePublicKey ¶
func (s MockSig) DeserializePublicKey(pub []byte) (*signaturealgorithm.PublicKey, error)
func (MockSig) EncodePublicKey ¶
func (s MockSig) EncodePublicKey(pubKey *signaturealgorithm.PublicKey) []byte
func (MockSig) GenerateKey ¶
func (s MockSig) GenerateKey() (*signaturealgorithm.PrivateKey, error)
func (MockSig) HexToPrivateKey ¶
func (s MockSig) HexToPrivateKey(hexkey string) (*signaturealgorithm.PrivateKey, error)
func (MockSig) HexToPrivateKeyNoError ¶
func (s MockSig) HexToPrivateKeyNoError(hexkey string) *signaturealgorithm.PrivateKey
func (MockSig) HexToPublicKey ¶
func (s MockSig) HexToPublicKey(hexkey string) (*signaturealgorithm.PublicKey, error)
func (MockSig) LoadPrivateKeyFromFile ¶
func (s MockSig) LoadPrivateKeyFromFile(file string) (*signaturealgorithm.PrivateKey, error)
func (MockSig) PrivateKeyLength ¶
func (MockSig) PrivateKeyToHex ¶
func (s MockSig) PrivateKeyToHex(priv *signaturealgorithm.PrivateKey) (string, error)
func (MockSig) PublicKeyAndSignatureFromCombinedSignature ¶
func (MockSig) PublicKeyBytesFromSignature ¶
func (MockSig) PublicKeyFromSignature ¶
func (MockSig) PublicKeyLength ¶
func (MockSig) PublicKeyStartValue ¶
func (MockSig) PublicKeyToAddress ¶
func (MockSig) PublicKeyToAddressNoError ¶
func (s MockSig) PublicKeyToAddressNoError(p *signaturealgorithm.PublicKey) common.Address
func (MockSig) PublicKeyToHex ¶
func (s MockSig) PublicKeyToHex(pub *signaturealgorithm.PublicKey) (string, error)
func (MockSig) SavePrivateKeyToFile ¶
func (s MockSig) SavePrivateKeyToFile(file string, key *signaturealgorithm.PrivateKey) error
func (MockSig) SerializePrivateKey ¶
func (s MockSig) SerializePrivateKey(priv *signaturealgorithm.PrivateKey) ([]byte, error)
func (MockSig) SerializePublicKey ¶
func (s MockSig) SerializePublicKey(pub *signaturealgorithm.PublicKey) ([]byte, error)
func (MockSig) Sign ¶
func (s MockSig) Sign(digestHash []byte, prv *signaturealgorithm.PrivateKey) (sig []byte, err error)
func (MockSig) SignatureLength ¶
func (MockSig) SignatureName ¶
func (MockSig) SignatureStartValue ¶
func (MockSig) SignatureWithPublicKeyLength ¶
func (MockSig) ValidateSignatureValues ¶
ValidateSignatureValues verifies whether the signature values are valid with the given chain rules. The v value is assumed to be either 0 or 1.
func (MockSig) Zeroize ¶
func (s MockSig) Zeroize(prv *signaturealgorithm.PrivateKey)
Click to show internal directories.
Click to hide internal directories.