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_
utils bench
- 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§
- Client
Inbound - An instance of CGO used for inbound client encryption.
- Client
Outbound - An instance of CGO used for outbound client encryption.
- Crypt
State 🔒 - State of a single direction of a CGO layer, at the client or at a relay.
- Crypt
State Pair - A set of cryptographic information as shared by the client and a single relay, and
- Relay
Inbound - An instance of CGO used for inbound (towards the client) relay encryption.
- Relay
Outbound - 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.
- BlkCipher
Dec - Helper trait to define the features we need from a block cipher, and make our “where” declarations smaller.
- BlkCipher
Enc - 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
intooutput
.