38#ifndef __ARCH_ARM_INSTS_CRYPTO_HH__
39#define __ARCH_ARM_INSTS_CRYPTO_HH__
83 return ((
a & 0x80) ? ((
a << 1) ^ 0x1b) : (
a << 1));
97 uint32_t
choose(uint32_t X, uint32_t Y, uint32_t Z)
99 return (((Y ^ Z) & X) ^ Z);
102 uint32_t
parity(uint32_t X, uint32_t Y, uint32_t Z)
107 uint32_t
majority(uint32_t X, uint32_t Y, uint32_t Z)
109 return ((X & Y) | ((X | Y) & Z));
122 void sha256Op(uint32_t *X, uint32_t *Y, uint32_t *Z);
126 void load2Reg(uint32_t *X, uint32_t *Y, uint8_t *
output, uint8_t *input);
127 void load3Reg(uint32_t *X, uint32_t *Y, uint32_t *Z,
128 uint8_t *
output, uint8_t *input, uint8_t *input2);
136 void sha256H(uint8_t *
output, uint8_t *input, uint8_t *input2);
141 void sha1C(uint8_t *
output, uint8_t *input, uint8_t *input2);
142 void sha1P(uint8_t *
output, uint8_t *input, uint8_t *input2);
143 void sha1M(uint8_t *
output, uint8_t *input, uint8_t *input2);
145 void sha1Su0(uint8_t *
output, uint8_t *input, uint8_t *input2);
static const uint8_t aesSHIFT[16]
uint32_t sigma1(uint32_t X)
void load2Reg(uint32_t *X, uint32_t *Y, uint8_t *output, uint8_t *input)
void aesSubBytes(uint8_t *output, uint8_t *input)
static const uint8_t aesSBOX[256]
Look up table for subByttes transformation.
void aesInvShiftRows(uint8_t *output, uint8_t *input)
void sha1Su1(uint8_t *output, uint8_t *input)
void sha1C(uint8_t *output, uint8_t *input, uint8_t *input2)
void aesShiftRows(uint8_t *output, uint8_t *input)
void aesDecrypt(uint8_t *output, uint8_t *input, uint8_t *key)
void sha1Op(uint8_t *output, uint8_t *input, uint8_t *input2, SHAOp op)
void aesMixColumns(uint8_t *output, uint8_t *input)
uint32_t parity(uint32_t X, uint32_t Y, uint32_t Z)
uint32_t sigma0(uint32_t X)
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)
uint8_t aesFFMul2(uint8_t a)
uint32_t majority(uint32_t X, uint32_t Y, uint32_t Z)
void sha256Su0(uint8_t *output, uint8_t *input)
static const uint8_t aesInvSBOX[256]
Look up table for inverse subBytes transformation.
void sha256H(uint8_t *output, uint8_t *input, uint8_t *input2)
void sha1H(uint8_t *output, uint8_t *input)
void sha256Op(uint32_t *X, uint32_t *Y, uint32_t *Z)
uint32_t ror(uint32_t x, uint8_t shift)
void sha1P(uint8_t *output, uint8_t *input, uint8_t *input2)
void sha1Su0(uint8_t *output, uint8_t *input, uint8_t *input2)
static const uint8_t aesINVSHIFT[16]
void sha256Su1(uint8_t *output, uint8_t *input, uint8_t *input2)
void aesAddRoundKey(uint8_t *output, uint8_t *input, uint8_t *key)
void sha1M(uint8_t *output, uint8_t *input, uint8_t *input2)
void _sha1Op(uint32_t *X, uint32_t *Y, uint32_t *Z, SHAOp op)
void aesInvSubBytes(uint8_t *output, uint8_t *input)
static const uint8_t aesFFEXP[256]
Look up table for {03}^X where {03} and X are elements in the filed G(256)
uint32_t choose(uint32_t X, uint32_t Y, uint32_t Z)
void sha256H2(uint8_t *output, uint8_t *input, uint8_t *input2)
void load3Reg(uint32_t *X, uint32_t *Y, uint32_t *Z, uint8_t *output, uint8_t *input, uint8_t *input2)
uint8_t aesFFMul(uint8_t a, uint8_t b)
Finite field multiplication of two elements in the field G(256)
void aesInvMixColumns(uint8_t *output, uint8_t *input)
void store1Reg(uint8_t *output, uint32_t *X)
void aesEncrypt(uint8_t *output, uint8_t *input, uint8_t *key)
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
static void output(const char *filename)