chiark / gitweb /
EAX: provide an implementation of EAX
[secnet.git] / aes.h
diff --git a/aes.h b/aes.h
index a0167eb7d5ba9da367e740ce388038b3f8cb5f20..fc693560db4f273ff6844a68d34b68d4b35fd165 100644 (file)
--- a/aes.h
+++ b/aes.h
@@ -1,5 +1,58 @@
-#ifndef QEMU_AES_H
-#define QEMU_AES_H
+/*
+  * aes.h
+  *
+  * Header file declaring AES functions.
+  *
+  * Copied from the upstream qemu git tree revision
+  *   55616505876d6683130076b810a27c7889321560
+  * but was introduced there by Fabrice Bellard in
+  *   e4d4fe3c34cdd6e26f9b9975efec7d1e81ad00b6
+  *   AES crypto support
+  *   git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1036 \
+  *     c046a42c-6fe2-441c-8c8c-71466251a162
+  *
+  * Modified by Ian Jackson to change the guard #define from
+  * QEMU_AES_H to AES_H and to add some needed system #include's.
+  *
+  * The header file doesn't appear to have a separate copyright notice
+  * but is clearly a lightly edited (by Bellard) version of code from
+  * Rijmen, Bosselaers and Barreto.
+  *
+  * The original is from rijndael-alg-fst.c, with this copyright
+  * notice:
+  *
+  *   rijndael-alg-fst.c
+  *   
+  *   @version 3.0 (December 2000)
+  *   
+  *   Optimised ANSI C code for the Rijndael cipher (now AES)
+  *   
+  *   @author Vincent Rijmen <vincent.rijmen@esat.kuleuven.ac.be>
+  *   @author Antoon Bosselaers <antoon.bosselaers@esat.kuleuven.ac.be>
+  *   @author Paulo Barreto <paulo.barreto@terra.com.br>
+  *   
+  *   This code is hereby placed in the public domain.
+  *   
+  *   THIS SOFTWARE IS PROVIDED BY THE AUTHORS ''AS IS'' AND ANY EXPRESS
+  *   OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+  *   WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+  *   ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE
+  *   LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+  *   CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+  *   SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+  *   BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+  *   WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+  *   OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+  *   EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+  *
+  */
+
+#ifndef AES_H
+#define AES_H
+
+#include <stdint.h>
+#include <assert.h>
+#include <string.h>
 
 #define AES_MAXNR 14
 #define AES_BLOCK_SIZE 16
@@ -23,4 +76,4 @@ void AES_cbc_encrypt(const unsigned char *in, unsigned char *out,
                     const unsigned long length, const AES_KEY *key,
                     unsigned char *ivec, const int enc);
 
-#endif
+#endif /* AES_H */