X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/76c7e6c36368c3fc23dc4fab1fe5852023c78fac..17ab9dcca02ae85e1f31b30eb74efec41a187917:/armsrc/des.h?ds=sidebyside diff --git a/armsrc/des.h b/armsrc/des.h index 652886fd..03b9f646 100644 --- a/armsrc/des.h +++ b/armsrc/des.h @@ -24,8 +24,11 @@ * \license GPLv3 or later * */ -#ifndef DES_H_ -#define DES_H_ +#ifndef __DES_H_ +#define __DES_H_ + +#include +#include /* the FIPS 46-3 (1999-10-25) name for triple DES is triple data encryption algorithm so TDEA. * Also we only implement the three key mode */ @@ -67,7 +70,8 @@ void des_enc(void* out, const void* in, const void* key); * \param in pointer to the block (64 bit = 8 byte) where the ciphertext is read from * \param key pointer to the key (64 bit = 8 byte) */ -void des_dec(void* out, const void* in, const void* key); +//void des_dec(void* out, const void* in, const void* key); +void des_dec(void* out, const void* in, const uint8_t* key); /** \fn void tdes_enc(void* out, const void* in, const void* key) * \brief encrypt a block with Tripple-DES @@ -81,7 +85,8 @@ void des_dec(void* out, const void* in, const void* key); * \param in pointer to the block (64 bit = 8 byte) where the plaintext is read from * \param key pointer to the key (192 bit = 24 byte) */ -void tdes_enc(void* out, const void* in, const void* key); +//void tdes_enc(void* out, const void* in, const void* key); +void tdes_enc(void* out, void* in, const void* key); /** \fn void tdes_dec(void* out, const void* in, const void* key) * \brief decrypt a block with Tripple-DES @@ -95,13 +100,16 @@ void tdes_enc(void* out, const void* in, const void* key); * \param in pointer to the block (64 bit = 8 byte) where the ciphertext is read from * \param key pointer to the key (192 bit = 24 byte) */ - void tdes_dec(void* out, const void* in, const void* key); - -#endif /*DES_H_*/ + //void tdes_dec(void* out, const void* in, const void* key); + void tdes_dec(void* out, void* in, const uint8_t* key); + + void tdes_2key_enc(void* out, const void* in, size_t length, const void* key, unsigned char iv[8]); + void tdes_2key_dec(void* out, const void* in, size_t length, const void* key, unsigned char iv[8]); // Copied from des.h in desfire imp. typedef unsigned long DES_KS[16][2]; /* Single-key DES key schedule */ typedef unsigned long DES3_KS[48][2]; /* Triple-DES key schedule */ - extern int Asmversion; /* 1 if we're linked with an asm version, 0 if C */ + +#endif /*DES_H_*/