]> git.zerfleddert.de Git - proxmark3-svn/blobdiff - armsrc/des.h
FIX: lf hitag : Mea culpa, simulation should not have reader_field on. thanks to...
[proxmark3-svn] / armsrc / des.h
index 853488c8c354c73a2e72af9392cb8b62dd98f09b..03b9f646947e1d27fcc599ef02c21099e9f5b9a3 100644 (file)
  * \license    GPLv3 or later
  * 
  */
-#ifndef DES_H_
-#define DES_H_
+#ifndef __DES_H_
+#define __DES_H_
+
+#include <stdint.h>
+#include <string.h>
 
 /* 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,16 +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);
+ //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);
- void tdes_2key_dec(void* out, const void* in, size_t length, const void* key);
-
-#endif /*DES_H_*/
+ 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_*/
Impressum, Datenschutz