]> git.cryptolib.org Git - avr-crypto-lib.git/blobdiff - des.c
some changings to make API more consistent
[avr-crypto-lib.git] / des.c
diff --git a/des.c b/des.c
index dc16750e91ad68f0d13b30ce447a4c1de8834d0b..33e6a76be96a707f5d1d50c0cbb1b239410d6e3b 100644 (file)
--- a/des.c
+++ b/des.c
     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"
@@ -301,7 +302,7 @@ uint32_t des_f(uint32_t r, uint8_t* kr){
 
 /******************************************************************************/
 
-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]))
 
@@ -334,7 +335,7 @@ void des_encrypt(uint8_t* out, uint8_t* in, uint8_t* key){
 
 /******************************************************************************/
 
-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]))
 
@@ -370,18 +371,18 @@ void des_decrypt(uint8_t* out, uint8_t* in, uint8_t* key){
 
 /******************************************************************************/
 
-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);
 }
 
 /******************************************************************************/