38 #ifndef __ARCH_ARM_INSTS_CRYPTO_HH__ 39 #define __ARCH_ARM_INSTS_CRYPTO_HH__ 78 return ((a & 0x80) ? ((a << 1) ^ 0x1b) : (a << 1));
85 void aesAddRoundKey(uint8_t *output, uint8_t *input, uint8_t *key);
89 return (x >> shift) | (x << (32 -
shift));
92 uint32_t
choose(uint32_t
X, uint32_t Y, uint32_t Z)
94 return (((Y ^ Z) & X) ^ Z);
97 uint32_t
parity(uint32_t
X, uint32_t Y, uint32_t Z)
104 return ((X & Y) | ((X | Y) & Z));
117 void sha256Op(uint32_t *
X, uint32_t *Y, uint32_t *Z);
118 void sha1Op(uint8_t *output, uint8_t *input, uint8_t *input2,
SHAOp op);
119 void _sha1Op(uint32_t *X, uint32_t *Y, uint32_t *Z,
SHAOp op);
121 void load2Reg(uint32_t *X, uint32_t *Y, uint8_t *output, uint8_t *input);
122 void load3Reg(uint32_t *X, uint32_t *Y, uint32_t *Z,
123 uint8_t *output, uint8_t *input, uint8_t *input2);
124 void store1Reg(uint8_t *output, uint32_t *X);
129 void aesEncrypt(uint8_t *output, uint8_t *input, uint8_t *key);
130 void aesDecrypt(uint8_t *output, uint8_t *input, uint8_t *key);
131 void sha256H(uint8_t *output, uint8_t *input, uint8_t *input2);
132 void sha256H2(uint8_t *output, uint8_t *input, uint8_t *input2);
133 void sha256Su0(uint8_t *output, uint8_t *input);
134 void sha256Su1(uint8_t *output, uint8_t *input, uint8_t *input2);
136 void sha1C(uint8_t *output, uint8_t *input, uint8_t *input2);
137 void sha1P(uint8_t *output, uint8_t *input, uint8_t *input2);
138 void sha1M(uint8_t *output, uint8_t *input, uint8_t *input2);
139 void sha1H(uint8_t *output, uint8_t *input);
140 void sha1Su0(uint8_t *output, uint8_t *input, uint8_t *input2);
141 void sha1Su1(uint8_t *output, uint8_t *input);
146 #endif //__ARCH_ARM_INSTS_CRYPTO_HH__ void sha1C(uint8_t *output, uint8_t *input, uint8_t *input2)
void aesInvMixColumns(uint8_t *output, uint8_t *input)
static void output(const char *filename)
void aesShiftRows(uint8_t *output, uint8_t *input)
static const uint8_t aesINVSHIFT[16]
void sha1Op(uint8_t *output, uint8_t *input, uint8_t *input2, SHAOp op)
void sha1P(uint8_t *output, uint8_t *input, uint8_t *input2)
void sha256Su1(uint8_t *output, uint8_t *input, uint8_t *input2)
void sha256Op(uint32_t *X, uint32_t *Y, uint32_t *Z)
uint8_t aesFFMul(uint8_t a, uint8_t b)
Finite field multiplication of two elements in the field G(256)
uint32_t sigma0(uint32_t X)
void sha1H(uint8_t *output, uint8_t *input)
uint32_t parity(uint32_t X, uint32_t Y, uint32_t Z)
static const uint8_t aesSBOX[256]
Look up table for subByttes transformation.
void sha1Su0(uint8_t *output, uint8_t *input, uint8_t *input2)
uint32_t ror(uint32_t x, uint8_t shift)
void load3Reg(uint32_t *X, uint32_t *Y, uint32_t *Z, uint8_t *output, uint8_t *input, uint8_t *input2)
uint8_t aesFFMul2(uint8_t a)
void aesDecrypt(uint8_t *output, uint8_t *input, uint8_t *key)
void aesInvSubBytes(uint8_t *output, uint8_t *input)
void sha256Su0(uint8_t *output, uint8_t *input)
static const uint8_t aesFFLOG[256]
Look up table for Finite Field logarithm where the base is the element {03} in the field G(256) ...
uint32_t sigma1(uint32_t X)
void sha1M(uint8_t *output, uint8_t *input, uint8_t *input2)
uint32_t majority(uint32_t X, uint32_t Y, uint32_t Z)
static const uint8_t aesSHIFT[16]
void sha256H(uint8_t *output, uint8_t *input, uint8_t *input2)
static const uint8_t aesFFEXP[256]
Look up table for {03}^X where {03} and X are elements in the filed G(256)
void aesMixColumns(uint8_t *output, uint8_t *input)
void sha256H2(uint8_t *output, uint8_t *input, uint8_t *input2)
static const uint8_t aesInvSBOX[256]
Look up table for inverse subBytes transformation.
uint32_t choose(uint32_t X, uint32_t Y, uint32_t Z)
void aesEncrypt(uint8_t *output, uint8_t *input, uint8_t *key)
void aesInvShiftRows(uint8_t *output, uint8_t *input)
void _sha1Op(uint32_t *X, uint32_t *Y, uint32_t *Z, SHAOp op)
void sha1Su1(uint8_t *output, uint8_t *input)
void load2Reg(uint32_t *X, uint32_t *Y, uint8_t *output, uint8_t *input)
void aesSubBytes(uint8_t *output, uint8_t *input)
void store1Reg(uint8_t *output, uint32_t *X)
void aesAddRoundKey(uint8_t *output, uint8_t *input, uint8_t *key)