Permalink
Please sign in to comment.
Browse files
First commit with a partial import of aes from crypto-lib
- Loading branch information...
Showing
with
3,242 additions
and 0 deletions.
- +7 −0 .gitignore
- +43 −0 aes.h
- +46 −0 aes128_dec.h
- +47 −0 aes128_enc.h
- +46 −0 aes192_dec.h
- +47 −0 aes192_enc.h
- +46 −0 aes256_dec.h
- +47 −0 aes256_enc.h
- +457 −0 aes_dec-asm_faster.S
- +36 −0 aes_dec.h
- +341 −0 aes_enc-asm.S
- +36 −0 aes_enc.h
- +45 −0 aes_invsbox-asm.S
- +33 −0 aes_invsbox.h
- +225 −0 aes_keyschedule-asm.S
- +75 −0 aes_keyschedule.h
- +47 −0 aes_sbox-asm.S
- +33 −0 aes_sbox.h
- +56 −0 aes_types.h
- +150 −0 avr-asm-macros.S
- +94 −0 bcal-basic.c
- +36 −0 bcal-basic.h
- +84 −0 bcal-cbc.c
- +44 −0 bcal-cbc.h
- +152 −0 bcal-cmac.c
- +45 −0 bcal-cmac.h
- +76 −0 bcal-ofb.c
- +46 −0 bcal-ofb.h
- +55 −0 bcal_aes128.c
- +35 −0 bcal_aes128.h
- +55 −0 bcal_aes192.c
- +35 −0 bcal_aes192.h
- +55 −0 bcal_aes256.c
- +35 −0 bcal_aes256.h
- +99 −0 blockcipher_descriptor.h
- +10 −0 cryptolib.c
- +6 −0 cryptolib.h
- +82 −0 gf256mul.S
- +37 −0 gf256mul.h
- +161 −0 keysize_descriptor.c
- +62 −0 keysize_descriptor.h
- +66 −0 memxor.S
- +9 −0 memxor.h
| @@ -0,0 +1,7 @@ | ||
| +aes/ | ||
| +gf256mul/ | ||
| +memxor/ | ||
| +bcal/ | ||
| +*.swp | ||
| +*.o | ||
| +.DS_Store |
43
aes.h
| @@ -0,0 +1,43 @@ | ||
| +/* aes.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 <http://www.gnu.org/licenses/>. | ||
| +*/ | ||
| +/** | ||
| + * \file aes.h | ||
| + * \email daniel.otte@rub.de | ||
| + * \author Daniel Otte | ||
| + * \date 2008-12-30 | ||
| + * \license GPLv3 or later | ||
| + * | ||
| + */ | ||
| +#ifndef AES_H_ | ||
| +#define AES_H_ | ||
| + | ||
| +#include <stdint.h> | ||
| + | ||
| +#include "aes_types.h" | ||
| +#include "aes128_enc.h" | ||
| +#include "aes192_enc.h" | ||
| +#include "aes256_enc.h" | ||
| +#include "aes128_dec.h" | ||
| +#include "aes192_dec.h" | ||
| +#include "aes256_dec.h" | ||
| +#include "aes_enc.h" | ||
| +#include "aes_dec.h" | ||
| +#include "aes_keyschedule.h" | ||
| + | ||
| +#endif |
46
aes128_dec.h
| @@ -0,0 +1,46 @@ | ||
| +/* aes128_dec.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 <http://www.gnu.org/licenses/>. | ||
| +*/ | ||
| +/** | ||
| + * \file aes128_dec.h | ||
| + * \email daniel.otte@rub.de | ||
| + * \author Daniel Otte | ||
| + * \date 2008-12-30 | ||
| + * \license GPLv3 or later | ||
| + * \ingroup AES | ||
| + */ | ||
| + | ||
| +#ifndef AES128_DEC_H_ | ||
| +#define AES128_DEC_H_ | ||
| + | ||
| +#include "aes_types.h" | ||
| +#include "aes_dec.h" | ||
| + | ||
| +/** | ||
| + * \brief decrypt with 128 bit key. | ||
| + * | ||
| + * This function decrypts one block with the AES algorithm under control of | ||
| + * a keyschedule produced from a 128 bit key. | ||
| + * \param buffer pointer to the block to decrypt | ||
| + * \param ctx pointer to the key schedule | ||
| + */ | ||
| +void aes128_dec(void* buffer, aes128_ctx_t* ctx); | ||
| + | ||
| + | ||
| + | ||
| +#endif /* AES128_DEC_H_ */ |
47
aes128_enc.h
| @@ -0,0 +1,47 @@ | ||
| +/* aes128_enc.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 <http://www.gnu.org/licenses/>. | ||
| +*/ | ||
| +/** | ||
| + * \file aes128_enc.h | ||
| + * \email daniel.otte@rub.de | ||
| + * \author Daniel Otte | ||
| + * \date 2008-12-30 | ||
| + * \license GPLv3 or later | ||
| + * \ingroup AES | ||
| + */ | ||
| + | ||
| +#ifndef AES128_ENC_H_ | ||
| +#define AES128_ENC_H_ | ||
| + | ||
| +#include "aes_types.h" | ||
| +#include "aes_enc.h" | ||
| + | ||
| + | ||
| +/** | ||
| + * \brief encrypt with 128 bit key. | ||
| + * | ||
| + * This function encrypts one block with the AES algorithm under control of | ||
| + * a keyschedule produced from a 128 bit key. | ||
| + * \param buffer pointer to the block to encrypt | ||
| + * \param ctx pointer to the key schedule | ||
| + */ | ||
| +void aes128_enc(void* buffer, aes128_ctx_t* ctx); | ||
| + | ||
| + | ||
| + | ||
| +#endif /* AES128_ENC_H_ */ |
46
aes192_dec.h
| @@ -0,0 +1,46 @@ | ||
| +/* aes192_dec.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 <http://www.gnu.org/licenses/>. | ||
| +*/ | ||
| +/** | ||
| + * \file aes192_dec.h | ||
| + * \email daniel.otte@rub.de | ||
| + * \author Daniel Otte | ||
| + * \date 2008-12-31 | ||
| + * \license GPLv3 or later | ||
| + * \ingroup AES | ||
| + */ | ||
| + | ||
| +#ifndef AES192_DEC_H_ | ||
| +#define AES192_DEC_H_ | ||
| + | ||
| +#include "aes_types.h" | ||
| +#include "aes_dec.h" | ||
| + | ||
| +/** | ||
| + * \brief decrypt with 192 bit key. | ||
| + * | ||
| + * This function decrypts one block with the AES algorithm under control of | ||
| + * a keyschedule produced from a 192 bit key. | ||
| + * \param buffer pointer to the block to decrypt | ||
| + * \param ctx pointer to the key schedule | ||
| + */ | ||
| +void aes192_dec(void* buffer, aes192_ctx_t* ctx); | ||
| + | ||
| + | ||
| + | ||
| +#endif /* AES192_DEC_H_ */ |
47
aes192_enc.h
| @@ -0,0 +1,47 @@ | ||
| +/* aes192_enc.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 <http://www.gnu.org/licenses/>. | ||
| +*/ | ||
| +/** | ||
| + * \file aes192_enc.h | ||
| + * \email daniel.otte@rub.de | ||
| + * \author Daniel Otte | ||
| + * \date 2008-12-31 | ||
| + * \license GPLv3 or later | ||
| + * \ingroup AES | ||
| + */ | ||
| + | ||
| +#ifndef AES192_ENC_H_ | ||
| +#define AES192_ENC_H_ | ||
| + | ||
| +#include "aes_types.h" | ||
| +#include "aes_enc.h" | ||
| + | ||
| + | ||
| +/** | ||
| + * \brief encrypt with 192 bit key. | ||
| + * | ||
| + * This function encrypts one block with the AES algorithm under control of | ||
| + * a keyschedule produced from a 192 bit key. | ||
| + * \param buffer pointer to the block to encrypt | ||
| + * \param ctx pointer to the key schedule | ||
| + */ | ||
| +void aes192_enc(void* buffer, aes192_ctx_t* ctx); | ||
| + | ||
| + | ||
| + | ||
| +#endif /* AES192_ENC_H_ */ |
46
aes256_dec.h
| @@ -0,0 +1,46 @@ | ||
| +/* aes256_dec.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 <http://www.gnu.org/licenses/>. | ||
| +*/ | ||
| +/** | ||
| + * \file aes256_dec.h | ||
| + * \email daniel.otte@rub.de | ||
| + * \author Daniel Otte | ||
| + * \date 2008-12-31 | ||
| + * \license GPLv3 or later | ||
| + * \ingroup AES | ||
| + */ | ||
| + | ||
| +#ifndef AES256_DEC_H_ | ||
| +#define AES256_DEC_H_ | ||
| + | ||
| +#include "aes_types.h" | ||
| +#include "aes_dec.h" | ||
| + | ||
| +/** | ||
| + * \brief decrypt with 256 bit key. | ||
| + * | ||
| + * This function decrypts one block with the AES algorithm under control of | ||
| + * a keyschedule produced from a 256 bit key. | ||
| + * \param buffer pointer to the block to decrypt | ||
| + * \param ctx pointer to the key schedule | ||
| + */ | ||
| +void aes256_dec(void* buffer, aes256_ctx_t* ctx); | ||
| + | ||
| + | ||
| + | ||
| +#endif /* AES256_DEC_H_ */ |
47
aes256_enc.h
| @@ -0,0 +1,47 @@ | ||
| +/* aes256_enc.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 <http://www.gnu.org/licenses/>. | ||
| +*/ | ||
| +/** | ||
| + * \file aes256_enc.h | ||
| + * \email daniel.otte@rub.de | ||
| + * \author Daniel Otte | ||
| + * \date 2008-12-31 | ||
| + * \license GPLv3 or later | ||
| + * \ingroup AES | ||
| + */ | ||
| + | ||
| +#ifndef AES256_ENC_H_ | ||
| +#define AES256_ENC_H_ | ||
| + | ||
| +#include "aes_types.h" | ||
| +#include "aes_enc.h" | ||
| + | ||
| + | ||
| +/** | ||
| + * \brief encrypt with 256 bit key. | ||
| + * | ||
| + * This function encrypts one block with the AES algorithm under control of | ||
| + * a keyschedule produced from a 256 bit key. | ||
| + * \param buffer pointer to the block to encrypt | ||
| + * \param ctx pointer to the key schedule | ||
| + */ | ||
| +void aes256_enc(void* buffer, aes256_ctx_t* ctx); | ||
| + | ||
| + | ||
| + | ||
| +#endif /* AES256_ENC_H_ */ |
Oops, something went wrong.
0 comments on commit
3533538