3 setupChachastate, chacha_setblock, chacha_setiv, chacha_encrypt, chacha_encrypt2, ccpoly_encrypt, ccpoly_decrypt \- chacha encryption
12 void setupChachastate(Chachastate *s, uchar key[], ulong keylen, uchar *iv, ulong ivlen, int rounds)
15 void chacha_encrypt(uchar *data, ulong len, Chachastate *s)
18 void chacha_encrypt2(uchar *src, uchar *dst, ulong len, Chachastate *s)
21 void chacha_setblock(Chachastate *s, u64int blockno)
24 void chacha_setiv(Chachastate *s, uchar *iv);
27 void ccpoly_encrypt(uchar *dat, ulong ndat, uchar *aad, ulong naad, uchar tag[16], Chachastate *cs);
30 int ccpoly_decrypt(uchar *dat, ulong ndat, uchar *aad, ulong naad, uchar tag[16], Chachastate *cs);
33 Chacha is D J Berstein's symmetric stream cipher, as modified by RFC7539. It supports
34 keys of 256 bits (128 bits is supported here for special purposes). It has an underlying block size of 64 bytes
39 takes a reference to a
45 bytes, which should normally be
53 or 8, set to all zeros if the
58 (set to the default of 20 if the argument is zero).
59 With a key length of 256 bits (32 bytes), a nonce of 96 bits (12 bytes)
62 the function implements the Chacha20 encryption function of RFC7539.
74 can be any byte length.
75 Encryption and decryption are the same operation given the same starting state
79 is similar, but encrypts
89 sets the Chacha block counter for the next encryption to
91 allowing seeking in an encrypted stream.
94 sets the the initialization vector (nonce) to
100 implement authenticated encryption with associated data (AEAD)
101 using Chacha cipher and Poly1305 message authentication code
102 as specified in RFC7539.
103 These routines require a
105 that has been setup with a new (per key unique) initialization
106 vector (nonce) on each invocation. The referenced data
108 is in-place encrypted or decrypted.
110 produces a 16 byte authentication
116 returning zero on success or negative on a mismatch.
119 arguments refer to the additional authenticated data
120 that is included in the
122 calculation, but not encrypted.