Documentation ¶
Index ¶
- Constants
- func MakeMAC(key []byte, encryptedPayload []byte) []byte
- func NewRecipientID(pubKey *cyclic.Int, unencryptedPayload []byte) *id.ID
- func NewRequestFingerprint(pubKey *cyclic.Int) format.Fingerprint
- func NewRequestKey(dhKey *cyclic.Int) []byte
- func NewRequestPartFingerprint(dhKey *cyclic.Int, keyNum uint64) format.Fingerprint
- func NewRequestPartKey(dhKey *cyclic.Int, keyNum uint64) []byte
- func NewResponseFingerprint(dhKey *cyclic.Int, keyNum uint64) format.Fingerprint
- func NewResponseKey(dhKey *cyclic.Int, keyNum uint64) []byte
- func VerifyMAC(key []byte, encryptedPayload, receivedMAC []byte) bool
- type TagFP
Constants ¶
const TagFpSize = 16
TagFpSize is the size of the TagFP type.
Variables ¶
This section is empty.
Functions ¶
func NewRecipientID ¶
NewRecipientID generates the recipient ID for a single-use sender. The ID is generated from the hash of the unencrypted request payload. The unencryptedPayload must contain a nonce to prevent collision on the same message being sent multiple times.
func NewRequestFingerprint ¶
func NewRequestFingerprint(pubKey *cyclic.Int) format.Fingerprint
NewRequestFingerprint generates the fingerprint used for the request message.
func NewRequestKey ¶
NewRequestKey generates the key used for the request message.
func NewRequestPartFingerprint ¶
func NewRequestPartFingerprint(dhKey *cyclic.Int, keyNum uint64) format.Fingerprint
NewRequestPartFingerprint generates the fingerprint for the request message for the given key number.
func NewRequestPartKey ¶
NewRequestPartKey generates the key for the request message that corresponds with the given key number.
func NewResponseFingerprint ¶
func NewResponseFingerprint(dhKey *cyclic.Int, keyNum uint64) format.Fingerprint
NewResponseFingerprint generates the fingerprint for the response message for the given key number.
func NewResponseKey ¶
NewResponseKey generates the key for the response message that corresponds with the given key number.
Types ¶
type TagFP ¶
TagFP uniquely identifies the module that the request message belongs to.
func NewTagFP ¶
NewTagFP generates a new tag fingerprint with the given tag. The tag can be anything, but should be long enough so that it is unique.
func UnmarshalTagFP ¶
UnmarshalTagFP generates a new TagFP from the specified bytes.