Documentation ¶
Index ¶
Constants ¶
View Source
const ( // EpochSize length of epoch EpochSize = 4 // MessageOffset offset for the message without overhead MessageOffset = EpochSize + 4 )
Variables ¶
This section is empty.
Functions ¶
func Signature ¶
Signature signature is used in the message encryption to validate signature of the message signature is added to the destination slice
func SignatureToUint32 ¶
SignatureToUint32 returns uint32 for signature
Types ¶
type MAC ¶
type MAC struct {
// contains filtered or unexported fields
}
MAC has the ability to encrypt and decrypt (short) messages as long as they share the same key and the same epoch.
func New ¶
New builds a new MAC using a 256-bit/32 byte encryption key, a numeric epoch and numeric pseudo-random salt
func (*MAC) Decrypt ¶
Decrypt decrypts src and appends to dst, returning the resulting byte slice or an error if the input cannot be authenticated.
Click to show internal directories.
Click to hide internal directories.