From 4cd320ae689b1615292896da2ea56e186cb38ed3 Mon Sep 17 00:00:00 2001 From: Jeff Becker Date: Mon, 30 Apr 2018 07:26:01 -0400 Subject: [PATCH] doc refactor --- doc/crypto_v0.txt | 21 +++++++++++++++++++++ doc/iwp_v0.txt | 19 +------------------ doc/proto_v0.txt | 18 +----------------- 3 files changed, 23 insertions(+), 35 deletions(-) create mode 100644 doc/crypto_v0.txt diff --git a/doc/crypto_v0.txt b/doc/crypto_v0.txt new file mode 100644 index 000000000..13377dc9e --- /dev/null +++ b/doc/crypto_v0.txt @@ -0,0 +1,21 @@ + + +cryptography: + +H(x) is 512 bit blake2b digest of x +HS(x) is 256 bit blake2b digest of x +MD(x, k) is 512 bit blake2b hmac of x with secret value k +MDS(x, k) is 256 bit blake2b hmac of x with secret value k +NE(k, x) is sntrup4591761 encrypt data x to public key k +ND(k, x) is sntrup4591761 decrypt data x with private key k +SE(k, n, x) is chacha20 encrypt data x using symettric key k and nounce n +SD(k, n, x) is chacha20 dectypt data x using symettric key k and nounce n +S(k, x) is sign x with ed25519 using seed k +ECKG() is generate ec keypair (p, s) public key p, seed s, both 32 bytes +V(k, x, sig) is verify x data using signature sig using public key k +DH(x, y) is a ecdh key exchange using ed25519 scalarmult between public keys x + and y +KE(x, y) is a ecdh key exchange using H(x + y + DH(x, y)) +PKE(x, y, n) is a path key exchange using MDS(n, KE(x, y)) +TKE(x, y, n) is a transport key exchange using MDS(n, KE(x, y)) +RAND(n) is n random bytes diff --git a/doc/iwp_v0.txt b/doc/iwp_v0.txt index 843c2ff8d..f6673b15b 100644 --- a/doc/iwp_v0.txt +++ b/doc/iwp_v0.txt @@ -10,24 +10,7 @@ document are to be interpreted as described in RFC 2119 [RFC2119]. cryptography: -H(x) is 512 bit blake2b digest of x -HS(x) is 256 bit blake2b digest of x -MD(x, k) is 512 bit blake2b hmac of x with secret value k -MDS(x, k) is 256 bit blake2b hmac of x with secret value k -NE(k, x) is sntrup4591761 encrypt data x to public key k -ND(k, x) is sntrup4591761 decrypt data x with private key k -SE(k, n, x) is chacha20 encrypt data x using symettric key k and nounce n -SD(k, n, x) is chacha20 dectypt data x using symettric key k and nounce n -S(k, x) is sign x with ed25519 using seed k -ECKG() is generate ec keypair (p, s) public key p, seed s, both 32 bytes -V(k, x, sig) is verify x data using signature sig using public key k -DH(x, y) is a ecdh key exchange using ed25519 scalarmult between public keys x - and y -KE(x, y) is a ecdh key exchange using H(x + y + DH(x, y)) -PKE(x, y, n) is a path key exchange using MDS(n, KE(x, y)) -TKE(x, y, n) is a transport key exchange using MD(n, KE(x, y)) -RAND(n) is n random bytes - +see crypto_v0.txt wire decryption: diff --git a/doc/proto_v0.txt b/doc/proto_v0.txt index cb97f5832..33e821052 100644 --- a/doc/proto_v0.txt +++ b/doc/proto_v0.txt @@ -35,23 +35,7 @@ BD(x) is bittorrent decode x cryptography: -H(x) is 512 bit blake2b digest of x -HS(x) is 256 bit blake2b digest of x -MD(x, k) is 512 bit blake2b hmac of x with secret value k -MDS(x, k) is 256 bit blake2b hmac of x with secret value k -NE(k, x) is sntrup4591761 encrypt data x to public key k -ND(k, x) is sntrup4591761 decrypt data x with private key k -SE(k, n, x) is chacha20 encrypt data x using symettric key k and nounce n -SD(k, n, x) is chacha20 dectypt data x using symettric key k and nounce n -S(k, x) is sign x with ed25519 using seed k -ECKG() is generate ec keypair (p, s) public key p, seed s, both 32 bytes -V(k, x, sig) is verify x data using signature sig using public key k -DH(x, y) is a ecdh key exchange using ed25519 scalarmult between public keys x - and y -KE(x, y) is a ecdh key exchange using H(x + y + DH(x, y)) -PKE(x, y, n) is a path key exchange using MDS(n, KE(x, y)) -TKE(x, y, n) is a transport key exchange using MD(n, KE(x, y)) -RAND(n) is n random bytes +see crypto_v0.txt ---