From: bg Date: Mon, 2 Feb 2015 20:40:47 +0000 (+0100) Subject: switch gcm-test from aes to aes-enconly X-Git-Url: https://git.cryptolib.org/?p=avr-crypto-lib.git;a=commitdiff_plain;h=6c688ee8a14c2452afb4e3c855939b9d0dc858d7 switch gcm-test from aes to aes-enconly --- diff --git a/bcal/bcal_aes128_enconly.c b/bcal/bcal_aes128_enconly.c new file mode 100644 index 0000000..42bc4a8 --- /dev/null +++ b/bcal/bcal_aes128_enconly.c @@ -0,0 +1,53 @@ +/* bcal_aes128.c */ +/* + This file is part of the AVR-Crypto-Lib. + Copyright (C) 2008 Daniel Otte (daniel.otte@rub.de) + + 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 . + */ +/** + * \file bcal_aes128.c + * \email daniel.otte@rub.de + * \author Daniel Otte + * \date 2009-01-08 + * \license GPLv3 or later + * + */ + +#include +#include +#include "blockcipher_descriptor.h" +#include "aes.h" +#include "aes128_enc.h" +#include "aes_keyschedule.h" +#include "keysize_descriptor.h" + +const char aes128_str[] PROGMEM = "AES-128"; + +const uint8_t aes128_keysize_desc[] PROGMEM = { KS_TYPE_LIST, 1, KS_INT(128), +KS_TYPE_TERMINATOR }; + +const bcdesc_t aes128_desc PROGMEM = { +BCDESC_TYPE_BLOCKCIPHER, +BC_INIT_TYPE_1, + aes128_str, + sizeof(aes128_ctx_t), + 128, + { (void_fpt) aes128_init }, + { (void_fpt) aes128_enc }, + { (void_fpt) NULL }, + (bc_free_fpt) NULL, + aes128_keysize_desc +}; + diff --git a/bcal/bcal_aes128_enconly.h b/bcal/bcal_aes128_enconly.h new file mode 100644 index 0000000..eb7a0c6 --- /dev/null +++ b/bcal/bcal_aes128_enconly.h @@ -0,0 +1,34 @@ +/* bcal_aes128.h */ +/* + This file is part of the AVR-Crypto-Lib. + Copyright (C) 2008 Daniel Otte (daniel.otte@rub.de) + + 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 . + */ +/** + * \file bcal_aes128.h + * \email daniel.otte@rub.de + * \author Daniel Otte + * \date 2009-01-08 + * \license GPLv3 or later + * + */ + +#include +#include "blockcipher_descriptor.h" +#include "aes.h" +#include "aes128_enc.h" +#include "keysize_descriptor.h" + +extern const bcdesc_t aes128_desc; diff --git a/bcal/bcal_aes192_enconly.c b/bcal/bcal_aes192_enconly.c new file mode 100644 index 0000000..20c6788 --- /dev/null +++ b/bcal/bcal_aes192_enconly.c @@ -0,0 +1,53 @@ +/* bcal_aes192.c */ +/* + This file is part of the AVR-Crypto-Lib. + Copyright (C) 2008 Daniel Otte (daniel.otte@rub.de) + + 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 . + */ +/** + * \file bcal_aes192.c + * \email daniel.otte@rub.de + * \author Daniel Otte + * \date 2009-01-08 + * \license GPLv3 or later + * + */ + +#include +#include +#include "blockcipher_descriptor.h" +#include "aes.h" +#include "aes192_enc.h" +#include "aes_keyschedule.h" +#include "keysize_descriptor.h" + +const char aes192_str[] PROGMEM = "AES-192"; + +const uint8_t aes192_keysize_desc[] PROGMEM = { KS_TYPE_LIST, 1, KS_INT(192), +KS_TYPE_TERMINATOR }; + +const bcdesc_t aes192_desc PROGMEM = { +BCDESC_TYPE_BLOCKCIPHER, +BC_INIT_TYPE_1, + aes192_str, + sizeof(aes192_ctx_t), + 128, + { (void_fpt) aes192_init }, + { (void_fpt) aes192_enc }, + { (void_fpt) NULL }, + (bc_free_fpt) NULL, + aes192_keysize_desc +}; + diff --git a/bcal/bcal_aes192_enconly.h b/bcal/bcal_aes192_enconly.h new file mode 100644 index 0000000..1d51cb2 --- /dev/null +++ b/bcal/bcal_aes192_enconly.h @@ -0,0 +1,34 @@ +/* bcal_aes192.h */ +/* + This file is part of the AVR-Crypto-Lib. + Copyright (C) 2008 Daniel Otte (daniel.otte@rub.de) + + 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 . + */ +/** + * \file bcal_aes192.h + * \email daniel.otte@rub.de + * \author Daniel Otte + * \date 2009-01-08 + * \license GPLv3 or later + * + */ + +#include +#include "blockcipher_descriptor.h" +#include "aes.h" +#include "aes192_enc.h" +#include "keysize_descriptor.h" + +extern const bcdesc_t aes192_desc; diff --git a/bcal/bcal_aes256_enconly.c b/bcal/bcal_aes256_enconly.c new file mode 100644 index 0000000..22c1bb2 --- /dev/null +++ b/bcal/bcal_aes256_enconly.c @@ -0,0 +1,53 @@ +/* bcal_aes256.c */ +/* + This file is part of the AVR-Crypto-Lib. + Copyright (C) 2008 Daniel Otte (daniel.otte@rub.de) + + 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 . + */ +/** + * \file bcal_aes256.c + * \email daniel.otte@rub.de + * \author Daniel Otte + * \date 2009-01-08 + * \license GPLv3 or later + * + */ + +#include +#include +#include "blockcipher_descriptor.h" +#include "aes.h" +#include "aes256_enc.h" +#include "aes_keyschedule.h" +#include "keysize_descriptor.h" + +const char aes256_str[] PROGMEM = "AES-256"; + +const uint8_t aes256_keysize_desc[] PROGMEM = { KS_TYPE_LIST, 1, KS_INT(256), +KS_TYPE_TERMINATOR }; + +const bcdesc_t aes256_desc PROGMEM = { +BCDESC_TYPE_BLOCKCIPHER, +BC_INIT_TYPE_1, + aes256_str, + sizeof(aes256_ctx_t), + 128, + { (void_fpt) aes256_init }, + { (void_fpt) aes256_enc }, + { (void_fpt) NULL }, + (bc_free_fpt) NULL, + aes256_keysize_desc +}; + diff --git a/bcal/bcal_aes256_enconly.h b/bcal/bcal_aes256_enconly.h new file mode 100644 index 0000000..5474eea --- /dev/null +++ b/bcal/bcal_aes256_enconly.h @@ -0,0 +1,34 @@ +/* bcal_aes256.h */ +/* + This file is part of the AVR-Crypto-Lib. + Copyright (C) 2008 Daniel Otte (daniel.otte@rub.de) + + 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 . + */ +/** + * \file bcal_aes256.h + * \email daniel.otte@rub.de + * \author Daniel Otte + * \date 2009-01-08 + * \license GPLv3 or later + * + */ + +#include +#include "blockcipher_descriptor.h" +#include "aes.h" +#include "aes256_enc.h" +#include "keysize_descriptor.h" + +extern const bcdesc_t aes256_desc; diff --git a/mkfiles/gcm.mk b/mkfiles/gcm.mk index 2421a38..c562d35 100644 --- a/mkfiles/gcm.mk +++ b/mkfiles/gcm.mk @@ -1,18 +1,17 @@ -# Makefile for AES +# Makefile for GCM ALGO_NAME := GCM # comment out the following line for removement of AES from the build process -BLOCK_CIPHERS += $(ALGO_NAME) +AEAD_CIPHERS += $(ALGO_NAME) $(ALGO_NAME)_DIR := gcm/ $(ALGO_NAME)_INCDIR := memxor/ aes/ gf256mul/ bcal/ $(ALGO_NAME)_OBJ := gcm128.o \ - aes_enc-asm.o aes_dec-asm.o aes_sbox-asm.o aes_invsbox-asm.o \ - aes_keyschedule-asm.o + aes_enc-asm.o aes_sbox-asm.o \ + aes_keyschedule-asm.o memxor.o $(ALGO_NAME)_TESTBIN := main-gcm-test.o $(CLI_STD) $(BCAL_STD) \ - bcal_aes128.o bcal_aes192.o bcal_aes256.o \ - dump-asm.o dump-decl.o \ - memxor.o + bcal_aes128_enconly.o bcal_aes192_enconly.o bcal_aes256_enconly.o \ + dump-asm.o dump-decl.o $(ALGO_NAME)_NESSIE_TEST := test nessie $(ALGO_NAME)_PERFORMANCE_TEST := performance diff --git a/test_src/main-gcm-test.c b/test_src/main-gcm-test.c index f2726f2..0211592 100644 --- a/test_src/main-gcm-test.c +++ b/test_src/main-gcm-test.c @@ -27,9 +27,9 @@ #include "main-test-common.h" #include -#include -#include -#include +#include +#include +#include #include "performance_test.h" char *algo_name = "GCM-AES128";