Versions in this module Expand all Collapse all v0 v0.0.4 Jul 11, 2022 v0.0.3 Mar 26, 2022 Changes in this version + const NonceMaxLength + const NonceMinLength + const OTPMaxLength + const OTPMinLength + const PublicIDMaxLength + const TokenLength + var ErrStorageDecryptFail = errors.New("otp request decryption failed") + var ErrStorageKeyInactive = errors.New("client key is not active") + var ErrStorageNoKey = errors.New("client key not found") + var TestVectors = map[string]TestVector + func Serve(handler fasthttp.RequestHandler, req *http.Request) (*http.Response, error) + func SignMap(m []string, apiKey []byte) []byte + func SignMapToBase64(m []string, apiKey []byte) string + type OTP struct + CRC uint16 + PrivateID [6]byte + Random uint16 + SessionCounter uint8 + TimestampCounter [3]byte + UsageCounter uint16 + func (o *OTP) Decrypt(key []byte, payload []byte) error + func (o *OTP) Encrypt(key []byte) ([]byte, error) + func (o *OTP) EncryptToModhex(key []byte) (string, error) + func (o *OTP) MarshalBinary() (data []byte, err error) + func (o *OTP) String() string + func (o *OTP) UnmarshalBinary(data []byte) error + type OTPUser struct + SessionCounter uint8 + Timestamp [3]byte + UsageCounter uint16 + type OTPUsers map[string]*OTPUser + type StorageInterface interface + DecryptOTP func(publicID, token string) (*OTP, error) + type TestVector struct + AESKey []byte