Versions in this module Expand all Collapse all v0 v0.0.2 Jun 13, 2023 Changes in this version + const CounterSizeBytes + const NonceSizeBytes + const RandomSizeBytes + const TagSizeBytes + func EncodePublicKey(key *ecdsa.PublicKey) ([]byte, error) + func EncryptPayload(key [TagSizeBytes]byte, plaintext []byte, requestId [8]uint8, ...) (*EncryptedMessage, CryptoStatus) + func GenerateCertificate(key *ecdsa.PrivateKey, validitySeconds uint64) ([]byte, error) + func HKDF(secret []byte, salt []byte, requestId RequestId) []byte + func ParseCertificatePublicKey(der []byte) (*ecdsa.PublicKey, error) + func ParsePublicKey(der []byte) (*ecdsa.PublicKey, error) + type CounterInitializationVector struct + func GenerateCounterInitializationVector() *CounterInitializationVector + type CryptoStatus uint64 + const CryptoStatusError + const CryptoStatusInvalidCounter + const CryptoStatusOk + func DecryptPayload(key [16]byte, message EncryptedMessage, requestId [8]uint8, ...) ([]byte, CryptoStatus) + type ECDHState struct + PrivateKey *ecdh.PrivateKey + PublicKey *ecdh.PublicKey + RemotePublicKey *ecdh.PublicKey + func (e *ECDHState) GenerateKeyPair() + func (e *ECDHState) GetSharedSecret() []byte + func (e *ECDHState) SetRemotePublicKey(pubKey []byte) + type EncryptedMessage struct + AuthenticationTag [TagSizeBytes]byte + EncryptedPayload []byte + InitializationVector [NonceSizeBytes]byte + type RequestId [8]byte