]> git.cryptolib.org Git - avr-crypto-lib.git/blobdiff - blockcipher_descriptor.h
new and more compact aes
[avr-crypto-lib.git] / blockcipher_descriptor.h
index 4dc3c5544f7248b7650d89ca0bfd506af97af61e..6e1f64f3f2dd4db99b1e98fb99e9f6973458b11e 100644 (file)
@@ -1,11 +1,41 @@
 /* blockcipher_descriptor.h */
+/*
+    This file is part of the AVR-Crypto-Lib.
+    Copyright (C) 2006-2015 Daniel Otte (bg@nerilex.org)
+
+    This program is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+/**
+ * \file               blockcipher_descriptor.h
+ * \author             Daniel Otte 
+ * \date               2009-02-04
+ * 
+ * \license        GPLv3 or later
+ * 
+ */
 
 #ifndef BLOCKCIPHER_DESCRIPTOR_H_
 #define BLOCKCIPHER_DESCRIPTOR_H_
 #include <stdint.h>
 #include <avr/pgmspace.h>
 
+
+#ifndef VOID_FPT
+#define VOID_FPT
 typedef void(*void_fpt)(void);
+#endif
+
 typedef void(*bc_init1_fpt)(void*, void*);
 typedef void(*bc_init2_fpt)(void*, uint16_t,void*);
 typedef void(*bc_enc1_fpt)(void*, void*);
@@ -33,8 +63,8 @@ typedef union{
 } bc_dec_fpt;
 
 #define BC_INIT_TYPE   0x01
-#define BC_INIT_TYPE_1 0x00
-#define BC_INIT_TYPE_2 0x01
+#define BC_INIT_TYPE_1 0x00 /* for fix keylength */
+#define BC_INIT_TYPE_2 0x01 /* keylength is passed as second parameter */
 
 #define BC_ENC_TYPE    0x02
 #define BC_ENC_TYPE_1  0x00
@@ -60,7 +90,7 @@ typedef struct {
 } bcdesc_t; /* blockcipher descriptor type */
 
 typedef struct{
-       bcdesc_tdesc_ptr;
+       bcdesc_t *desc_ptr;
        uint16_t  keysize;
        void*     ctx;
 } bcgen_ctx_t;