crypto

package
v0.0.0-...-1153de6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 26, 2023 License: MPL-2.0 Imports: 11 Imported by: 5

Documentation

Index

Constants

View Source
const PairingTokenSalt = "Keycard Pairing Password Salt"

Variables

View Source
var ErrInvalidCardCryptogram = errors.New("invalid card cryptogram")

Functions

func CalculateMac

func CalculateMac(meta []byte, data []byte, macKey []byte) ([]byte, error)

func DecryptData

func DecryptData(data []byte, encKey []byte, iv []byte) ([]byte, error)

func DeriveSessionKeys

func DeriveSessionKeys(secret, pairingKey, cardData []byte) ([]byte, []byte, []byte)

func EncryptData

func EncryptData(data []byte, encKey []byte, iv []byte) ([]byte, error)

func GenerateECDHSharedSecret

func GenerateECDHSharedSecret(priv *ecdsa.PrivateKey, pub *ecdsa.PublicKey) []byte

func OneShotEncrypt

func OneShotEncrypt(pubKeyData, secret, data []byte) ([]byte, error)

func VerifyCryptogram

func VerifyCryptogram(challenge []byte, pairingPass string, cardCryptogram []byte) ([]byte, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL