Skip to content

Commit

Permalink
First commit with a partial import of aes from crypto-lib
Browse files Browse the repository at this point in the history
  • Loading branch information
DavyLandman committed Feb 2, 2012
0 parents commit 3533538
Show file tree
Hide file tree
Showing 43 changed files with 3,242 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
aes/
gf256mul/
memxor/
bcal/
*.swp
*.o
.DS_Store
43 changes: 43 additions & 0 deletions aes.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/* aes.h */
/*
This file is part of the AVR-Crypto-Lib.
Copyright (C) 2008 Daniel Otte ([email protected])
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 [email protected]
* \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 changes: 46 additions & 0 deletions aes128_dec.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/* aes128_dec.h */
/*
This file is part of the AVR-Crypto-Lib.
Copyright (C) 2008 Daniel Otte ([email protected])
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 [email protected]
* \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 changes: 47 additions & 0 deletions aes128_enc.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/* aes128_enc.h */
/*
This file is part of the AVR-Crypto-Lib.
Copyright (C) 2008 Daniel Otte ([email protected])
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 [email protected]
* \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 changes: 46 additions & 0 deletions aes192_dec.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/* aes192_dec.h */
/*
This file is part of the AVR-Crypto-Lib.
Copyright (C) 2008 Daniel Otte ([email protected])
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 [email protected]
* \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 changes: 47 additions & 0 deletions aes192_enc.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/* aes192_enc.h */
/*
This file is part of the AVR-Crypto-Lib.
Copyright (C) 2008 Daniel Otte ([email protected])
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 [email protected]
* \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 changes: 46 additions & 0 deletions aes256_dec.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/* aes256_dec.h */
/*
This file is part of the AVR-Crypto-Lib.
Copyright (C) 2008 Daniel Otte ([email protected])
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 [email protected]
* \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 changes: 47 additions & 0 deletions aes256_enc.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/* aes256_enc.h */
/*
This file is part of the AVR-Crypto-Lib.
Copyright (C) 2008 Daniel Otte ([email protected])
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 [email protected]
* \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_ */
Loading

0 comments on commit 3533538

Please sign in to comment.