]> git.lizzy.rs Git - plan9front.git/blobdiff - sys/man/2/chacha
tinc(8): add history section
[plan9front.git] / sys / man / 2 / chacha
index 4ccf3834c24925b0da23052d68cfb29ff0c02523..21ce09ea049e3f475e839f5472290fdb1a68370b 100644 (file)
@@ -1,6 +1,6 @@
 .TH CHACHA 2
 .SH NAME
-setupChachastate, chacha_setblock, chacha_setiv, chacha_encrypt, chacha_encrypt2, ccpoly_encrypt, ccpoly_decrypt \- chacha encryption
+setupChachastate, chacha_setblock, chacha_setiv, chacha_encrypt, chacha_encrypt2, hchacha, ccpoly_encrypt, ccpoly_decrypt \- chacha encryption
 .SH SYNOPSIS
 .B #include <u.h>
 .br
@@ -24,6 +24,9 @@ void chacha_setblock(Chachastate *s, u64int blockno)
 void chacha_setiv(Chachastate *s, uchar *iv);
 .PP
 .B
+void hchacha(uchar h[32], uchar *key, ulong keylen, uchar nonce[16], int rounds);
+.PP
+.B
 void ccpoly_encrypt(uchar *dat, ulong ndat, uchar *aad, ulong naad, uchar tag[16], Chachastate *cs);
 .PP
 .B
@@ -49,8 +52,11 @@ a
 or nonce of
 .I ivlen
 bytes (can be
-.BR ChachaIVlen =12
-or 8, set to all zeros if the
+.BR ChachaIVlen =12 ,
+.B 8
+or
+.BR XChachaIVlen =24 ;
+set to all zeros if the
 .I iv
 argument is nil),
 and the number of
@@ -94,6 +100,10 @@ allowing seeking in an encrypted stream.
 sets the the initialization vector (nonce) to
 .IR iv .
 .PP
+.I Hchacha
+is a key expansion function that takes a 128 or 256-bit key 
+and a 128-bit nonce and produces a new 256-bit key.
+.PP
 .I Ccpoly_encrypt
 and
 .I ccpoly_decrypt
@@ -131,6 +141,7 @@ calculation, but not encrypted.
 .IR elgamal (2),
 .IR rc4 (2),
 .IR rsa (2),
+.IR salsa (2),
 .IR sechash (2),
 .IR prime (2),
 .IR rand (2)