gem5
v20.1.0.0
|
#include <crypto.hh>
Public Member Functions | |
void | aesMixColumns (uint8_t *output, uint8_t *input) |
void | aesInvMixColumns (uint8_t *output, uint8_t *input) |
void | aesEncrypt (uint8_t *output, uint8_t *input, uint8_t *key) |
void | aesDecrypt (uint8_t *output, uint8_t *input, uint8_t *key) |
void | sha256H (uint8_t *output, uint8_t *input, uint8_t *input2) |
void | sha256H2 (uint8_t *output, uint8_t *input, uint8_t *input2) |
void | sha256Su0 (uint8_t *output, uint8_t *input) |
void | sha256Su1 (uint8_t *output, uint8_t *input, uint8_t *input2) |
void | sha1C (uint8_t *output, uint8_t *input, uint8_t *input2) |
void | sha1P (uint8_t *output, uint8_t *input, uint8_t *input2) |
void | sha1M (uint8_t *output, uint8_t *input, uint8_t *input2) |
void | sha1H (uint8_t *output, uint8_t *input) |
void | sha1Su0 (uint8_t *output, uint8_t *input, uint8_t *input2) |
void | sha1Su1 (uint8_t *output, uint8_t *input) |
Private Types | |
enum | SHAOp : uint8_t { CHOOSE = 0, PARITY, MAJORITY } |
Private Member Functions | |
uint8_t | aesFFMul (uint8_t a, uint8_t b) |
Finite field multiplication of two elements in the field G(256) More... | |
uint8_t | aesFFMul2 (uint8_t a) |
void | aesSubBytes (uint8_t *output, uint8_t *input) |
void | aesInvSubBytes (uint8_t *output, uint8_t *input) |
void | aesShiftRows (uint8_t *output, uint8_t *input) |
void | aesInvShiftRows (uint8_t *output, uint8_t *input) |
void | aesAddRoundKey (uint8_t *output, uint8_t *input, uint8_t *key) |
uint32_t | ror (uint32_t x, uint8_t shift) |
uint32_t | choose (uint32_t X, uint32_t Y, uint32_t Z) |
uint32_t | parity (uint32_t X, uint32_t Y, uint32_t Z) |
uint32_t | majority (uint32_t X, uint32_t Y, uint32_t Z) |
uint32_t | sigma0 (uint32_t X) |
uint32_t | sigma1 (uint32_t X) |
void | sha256Op (uint32_t *X, uint32_t *Y, uint32_t *Z) |
void | sha1Op (uint8_t *output, uint8_t *input, uint8_t *input2, SHAOp op) |
void | _sha1Op (uint32_t *X, uint32_t *Y, uint32_t *Z, SHAOp op) |
void | load2Reg (uint32_t *X, uint32_t *Y, uint8_t *output, uint8_t *input) |
void | load3Reg (uint32_t *X, uint32_t *Y, uint32_t *Z, uint8_t *output, uint8_t *input, uint8_t *input2) |
void | store1Reg (uint8_t *output, uint32_t *X) |
Static Private Attributes | |
static const uint8_t | aesSBOX [256] |
Look up table for subByttes transformation. More... | |
static const uint8_t | aesInvSBOX [256] |
Look up table for inverse subBytes transformation. More... | |
static const uint8_t | aesSHIFT [16] |
static const uint8_t | aesINVSHIFT [16] |
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) More... | |
static const uint8_t | aesFFEXP [256] |
Look up table for {03}^X where {03} and X are elements in the filed G(256) More... | |
|
private |
|
private |
|
private |
Definition at line 210 of file crypto.cc.
References ArmISA::i, and output().
Referenced by aesDecrypt(), and aesEncrypt().
void ArmISA::Crypto::aesDecrypt | ( | uint8_t * | output, |
uint8_t * | input, | ||
uint8_t * | key | ||
) |
Definition at line 264 of file crypto.cc.
References aesAddRoundKey(), aesInvShiftRows(), aesInvSubBytes(), and output().
void ArmISA::Crypto::aesEncrypt | ( | uint8_t * | output, |
uint8_t * | input, | ||
uint8_t * | key | ||
) |
Definition at line 253 of file crypto.cc.
References aesAddRoundKey(), aesShiftRows(), aesSubBytes(), and output().
|
private |
|
inlineprivate |
void ArmISA::Crypto::aesInvMixColumns | ( | uint8_t * | output, |
uint8_t * | input | ||
) |
|
private |
Definition at line 202 of file crypto.cc.
References aesINVSHIFT, ArmISA::i, and output().
Referenced by aesDecrypt().
|
private |
Definition at line 186 of file crypto.cc.
References aesInvSBOX, ArmISA::i, and output().
Referenced by aesDecrypt().
void ArmISA::Crypto::aesMixColumns | ( | uint8_t * | output, |
uint8_t * | input | ||
) |
Definition at line 219 of file crypto.cc.
References aesFFMul2(), ArmISA::j, output(), and ArmISA::t1.
|
private |
|
private |
|
inlineprivate |
Definition at line 92 of file crypto.hh.
References X86ISA::X.
Referenced by _sha1Op(), and sha256Op().
|
private |
|
private |
Definition at line 489 of file crypto.cc.
References ArmISA::i, output(), and X86ISA::X.
Referenced by sha1Op(), sha1Su0(), sha256H(), sha256H2(), and sha256Su1().
|
inlineprivate |
Definition at line 102 of file crypto.hh.
References X86ISA::X.
Referenced by _sha1Op(), and sha256Op().
|
inlineprivate |
|
inlineprivate |
Definition at line 87 of file crypto.hh.
References ArmISA::shift, and RiscvISA::x.
Referenced by _sha1Op(), sha1H(), sha1Su1(), sha256Su0(), sha256Su1(), sigma0(), and sigma1().
void ArmISA::Crypto::sha1C | ( | uint8_t * | output, |
uint8_t * | input, | ||
uint8_t * | input2 | ||
) |
void ArmISA::Crypto::sha1H | ( | uint8_t * | output, |
uint8_t * | input | ||
) |
Definition at line 433 of file crypto.cc.
References load2Reg(), output(), ror(), store1Reg(), and X86ISA::X.
void ArmISA::Crypto::sha1M | ( | uint8_t * | output, |
uint8_t * | input, | ||
uint8_t * | input2 | ||
) |
|
private |
Definition at line 393 of file crypto.cc.
References _sha1Op(), load3Reg(), X86ISA::op, output(), store1Reg(), and X86ISA::X.
void ArmISA::Crypto::sha1P | ( | uint8_t * | output, |
uint8_t * | input, | ||
uint8_t * | input2 | ||
) |
void ArmISA::Crypto::sha1Su0 | ( | uint8_t * | output, |
uint8_t * | input, | ||
uint8_t * | input2 | ||
) |
Definition at line 442 of file crypto.cc.
References load3Reg(), output(), store1Reg(), and X86ISA::X.
void ArmISA::Crypto::sha1Su1 | ( | uint8_t * | output, |
uint8_t * | input | ||
) |
Definition at line 460 of file crypto.cc.
References load2Reg(), output(), ror(), store1Reg(), and X86ISA::X.
void ArmISA::Crypto::sha256H | ( | uint8_t * | output, |
uint8_t * | input, | ||
uint8_t * | input2 | ||
) |
Definition at line 319 of file crypto.cc.
References load3Reg(), output(), sha256Op(), store1Reg(), and X86ISA::X.
void ArmISA::Crypto::sha256H2 | ( | uint8_t * | output, |
uint8_t * | input, | ||
uint8_t * | input2 | ||
) |
Definition at line 331 of file crypto.cc.
References load3Reg(), output(), sha256Op(), store1Reg(), and X86ISA::X.
|
private |
Definition at line 275 of file crypto.cc.
References choose(), ArmISA::i, majority(), sigma0(), sigma1(), and X86ISA::X.
Referenced by sha256H(), and sha256H2().
void ArmISA::Crypto::sha256Su0 | ( | uint8_t * | output, |
uint8_t * | input | ||
) |
Definition at line 343 of file crypto.cc.
References load2Reg(), output(), ror(), store1Reg(), and X86ISA::X.
void ArmISA::Crypto::sha256Su1 | ( | uint8_t * | output, |
uint8_t * | input, | ||
uint8_t * | input2 | ||
) |
Definition at line 366 of file crypto.cc.
References load3Reg(), output(), ror(), store1Reg(), and X86ISA::X.
|
inlineprivate |
Definition at line 107 of file crypto.hh.
References ror(), and X86ISA::X.
Referenced by sha256Op().
|
inlineprivate |
Definition at line 112 of file crypto.hh.
References ror(), and X86ISA::X.
Referenced by sha256Op().
|
private |
Definition at line 505 of file crypto.cc.
References ArmISA::i, output(), and X86ISA::X.
Referenced by sha1H(), sha1Op(), sha1Su0(), sha1Su1(), sha256H(), sha256H2(), sha256Su0(), and sha256Su1().
|
staticprivate |
Look up table for {03}^X where {03} and X are elements in the filed G(256)
Definition at line 71 of file crypto.hh.
Referenced by aesFFMul().
|
staticprivate |
Look up table for Finite Field logarithm where the base is the element {03} in the field G(256)
Definition at line 65 of file crypto.hh.
Referenced by aesFFMul().
|
staticprivate |
Look up table for inverse subBytes transformation.
Definition at line 56 of file crypto.hh.
Referenced by aesInvSubBytes().
|
staticprivate |
Definition at line 59 of file crypto.hh.
Referenced by aesInvShiftRows().
|
staticprivate |
Look up table for subByttes transformation.
Definition at line 53 of file crypto.hh.
Referenced by aesSubBytes().
|
staticprivate |
Definition at line 58 of file crypto.hh.
Referenced by aesShiftRows().