]> git.lizzy.rs Git - plan9front.git/blobdiff - sys/man/2/chacha
games/galaxy: Change button 2 to reposition the galaxy, remove "move" from the button...
[plan9front.git] / sys / man / 2 / chacha
index b339e9dc03640b1e31a58bab2a8c867211593f83..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