.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
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
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
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
.IR elgamal (2),
.IR rc4 (2),
.IR rsa (2),
+.IR salsa (2),
.IR sechash (2),
.IR prime (2),
.IR rand (2)