Documentation ¶
Overview ¶
Package block provides routines for manipulating End to End blocks.
Index ¶
Constants ¶
View Source
const (
// MessageIDLength is the length of a message ID in bytes.
MessageIDLength = 16
)
Variables ¶
View Source
var ( // BlockCiphertextLength is the length of a BlockCiphertext in bytes. BlockCiphertextLength = constants.UserForwardPayloadLength // BlockPayloadLength is the maximum user payload length in a Block. BlockPayloadLength = BlockCiphertextLength - (blockCiphertextOverhead + blockOverhead) )
Functions ¶
func EncryptMessage ¶
func EncryptMessage(msgID *[MessageIDLength]byte, msg []byte, sender *ecdh.PrivateKey, recipient *ecdh.PublicKey) ([][]byte, error)
EncryptMessage encrypts a message after fragmenting it into blocks, and returns a vector of byte serialized ciphertexts.
Types ¶
type Block ¶
type Block struct { MessageID [MessageIDLength]byte TotalBlocks uint16 BlockID uint16 BlockLength uint32 Payload []byte }
Block is a Katzenpost end to end Block (plaintext).
func DecryptBlock ¶
DecryptBlock authenticates and decrypts a encrypted Block, and returns the Block and sender's static PublicKey.
Click to show internal directories.
Click to hide internal directories.