Module cgo

Source
Available on crate feature counter-galois-onion only.
Expand description

Implementation for Counter Galois Onion (CGO) relay cell encryption

CGO is an improved approach for encrypting relay cells, with better support for tagging resistance, better forward secrecy, and other improvements. It is described in a paper by Degabriele, Melloni, Münch, and Stam, and specified in proposal 359.

CGO is based on a construction called “UIV+”, which provides the “robust pseudorandom permutation” security definition. Notably, encryption with UIV+ is non-malleable (and hence tagging resistant), whereas decryption with UIV+ is malleable (and hence not tagging resistant).

Modules§

bench_utilsbench
Benchmark utilities for the cgo module.
et 🔒
Define a tweakable block cipher.
prf 🔒
Define a tweakable pseudorandom stream generator.
uiv 🔒
Define the UIV+ tweakable wide-block cipher.

Structs§

ClientInbound
An instance of CGO used for inbound client encryption.
ClientOutbound
An instance of CGO used for outbound client encryption.
CryptState 🔒
State of a single direction of a CGO layer, at the client or at a relay.
CryptStatePair
A set of cryptographic information as shared by the client and a single relay, and
RelayInbound
An instance of CGO used for inbound (towards the client) relay encryption.
RelayOutbound
An instance of CGO used for outbound (away from the client) relay encryption.

Constants§

BLK_LEN 🔒
Block length. Used by various types.
CGO_AD_LEN 🔒
Size of CGO additional data, in bytes.
CGO_PAYLOAD_LEN 🔒
Size of CGO payload, in bytes.
CGO_TAG_LEN 🔒
Size of CGO tag, in bytes.
HLEN_UIV 🔒
Size of the “H” tweak passed to the UIV+ construction.

Traits§

BlkCipher
Helper trait to define the features we need from a block cipher, and make our “where” declarations smaller.
BlkCipherDec
Helper trait to define the features we need from a block cipher, and make our “where” declarations smaller.
BlkCipherEnc
Helper trait to define the features we need from a block cipher, and make our “where” declarations smaller.

Functions§

first_block 🔒
Helper: return the first BLK_LEN bytes of a slice as an array.
xor_into 🔒
Xor all bytes from input into output.

Type Aliases§

Block 🔒
A single block. Used as input to various functions.
BlockLen 🔒
Block length as a typenum; used to parameterize some types that use ArrayLen.