]> git.cryptolib.org Git - avr-crypto-lib.git/blob - noekeon/noekeon.h
fixing E-Mail-Address & Copyright
[avr-crypto-lib.git] / noekeon / noekeon.h
1 /* noekeon.h */
2 /*
3     This file is part of the AVR-Crypto-Lib.
4     Copyright (C) 2006-2015 Daniel Otte (bg@nerilex.org)
5
6     This program is free software: you can redistribute it and/or modify
7     it under the terms of the GNU General Public License as published by
8     the Free Software Foundation, either version 3 of the License, or
9     (at your option) any later version.
10
11     This program is distributed in the hope that it will be useful,
12     but WITHOUT ANY WARRANTY; without even the implied warranty of
13     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14     GNU General Public License for more details.
15
16     You should have received a copy of the GNU General Public License
17     along with this program.  If not, see <http://www.gnu.org/licenses/>.
18 */
19 #ifndef NOEKEON_H_
20 #define NOEKEON_H_
21
22 /**
23  * \file    noekeon.h
24  * \author  Daniel Otte
25  * \email   bg@nerilex.org
26  * \date    2008-04-11
27  * \license GPLv3 or later
28  * \brief Implementation of the Noekeon block cipher
29  * \ingroup Noekeon
30  * This is an implementation of the Noekeon block cipher.
31  * For more details on Noekeon see http://gro.noekeon.org/
32  */
33
34 #include <stdint.h>
35
36 /** \typedef noekeon_ctx_t
37  * \brief holds key data for indirect mode
38  *  
39  * A variable of this type may hold the key data for the indirect mode.
40  * For direct mode simply pass the key directly to the encryption or
41  * decryption function.
42  */
43 typedef uint8_t noekeon_ctx_t[16];
44
45 /** \fn void noekeon_enc(void *buffer, const void *key)
46  * \brief noekeon encrytion funtion
47  * 
48  * This function encrypts a block (64 bit = 8 byte) with the noekeon encrytion
49  * algorithm. Due to the two modes of noekeon (direct mode and indirect mode)
50  * the second parameter either points directly to the key (direct mode) or to a
51  * context generated by the noekeon_init() function (indirect mode).
52  * \param buffer pointer to the 64 bit (8 byte) block to encrypt
53  * \param key    pointer to either the key (128 bit = 16 byte; direct mode) or 
54  * to the context (indirect mode)
55  */
56 void noekeon_enc(void *buffer, const void *key);
57
58 /** \fn void noekeon_dec(void *buffer, const void *key)
59  * \brief noekeon encrytion funtion
60  * 
61  * This function decrypts a block (64 bit = 8 byte) encrypted with the noekeon 
62  * encrytion algorithm. Due to the two modes of noekeon (direct mode and 
63  * indirect mode) the second parameter either points directly to the key 
64  * (direct mode) or to a context generated by the noekeon_init() function 
65  * (indirect mode).
66  * \param buffer pointer to the 64 bit (8 byte) block to decrypt
67  * \param key    pointer to either the key (128 bit = 16 byte; direct mode) or 
68  * to the context (indirect mode)
69  */
70 void noekeon_dec(void *buffer, const void *key);
71
72
73 /** \fn void noekeon_init(const void *key, noekeon_ctx_t *ctx)
74  * \brief noekeon context generation function for indirect mode
75  * 
76  * This function generates a context from the supplied key for using
77  * noekeon in indirect mode. For using noekeon in direct mode supply the key
78  * direct to the noekeon_enc() and noekeon_dec() functions.
79  * \param key pointer to the key (128 bit = 16 byte)
80  * \param ctx pointer to the context to fill with key material 
81  * to the context (indirect mode)
82  */
83 void noekeon_init(const void *key, noekeon_ctx_t *ctx);
84
85 #endif /*NOEKEON_H_*/