Get rid of src/cpu_aes.c, src/cpu_des.c, src/cpu_md5.c and src/cpu_sha256.c

This commit is contained in:
jsteube
2019-03-25 15:54:58 +01:00
parent fb8a9d7c40
commit 5b667d2c01
45 changed files with 536 additions and 2550 deletions
-16
View File
@@ -1,16 +0,0 @@
/**
* Author......: See docs/credits.txt
* License.....: MIT
*/
#ifndef _CPU_AES_H
#define _CPU_AES_H
void AES_set_encrypt_key (const u8 *key, int keysize, AES_KEY *aes_key);
void AES_set_decrypt_key (const u8 *key, int keysize, AES_KEY *aes_key);
void AES_encrypt (AES_KEY *aes_key, const u8 *input, u8 *output);
void AES_decrypt (AES_KEY *aes_key, const u8 *input, u8 *output);
void AES128_decrypt_cbc (const u32 key[4], const u32 iv[4], const u32 in[16], u32 out[16]);
#endif // _CPU_AES_H
-9
View File
@@ -1,9 +0,0 @@
/**
* Author......: See docs/credits.txt
* License.....: MIT
*/
#ifndef _CPU_BLAKE2_H
#define _CPU_BLAKE2_H
#endif // _CPU_BLAKE2_H
-52
View File
@@ -1,52 +0,0 @@
/**
* Author......: See docs/credits.txt
* License.....: MIT
*/
#ifndef _CPU_DES_H
#define _CPU_DES_H
#define PERM_OP(a,b,n,m) \
{ \
u32 t; \
t = a >> n; \
t = t ^ b; \
t = t & m; \
b = b ^ t; \
t = t << n; \
a = a ^ t; \
}
#define HPERM_OP(a,n,m) \
{ \
u32 t; \
t = a << (16 + n); \
t = t ^ a; \
t = t & m; \
a = a ^ t; \
t = t >> (16 + n); \
a = a ^ t; \
}
#define DES_IP(l,r) \
{ \
PERM_OP (r, l, 4, 0x0f0f0f0f); \
PERM_OP (l, r, 16, 0x0000ffff); \
PERM_OP (r, l, 2, 0x33333333); \
PERM_OP (l, r, 8, 0x00ff00ff); \
PERM_OP (r, l, 1, 0x55555555); \
}
#define DES_FP(l,r) \
{ \
PERM_OP (l, r, 1, 0x55555555); \
PERM_OP (r, l, 8, 0x00ff00ff); \
PERM_OP (l, r, 2, 0x33333333); \
PERM_OP (r, l, 16, 0x0000ffff); \
PERM_OP (l, r, 4, 0x0f0f0f0f); \
}
void _des_keysetup (const u32 data[2], u32 Kc[16], u32 Kd[16]);
void _des_encrypt (u32 data[2], const u32 Kc[16], const u32 Kd[16]);
#endif // _CPU_DES_H
-14
View File
@@ -1,14 +0,0 @@
/**
* Author......: See docs/credits.txt
* License.....: MIT
*/
#ifndef _CPU_MD5_H
#define _CPU_MD5_H
#include <string.h>
void md5_64 (const u32 block[16], u32 digest[4]);
void md5_complete_no_limit (u32 digest[4], const u32 *plain, const u32 plain_len);
#endif // _CPU_MD5_H
-11
View File
@@ -1,11 +0,0 @@
/**
* Author......: See docs/credits.txt
* License.....: MIT
*/
#ifndef _CPU_SHA256_H
#define _CPU_SHA256_H
void sha256_64 (const u32 block[16], u32 digest[8]);
#endif // _CPU_SHA256_H
+21
View File
@@ -0,0 +1,21 @@
/**
* Author......: See docs/credits.txt
* License.....: MIT
*/
#ifndef _EMU_INC_CIPHER_AES_H
#define _EMU_INC_CIPHER_AES_H
#include "emu_general.h"
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-variable"
#pragma GCC diagnostic ignored "-Wunused-parameter"
#pragma GCC diagnostic ignored "-Wunknown-pragmas"
#include "inc_vendor.h"
#include "inc_cipher_aes.h"
#pragma GCC diagnostic pop
#endif // _EMU_INC_CIPHER_AES_H
+21
View File
@@ -0,0 +1,21 @@
/**
* Author......: See docs/credits.txt
* License.....: MIT
*/
#ifndef _EMU_INC_CIPHER_DES_H
#define _EMU_INC_CIPHER_DES_H
#include "emu_general.h"
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-variable"
#pragma GCC diagnostic ignored "-Wunused-parameter"
#pragma GCC diagnostic ignored "-Wunknown-pragmas"
#include "inc_vendor.h"
#include "inc_cipher_des.h"
#pragma GCC diagnostic pop
#endif // _EMU_INC_CIPHER_DES_H
-6
View File
@@ -8,12 +8,6 @@
#include "emu_general.h"
#define DGST_ELEM 4
#define DGST_R0 0
#define DGST_R1 1
#define DGST_R2 2
#define DGST_R3 3
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-variable"
#pragma GCC diagnostic ignored "-Wunused-parameter"
+21
View File
@@ -0,0 +1,21 @@
/**
* Author......: See docs/credits.txt
* License.....: MIT
*/
#ifndef _EMU_INC_HASH_MD5_H
#define _EMU_INC_HASH_MD5_H
#include "emu_general.h"
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-variable"
#pragma GCC diagnostic ignored "-Wunused-parameter"
#pragma GCC diagnostic ignored "-Wunknown-pragmas"
#include "inc_vendor.h"
#include "inc_hash_md5.h"
#pragma GCC diagnostic pop
#endif // _EMU_INC_HASH_MD5_H
-6
View File
@@ -8,12 +8,6 @@
#include "emu_general.h"
#define DGST_ELEM 4
#define DGST_R0 0
#define DGST_R1 1
#define DGST_R2 2
#define DGST_R3 3
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-variable"
#pragma GCC diagnostic ignored "-Wunused-parameter"
+21
View File
@@ -0,0 +1,21 @@
/**
* Author......: See docs/credits.txt
* License.....: MIT
*/
#ifndef _EMU_INC_HASH_SHA256_H
#define _EMU_INC_HASH_SHA256_H
#include "emu_general.h"
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-variable"
#pragma GCC diagnostic ignored "-Wunused-parameter"
#pragma GCC diagnostic ignored "-Wunknown-pragmas"
#include "inc_vendor.h"
#include "inc_hash_sha256.h"
#pragma GCC diagnostic pop
#endif // _EMU_INC_HASH_SHA256_H
+21
View File
@@ -0,0 +1,21 @@
/**
* Author......: See docs/credits.txt
* License.....: MIT
*/
#ifndef _EMU_INC_HASH_SHA512_H
#define _EMU_INC_HASH_SHA512_H
#include "emu_general.h"
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-variable"
#pragma GCC diagnostic ignored "-Wunused-parameter"
#pragma GCC diagnostic ignored "-Wunknown-pragmas"
#include "inc_vendor.h"
#include "inc_hash_sha512.h"
#pragma GCC diagnostic pop
#endif // _EMU_INC_HASH_SHA512_H
-6
View File
@@ -8,12 +8,6 @@
#include "emu_general.h"
#define DGST_ELEM 4
#define DGST_R0 0
#define DGST_R1 1
#define DGST_R2 2
#define DGST_R3 3
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-variable"
#pragma GCC diagnostic ignored "-Wunused-parameter"
-6
View File
@@ -8,12 +8,6 @@
#include "emu_general.h"
#define DGST_ELEM 4
#define DGST_R0 0
#define DGST_R1 1
#define DGST_R2 2
#define DGST_R3 3
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-variable"
#pragma GCC diagnostic ignored "-Wunused-parameter"