3 setupSalsastate, salsa_setblock, salsa_setiv, salsa_encrypt, salsa_encrypt2, hsalsa
10 .B #include <libsec.h>
13 void setupSalsastate(Salsastate *s, uchar key[], ulong keylen, uchar *iv, ulong ivlen, int rounds)
16 void salsa_encrypt(uchar *data, ulong len, Salsastate *s)
19 void salsa_encrypt2(uchar *src, uchar *dst, ulong len, Salsastate *s)
22 void salsa_setblock(Salsastate *s, u64int blockno)
25 void salsa_setiv(Salsastate *s, uchar *iv);
28 void hsalsa(uchar h[32], uchar *key, ulong keylen, uchar nonce[16], int rounds);
31 Salsa20 is a stream cipher designed by D J Berstein. It has an underlying block size of 64 bytes
34 It supports key sizes of 128 and 256-bit (recommended).
37 takes a reference to a
43 bytes, which should normally be
44 .BR SalsaKeylen = 32 ,
52 .BR XSalsaIVlen = 24 ,
53 set to all zeros if the
58 (set to the default of 20 if the argument is zero).
70 can be any byte length.
71 Encryption and decryption are the same operation given the same starting state
75 is similar, but encrypts
85 sets the Salsa block counter for the next encryption to
87 allowing seeking in an encrypted stream.
90 sets the the initialization vector (nonce) to
94 is a key expansion function that takes a 128 or
95 256-bit key and a 128-bit nonce and produces a new
98 .B /sys/src/libsec/port/salsa.c
102 .B http://cr.yp.to/snuffle.html#specification