+/* des.c */
+/*
+ This file is part of the Crypto-avr-lib/microcrypt-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 des.c
- * \author Daniel Otte
- * \date 2007-06-16
- * \brief DES and EDE-DES implementation
+ * \file des.c
+ * \author Daniel Otte
+ * \email daniel.otte@rub.de
+ * \date 2007-06-16
+ * \brief DES and EDE-DES implementation
* \par License
- * GPL
+ * GPLv3 or later
*
*/
#include "config.h"
/******************************************************************************/
-void des_encrypt(uint8_t* out, uint8_t* in, uint8_t* key){
+void des_enc(uint8_t* out, uint8_t* in, uint8_t* key){
#define R *((uint32_t*)&(data[4]))
#define L *((uint32_t*)&(data[0]))
/******************************************************************************/
-void des_decrypt(uint8_t* out, uint8_t* in, uint8_t* key){
+void des_dec(uint8_t* out, uint8_t* in, uint8_t* key){
#define R *((uint32_t*)&(data[4]))
#define L *((uint32_t*)&(data[0]))
/******************************************************************************/
-void tdes_encrypt(uint8_t* out, uint8_t* in, uint8_t* key){
- des_encrypt(out, in, key + 0);
- des_decrypt(out, out, key + 8);
- des_encrypt(out, out, key +16);
+void tdes_enc(uint8_t* out, uint8_t* in, uint8_t* key){
+ des_enc(out, in, key + 0);
+ des_dec(out, out, key + 8);
+ des_enc(out, out, key +16);
}
/******************************************************************************/
-void tdes_decrypt(uint8_t* out, uint8_t* in, uint8_t* key){
- des_decrypt(out, in, key + 0);
- des_encrypt(out, out, key + 8);
- des_decrypt(out, out, key +16);
+void tdes_dec(uint8_t* out, uint8_t* in, uint8_t* key){
+ des_dec(out, in, key + 0);
+ des_enc(out, out, key + 8);
+ des_dec(out, out, key +16);
}
/******************************************************************************/