]> cvs.zerfleddert.de Git - proxmark3-svn/blobdiff - common/polarssl/libpcrypto.c
move from polarssl to mbedtls (#708)
[proxmark3-svn] / common / polarssl / libpcrypto.c
diff --git a/common/polarssl/libpcrypto.c b/common/polarssl/libpcrypto.c
deleted file mode 100644 (file)
index 032c3a1..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-//-----------------------------------------------------------------------------
-// Copyright (C) 2018 Merlok
-//
-// This code is licensed to you under the terms of the GNU GPL, version 2 or,
-// at your option, any later version. See the LICENSE.txt file for the text of
-// the license.
-//-----------------------------------------------------------------------------
-// crypto commands
-//-----------------------------------------------------------------------------
-
-#include "polarssl/libpcrypto.h"
-#include <polarssl/aes.h>
-
-int aes_encode(uint8_t *iv, uint8_t *key, uint8_t *input, uint8_t *output, int length){
-       uint8_t iiv[16] = {0};
-       if (iv)
-               memcpy(iiv, iv, 16);
-       
-       aes_context aes;
-       aes_init(&aes);
-       if (aes_setkey_enc(&aes, key, 128))
-               return 1;
-       if (aes_crypt_cbc(&aes, AES_ENCRYPT, length, iiv, input, output))
-               return 2;
-       aes_free(&aes);
-
-       return 0;
-}
-
-int aes_decode(uint8_t *iv, uint8_t *key, uint8_t *input, uint8_t *output, int length){
-       uint8_t iiv[16] = {0};
-       if (iv)
-               memcpy(iiv, iv, 16);
-       
-       aes_context aes;
-       aes_init(&aes);
-       if (aes_setkey_dec(&aes, key, 128))
-               return 1;
-       if (aes_crypt_cbc(&aes, AES_DECRYPT, length, iiv, input, output))
-               return 2;
-       aes_free(&aes);
-
-       return 0;
-}
\ No newline at end of file
Impressum, Datenschutz