--- gvpe/doc/gvpe.protocol.7 2014/06/18 20:40:51 1.14 +++ gvpe/doc/gvpe.protocol.7 2015/04/24 21:55:29 1.15 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "GVPE.PROTOCOL 7" -.TH GVPE.PROTOCOL 7 "2014-04-26" "2.25" "GNU Virtual Private Ethernet" +.TH GVPE.PROTOCOL 7 "2015-01-29" "2.25" "GNU Virtual Private Ethernet" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l @@ -271,27 +271,19 @@ shown: .PP .Vb 3 -\& +\-\-\-\-\-\-+\-\-\-\-\-\-+\-\-\-\-\-\-\-\-+\-\-\-\-\-\-+\-\-\-\-\-\-\-+\-\-\-\-\-\-+ -\& | HMAC | TYPE | SRCDST | RAND | SEQNO | DATA | -\& +\-\-\-\-\-\-+\-\-\-\-\-\-+\-\-\-\-\-\-\-\-+\-\-\-\-\-\-+\-\-\-\-\-\-\-+\-\-\-\-\-\-+ +\& +\-\-\-\-\-\-+\-\-\-\-\-\-+\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-+\-\-\-\-\-\-+ +\& | HMAC | TYPE | SRCDST | SEQNO | DATA | +\& +\-\-\-\-\-\-+\-\-\-\-\-\-+\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-+\-\-\-\-\-\-+ .Ve .PP -\&\s-1RAND\s0 is a sequence of fully random bytes, used to increase the entropy of -the data for encryption purposes. -.PP \&\s-1SEQNO\s0 is a 32\-bit sequence number. It is negotiated at every connection initialization and starts at some random 31 bit value. \s-1GVPE\s0 currently uses a sliding window of 512 packets/sequence numbers to detect reordering, duplication and replay attacks. .PP -The encryption is done on \s-1RAND+SEQNO+DATA\s0 in \s-1CBC\s0 mode with zero \s-1IV \s0(or, -equivalently, the \s-1IV\s0 is \s-1RAND+SEQNO,\s0 encrypted with the block cipher, -unless \s-1RAND\s0 size is decreased or increased over the default value). -.PP -The random prefix itself is generated by using \s-1AES\s0 in \s-1CTR\s0 mode with a -random key and starting value, which should make them unpredictable even -before encrypting them again. The sequence number additionally ensures -that the \s-1IV\s0 is unique. +The encryption is done on \s-1SEQNO+DATA\s0 in \s-1CTR\s0 mode with \s-1IV\s0 generated from +the seqno (for \s-1AES:\s0 seqno || seqno || seqno || (u32)0), which ensures +uniqueness for a given key. .SS "The authentication/key exchange protocol" .IX Subsection "The authentication/key exchange protocol" Before nodes can exchange packets, they need to establish authenticity of