Commit 764a0b2b authored by bg nerilex's avatar bg nerilex

using Flash storage for AES and BCAL

parent 2895b49d
/out/*/**
/out/**
/log/**
/backup/**
**/old/**
**/.old/**
......@@ -11,5 +13,6 @@
!.gitignore
!.clang-format
!.keep
build_log.txt
......@@ -26,7 +26,7 @@
typedef struct
{
bcdesc_t *desc;
const bcdesc_t *desc;
bcgen_ctx_t cctx;
uint8_t *accu;
uint8_t *k1;
......
......@@ -93,7 +93,7 @@ typedef struct
typedef struct
{
bcdesc_t *desc_ptr;
const bcdesc_t *desc_ptr;
void *ctx;
uint16_t keysize;
} bcgen_ctx_t;
......
......@@ -22,26 +22,30 @@
#include <string.h>
#include "blockcipher_descriptor.h"
#include "keysize_descriptor.h"
#include "flash.h"
uint8_t bcal_cipher_init(const bcdesc_t *cipher_descriptor, const void *key,
uint16_t keysize_b, bcgen_ctx_t *ctx)
{
if (!is_valid_keysize_P(cipher_descriptor->valid_keysize_desc, keysize_b)) {
if (!is_valid_keysize_P(
flash_read_ptr(&cipher_descriptor->valid_keysize_desc),
keysize_b)) {
return 1;
}
uint8_t flags;
bc_init_fpt init_fpt;
ctx->desc_ptr = (bcdesc_t *)cipher_descriptor;
ctx->desc_ptr = cipher_descriptor;
ctx->keysize = keysize_b;
flags = cipher_descriptor->flags;
init_fpt.initvoid = (void_fpt)(cipher_descriptor->init.initvoid);
flags = flash_read_8(&cipher_descriptor->flags);
init_fpt.initvoid =
(void_fpt)(flash_read_ptr(&cipher_descriptor->init.initvoid));
if (init_fpt.initvoid == NULL) {
if (!(ctx->ctx = malloc((keysize_b + 7) / 8)))
return 2;
memcpy(ctx->ctx, key, (keysize_b + 7) / 8);
return 0;
}
if (!(ctx->ctx = malloc(cipher_descriptor->ctxsize_B)))
if (!(ctx->ctx = malloc(flash_read_16(&cipher_descriptor->ctxsize_B))))
return 3;
if ((flags & BC_INIT_TYPE) == BC_INIT_TYPE_1) {
init_fpt.init1((void *)key, (ctx->ctx));
......@@ -56,16 +60,16 @@ void bcal_cipher_free(bcgen_ctx_t *ctx)
if (!ctx)
return;
bc_free_fpt free_fpt;
free_fpt = (bc_free_fpt)(ctx->desc_ptr->free);
free_fpt = (bc_free_fpt)flash_read_ptr(&ctx->desc_ptr->free);
if (free_fpt)
free_fpt((ctx->ctx));
free_fpt(ctx->ctx);
free(ctx->ctx);
}
void bcal_cipher_enc(void *block, const bcgen_ctx_t *ctx)
{
bc_enc_fpt enc_fpt;
enc_fpt.encvoid = (void_fpt)(ctx->desc_ptr->enc.encvoid);
enc_fpt.encvoid = (void_fpt)flash_read_ptr(&ctx->desc_ptr->enc.encvoid);
if (!enc_fpt.encvoid) {
/* very bad error, no enciphering function specified */
return;
......@@ -76,7 +80,7 @@ void bcal_cipher_enc(void *block, const bcgen_ctx_t *ctx)
void bcal_cipher_dec(void *block, const bcgen_ctx_t *ctx)
{
bc_dec_fpt dec_fpt;
dec_fpt.decvoid = (void_fpt)(ctx->desc_ptr->dec.decvoid);
dec_fpt.decvoid = (void_fpt)flash_read_ptr(&ctx->desc_ptr->enc.encvoid);
if (!dec_fpt.decvoid) {
/* very bad error, no deciphering function specified */
return;
......@@ -86,10 +90,10 @@ void bcal_cipher_dec(void *block, const bcgen_ctx_t *ctx)
uint16_t bcal_cipher_getBlocksize_b(const bcdesc_t *desc)
{
return (desc->blocksize_b);
return flash_read_16(&desc->blocksize_b);
}
const void *bcal_cipher_getKeysizeDesc(const bcdesc_t *desc)
{
return (desc->valid_keysize_desc);
return flash_read_ptr(&desc->valid_keysize_desc);
}
/* bcal-basic.h */
/*
This file is part of the ARM-Crypto-Lib.
Copyright (C) 2009 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 <http://www.gnu.org/licenses/>.
*/
#ifndef BCAL_BASIC_H_
#define BCAL_BASIC_H_
#include <stdlib.h>
#include <stdint.h>
#include "blockcipher_descriptor.h"
#include "keysize_descriptor.h"
uint8_t bcal_cipher_init(const bcdesc_t *cipher_descriptor, const void *key,
uint16_t keysize_b, bcgen_ctx_t *ctx);
void bcal_cipher_free(bcgen_ctx_t *ctx);
void bcal_cipher_enc(void *block, const bcgen_ctx_t *ctx);
void bcal_cipher_dec(void *block, const bcgen_ctx_t *ctx);
uint16_t bcal_cipher_getBlocksize_b(const bcdesc_t *desc);
const void *bcal_cipher_getKeysizeDesc(const bcdesc_t *desc);
#endif /* BCAL_BASIC_H_ */
/* bcal-cbc.h */
/*
This file is part of the ARM-Crypto-Lib.
Copyright (C) 2010 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 <http://www.gnu.org/licenses/>.
*/
#ifndef BCALCBC_H_
#define BCALCBC_H_
#include <stdint.h>
#include "blockcipher_descriptor.h"
#include "bcal-basic.h"
typedef struct
{
bcdesc_t *desc;
bcgen_ctx_t cctx;
uint8_t *prev_block;
uint8_t blocksize_B;
} bcal_cbc_ctx_t;
uint8_t bcal_cbc_init(const bcdesc_t *desc, const void *key, uint16_t keysize_b,
bcal_cbc_ctx_t *ctx);
void bcal_cbc_free(bcal_cbc_ctx_t *ctx);
void bcal_cbc_loadIV(const void *iv, bcal_cbc_ctx_t *ctx);
void bcal_cbc_encNext(void *block, bcal_cbc_ctx_t *ctx);
void bcal_cbc_decNext(void *block, bcal_cbc_ctx_t *ctx);
void bcal_cbc_decRand(void *block, const void *prev_block, bcal_cbc_ctx_t *ctx);
void bcal_cbc_encMsg(const void *iv, void *msg, uint16_t msg_blocks,
bcal_cbc_ctx_t *ctx);
void bcal_cbc_decMsg(const void *iv, void *msg, uint16_t msg_blocks,
bcal_cbc_ctx_t *ctx);
#endif /* BCALCBC_H_ */
/* bcal-cfb_bit.h */
/*
This file is part of the ARM-Crypto-Lib.
Copyright (C) 2010 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 <http://www.gnu.org/licenses/>.
*/
#ifndef BCALCFB_BIT_H_
#define BCALCFB_BIT_H_
#include <stdint.h>
#include "bcal-basic.h"
#include "blockcipher_descriptor.h"
typedef struct
{
bcdesc_t *desc;
bcgen_ctx_t cctx;
uint8_t *in_block;
uint8_t blocksize_B;
uint16_t size_b;
} bcal_cfb_b_ctx_t;
uint8_t bcal_cfb_b_init(const bcdesc_t *desc, const void *key,
uint16_t keysize_b, uint16_t size_b,
bcal_cfb_b_ctx_t *ctx);
void bcal_cfb_b_free(bcal_cfb_b_ctx_t *ctx);
void bcal_cfb_b_loadIV(const void *iv, bcal_cfb_b_ctx_t *ctx);
void bcal_cfb_b_encNext(void *block, uint8_t offset, bcal_cfb_b_ctx_t *ctx);
void bcal_cfb_b_decNext(void *block, uint8_t offset, bcal_cfb_b_ctx_t *ctx);
void bcal_cfb_b_encMsg(const void *iv, void *msg, uint8_t offset,
uint32_t msg_blocks, bcal_cfb_b_ctx_t *ctx);
void bcal_cfb_b_decMsg(const void *iv, void *msg, uint8_t offset,
uint32_t msg_blocks, bcal_cfb_b_ctx_t *ctx);
#endif /* BCALCFB_BIT_H_ */
/* bcal-cbc.h */
/*
This file is part of the ARM-Crypto-Lib.
Copyright (C) 2010 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 <http://www.gnu.org/licenses/>.
*/
#ifndef BCALCFB_BYTE_H_
#define BCALCFB_BYTE_H_
#include <stdint.h>
#include "bcal-basic.h"
#include "blockcipher_descriptor.h"
typedef struct
{
bcdesc_t *desc;
bcgen_ctx_t cctx;
uint8_t *in_block;
uint8_t blocksize_B;
uint8_t size_B;
} bcal_cfb_B_ctx_t;
uint8_t bcal_cfb_B_init(const bcdesc_t *desc, const void *key,
uint16_t keysize_b, uint16_t size_b,
bcal_cfb_B_ctx_t *ctx);
void bcal_cfb_B_free(bcal_cfb_B_ctx_t *ctx);
void bcal_cfb_B_loadIV(const void *iv, bcal_cfb_B_ctx_t *ctx);
void bcal_cfb_B_encNext(void *block, bcal_cfb_B_ctx_t *ctx);
void bcal_cfb_B_decNext(void *block, bcal_cfb_B_ctx_t *ctx);
void bcal_cfb_B_encMsg(const void *iv, void *msg, uint16_t msg_blocks,
bcal_cfb_B_ctx_t *ctx);
void bcal_cfb_B_decMsg(const void *iv, void *msg, uint16_t msg_blocks,
bcal_cfb_B_ctx_t *ctx);
#endif /* BCALCFB_BYTE_H_ */
......@@ -93,6 +93,7 @@ void bcal_cmac_free(bcal_cmac_ctx_t *ctx)
free(ctx->accu);
free(ctx->k1);
free(ctx->k2);
free(ctx->lastblock);
bcal_cipher_free(&(ctx->cctx));
}
......
/* bcal-cmac.h */
/*
This file is part of the ARM-Crypto-Lib.
Copyright (C) 2010 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 <http://www.gnu.org/licenses/>.
*/
#ifndef BCALCMAC_H_
#define BCALCMAC_H_
#include <stdint.h>
#include "bcal-basic.h"
#include "blockcipher_descriptor.h"
typedef struct
{
bcdesc_t *desc;
bcgen_ctx_t cctx;
uint8_t *accu;
uint8_t *k1;
uint8_t *k2;
uint8_t *lastblock;
uint8_t last_set;
uint8_t blocksize_B;
} bcal_cmac_ctx_t;
uint8_t bcal_cmac_init(const bcdesc_t *desc, const void *key,
uint16_t keysize_b, bcal_cmac_ctx_t *ctx);
void bcal_cmac_free(bcal_cmac_ctx_t *ctx);
void bcal_cmac_nextBlock(bcal_cmac_ctx_t *ctx, const void *block);
void bcal_cmac_lastBlock(bcal_cmac_ctx_t *ctx, const void *block,
uint16_t length_b);
void bcal_cmac_ctx2mac(void *dest, uint16_t length_b,
const bcal_cmac_ctx_t *ctx);
void bcal_cmac(void *dest, uint16_t out_length_b, const void *block,
uint32_t length_b, bcal_cmac_ctx_t *ctx);
#endif /* BCALCMAC_H_ */
/* bcal-ctr.h */
/*
This file is part of the ARM-Crypto-Lib.
Copyright (C) 2010 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 <http://www.gnu.org/licenses/>.
*/
#ifndef BCALCTR_H_
#define BCALCTR_H_
#include <stdint.h>
#include "bcal-basic.h"
#include "blockcipher_descriptor.h"
typedef void (*inc_fp_t)(void *block, uint8_t size_B);
typedef struct
{
bcdesc_t *desc;
bcgen_ctx_t cctx;
uint8_t *in_block;
inc_fp_t inc_func;
uint8_t blocksize_B;
} bcal_ctr_ctx_t;
uint8_t bcal_ctr_init(const bcdesc_t *desc, const void *key, uint16_t keysize_b,
inc_fp_t inc_func, bcal_ctr_ctx_t *ctx);
void bcal_ctr_free(bcal_ctr_ctx_t *ctx);
void bcal_ctr_loadIV(const void *iv, bcal_ctr_ctx_t *ctx);
void bcal_ctr_encNext(void *block, bcal_ctr_ctx_t *ctx);
void bcal_ctr_decNext(void *block, bcal_ctr_ctx_t *ctx);
void bcal_ctr_encMsg(const void *iv, void *msg, uint32_t msg_len_b,
bcal_ctr_ctx_t *ctx);
void bcal_ctr_decMsg(const void *iv, void *msg, uint32_t msg_len_b,
bcal_ctr_ctx_t *ctx);
#endif /* BCALCTR_H_ */
/* bcal-eax.h */
/*
This file is part of the ARM-Crypto-Lib.
Copyright (C) 2010 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 <http://www.gnu.org/licenses/>.
*/
#ifndef BCALEAX_H_
#define BCALEAX_H_
#include <stdint.h>
#include <string.h>
#include "bcal-basic.h"
#include "blockcipher_descriptor.h"
#include "bcal-cmac.h"
#include "bcal-ctr.h"
typedef struct
{
uint8_t *nonce;
bcal_cmac_ctx_t ntag;
bcal_cmac_ctx_t ctag;
bcal_cmac_ctx_t htag;
bcal_ctr_ctx_t cipher;
uint8_t blocksize_B;
uint8_t header_set;
} bcal_eax_ctx_t;
uint8_t bcal_eax_init(const bcdesc_t *desc, const void *key, uint16_t keysize_b,
bcal_eax_ctx_t *ctx);
void bcal_eax_free(bcal_eax_ctx_t *ctx);
void bcal_eax_loadNonce(const void *nonce, uint16_t length_b,
bcal_eax_ctx_t *ctx);
void bcal_eax_addNextHeader(const void *header, bcal_eax_ctx_t *ctx);
void bcal_eax_addLastHeader(const void *header, uint16_t length_b,
bcal_eax_ctx_t *ctx);
void bcal_eax_encNextBlock(void *block, bcal_eax_ctx_t *ctx);
void bcal_eax_encLastBlock(void *block, uint16_t length_b, bcal_eax_ctx_t *ctx);
void bcal_eax_decNextBlock(void *block, bcal_eax_ctx_t *ctx);
void bcal_eax_decLastBlock(void *block, uint16_t length_b, bcal_eax_ctx_t *ctx);
void bcal_eax_ctx2tag(void *dest, uint16_t length_b, bcal_eax_ctx_t *ctx);
// void bcal_eax(void* dest, uint16_t out_length_b, const void* block, uint32_t
// length_b, bcal_eax_ctx_t* ctx);
#endif /* BCALEAX_H_ */
/* bcal-ofb.h */
/*
This file is part of the ARM-Crypto-Lib.
Copyright (C) 2010 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 <http://www.gnu.org/licenses/>.
*/
#ifndef BCALOFB_H_
#define BCALOFB_H_
#include <stdint.h>
#include "bcal-basic.h"
#include "blockcipher_descriptor.h"
typedef struct
{
bcdesc_t *desc;
bcgen_ctx_t cctx;
uint8_t *in_block;
uint8_t blocksize_B;
} bcal_ofb_ctx_t;
uint8_t bcal_ofb_init(const bcdesc_t *desc, const void *key, uint16_t keysize_b,
bcal_ofb_ctx_t *ctx);
void bcal_ofb_free(bcal_ofb_ctx_t *ctx);
void bcal_ofb_loadIV(const void *iv, bcal_ofb_ctx_t *ctx);
void bcal_ofb_encNext(void *block, bcal_ofb_ctx_t *ctx);
void bcal_ofb_decNext(void *block, bcal_ofb_ctx_t *ctx);
void bcal_ofb_encMsg(const void *iv, void *msg, uint32_t msg_len_b,
bcal_ofb_ctx_t *ctx);
void bcal_ofb_decMsg(const void *iv, void *msg, uint32_t msg_len_b,
bcal_ofb_ctx_t *ctx);
#endif /* BCALOFB_H_ */
......@@ -32,19 +32,20 @@
#include "aes128_dec.h"
#include "aes_keyschedule.h"
#include "keysize_descriptor.h"
#include "flash.h"
const char aes128_str[] = "AES-128";
const char aes128_str[] FLASH = "AES-128";
const uint8_t aes128_keysize_desc[] = {KS_TYPE_LIST, 1, KS_INT(128),
KS_TYPE_TERMINATOR};
const uint8_t aes128_keysize_desc[] FLASH = {KS_TYPE_LIST, 1, KS_INT(128),
KS_TYPE_TERMINATOR};
const bcdesc_t aes128_desc = {BCDESC_TYPE_BLOCKCIPHER,
BC_INIT_TYPE_1,
aes128_str,
sizeof(aes128_ctx_t),
128,
{(void_fpt)aes128_init},
{(void_fpt)aes128_enc},
{(void_fpt)aes128_dec},
(bc_free_fpt)NULL,
aes128_keysize_desc};
const bcdesc_t aes128_desc FLASH = {BCDESC_TYPE_BLOCKCIPHER,
BC_INIT_TYPE_1,
aes128_str,
sizeof(aes128_ctx_t),
128,
{(void_fpt)aes128_init},
{(void_fpt)aes128_enc},
{(void_fpt)aes128_dec},
(bc_free_fpt)NULL,
aes128_keysize_desc};
/* bcal_aes128.h */
/*
This file is part of the ARM-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 <http://www.gnu.org/licenses/>.
*/
/**
* \file bcal_aes128.h
* \email daniel.otte@rub.de
* \author Daniel Otte
* \date 2009-01-08
* \license GPLv3 or later
*
*/
#include "blockcipher_descriptor.h"
#include "aes.h"
#include "aes128_enc.h"
#include "aes128_dec.h"
#include "keysize_descriptor.h"
extern const bcdesc_t aes128_desc;
......@@ -32,19 +32,20 @@
#include "aes192_dec.h"
#include "aes_keyschedule.h"
#include "keysize_descriptor.h"
#include "flash.h"
const char aes192_str[] = "AES-192";
const char aes192_str[] FLASH = "AES-192";
const uint8_t aes192_keysize_desc[] = {KS_TYPE_LIST, 1, KS_INT(192),
KS_TYPE_TERMINATOR};
const uint8_t aes192_keysize_desc[] FLASH = {KS_TYPE_LIST, 1, KS_INT(192),
KS_TYPE_TERMINATOR};
const bcdesc_t aes192_desc = {BCDESC_TYPE_BLOCKCIPHER,
BC_INIT_TYPE_1,
aes192_str,
sizeof(aes192_ctx_t),
128,
{(void_fpt)aes192_init},
{(void_fpt)aes192_enc},
{(void_fpt)aes192_dec},
(bc_free_fpt)NULL,
aes192_keysize_desc};
const bcdesc_t aes192_desc FLASH = {BCDESC_TYPE_BLOCKCIPHER,
BC_INIT_TYPE_1,
aes192_str,
sizeof(aes192_ctx_t),
128,
{(void_fpt)aes192_init},
{(void_fpt)aes192_enc},
{(void_fpt)aes192_dec},
(bc_free_fpt)NULL,
aes192_keysize_desc};
/* bcal_aes192.h */
/*
This file is part of the ARM-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 <http://www.gnu.org/licenses/>.
*/
/**
* \file bcal_aes192.h
* \email daniel.otte@rub.de
* \author Daniel Otte
* \date 2009-01-08
* \license GPLv3 or later
*
*/
#include "blockcipher_descriptor.h"
#include "aes.h"
#include "aes192_enc.h"
#include "aes192_dec.h"
#include "keysize_descriptor.h"
extern const bcdesc_t aes192_desc;
......@@ -32,19 +32,20 @@
#include "aes256_dec.h"
#include "aes_keyschedule.h"
#include "keysize_descriptor.h"
#include "flash.h"
const char aes256_str[] = "AES-256";
const char aes256_str[] FLASH = "AES-256";
const uint8_t aes256_keysize_desc[] = {KS_TYPE_LIST, 1, KS_INT(256),
KS_TYPE_TERMINATOR};
const uint8_t aes256_keysize_desc[] FLASH = {KS_TYPE_LIST, 1, KS_INT(256),
KS_TYPE_TERMINATOR};
const bcdesc_t aes256_desc = {BCDESC_TYPE_BLOCKCIPHER,
BC_INIT_TYPE_1,
aes256_str,
sizeof(aes256_ctx_t),
128,
{(void_fpt)aes256_init},
{(void_fpt)aes256_enc},
{(void_fpt)aes256_dec},
(bc_free_fpt)NULL,
aes256_keysize_desc};
const bcdesc_t aes256_desc FLASH = {BCDESC_TYPE_BLOCKCIPHER,
BC_INIT_TYPE_1,
aes256_str,
sizeof(aes256_ctx_t),
128,
{(void_fpt)aes256_init},
{(void_fpt)aes256_enc},
{(void_fpt)aes256_dec},
(bc_free_fpt)NULL,
aes256_keysize_desc};
/* bcal_aes256.h */
/*
This file is part of the ARM-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 <http://www.gnu.org/licenses/>.
*/
/**
* \file bcal_aes256.h
* \email daniel.otte@rub.de
* \author Daniel Otte
* \date 2009-01-08
* \license GPLv3 or later
*
*/
#include "blockcipher_descriptor.h"
#include "aes.h"
#include "aes256_enc.h"
#include "aes256_dec.h"
#include "keysize_descriptor.h"