]> git.cryptolib.org Git - avr-crypto-lib.git/blob - doc/acl_streamciphers.texi
+gcm128
[avr-crypto-lib.git] / doc / acl_streamciphers.texi
1 @c acl_streamciphers.texi
2 @section Stream ciphers
3  A stream cipher normally generates a deterministic, random looking stream of 
4  bits, known as key stream. For encryption purpose this key stream is XORed with
5  the data stream. So decryption is exactly the same as encryption. The 
6  data-stream is XORed with the key stream giving the plaintext. So both sides 
7  need exactly the same stream cipher in the same state.
8
9 @subsection List of available stream ciphers
10  The following stream ciphers are currently implemented:
11 @itemize @bullet 
12   @item ARCFOUR (RC4 compatibel)
13   @item Trivium
14   @item Grain
15   @item MUGI
16   @item Mickey-128 (v2)
17 @end itemize 
18
19 @subsection High frequent parameters
20 @table @asis
21   @item output-size
22   8 bit, 1 bit
23   @item keysize
24   64 bit, 80 bit, 128 bit
25   @item IVsize
26   64 bit
27 @end table
28
29 @subsection Parts of a stream cipher
30 @itemize @bullet
31   @item generation algorithm
32   @item initialization algorithm
33   @item state
34 @end itemize
35
36  As we can see all stream ciphers seem to utilize an internal state which
37  determines the output. This state is initialized by the initialization 
38  algorithm with a key and an IV (initialization vector). It is very important
39  for security that _never_ the same key with the same IV is used again. The
40  IV is not required to be kept secret.
41
42 @subsection API of stream ciphers
43  The API is not always consistent due to the fact that we tried to optimize the
44  code for size (flash, heap and stack) and speed (runtime of the different 
45  components).
46
47  Generally the API of the implemented stream ciphers consists of:
48  @table @code 
49  @item *_init 
50  function, which implements the initialization
51
52  @item *_gen  
53  function, which implements the streamcipher algorithm and generates a 
54  keystream output
55
56  @item *_ctx_t
57  context type, which contains internal state information
58
59  @end table
60
61 @subsubsection @code{*_init} function
62  The *_init function generally takes a pointer to the key as first parameter.
63  For ciphers where the keysize is not fixed the second parameter gives the 
64  keysize (in bits regularly) followed by a pointer to the IV and a length 
65  parameter for not fixed IV sizes (both are omitted if the algorithm does not 
66  specify IV handling, in this case a part of the key should be used as IV).
67  The last parameter points to the context variable to fill.
68
69 @subsubsection @code{*_gen} function
70  The *_gen function updates the internal state to which a pointer is given as
71  parameter and returns a fixed length part of the keystream as return value.
72
73
74 @subsection Stream cipher abstraction layer (SCAL)
75