gem5 v24.0.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) | |
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. | |
static const uint8_t | aesInvSBOX [256] |
Look up table for inverse subBytes transformation. | |
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) | |
static const uint8_t | aesFFEXP [256] |
Look up table for {03}^X where {03} and X are elements in the filed G(256) | |
|
private |
|
private |
Definition at line 298 of file crypto.cc.
References CHOOSE, choose(), gem5::ArmISA::i, MAJORITY, majority(), gem5::X86ISA::op, PARITY, parity(), and ror().
Referenced by sha1Op().
|
private |
Definition at line 213 of file crypto.cc.
References gem5::ArmISA::i, and gem5::output().
Referenced by aesDecrypt(), and aesEncrypt().
void gem5::ArmISA::Crypto::aesDecrypt | ( | uint8_t * | output, |
uint8_t * | input, | ||
uint8_t * | key ) |
Definition at line 267 of file crypto.cc.
References aesAddRoundKey(), aesInvShiftRows(), aesInvSubBytes(), and gem5::output().
void gem5::ArmISA::Crypto::aesEncrypt | ( | uint8_t * | output, |
uint8_t * | input, | ||
uint8_t * | key ) |
Definition at line 256 of file crypto.cc.
References aesAddRoundKey(), aesShiftRows(), aesSubBytes(), and gem5::output().
|
private |
Finite field multiplication of two elements in the field G(256)
Definition at line 166 of file crypto.cc.
References gem5::ArmISA::a, aesFFEXP, aesFFLOG, and gem5::ArmISA::b.
Referenced by aesInvMixColumns().
|
inlineprivate |
void gem5::ArmISA::Crypto::aesInvMixColumns | ( | uint8_t * | output, |
uint8_t * | input ) |
Definition at line 240 of file crypto.cc.
References aesFFMul(), gem5::ArmISA::i, and gem5::output().
|
private |
Definition at line 205 of file crypto.cc.
References aesINVSHIFT, gem5::ArmISA::i, and gem5::output().
Referenced by aesDecrypt().
|
private |
Definition at line 189 of file crypto.cc.
References aesInvSBOX, gem5::ArmISA::i, and gem5::output().
Referenced by aesDecrypt().
void gem5::ArmISA::Crypto::aesMixColumns | ( | uint8_t * | output, |
uint8_t * | input ) |
Definition at line 222 of file crypto.cc.
References aesFFMul2(), gem5::output(), and gem5::ArmISA::t1.
|
private |
Definition at line 197 of file crypto.cc.
References aesSHIFT, gem5::ArmISA::i, and gem5::output().
Referenced by aesEncrypt().
|
private |
Definition at line 181 of file crypto.cc.
References aesSBOX, gem5::ArmISA::i, and gem5::output().
Referenced by aesEncrypt().
|
inlineprivate |
Definition at line 97 of file crypto.hh.
Referenced by _sha1Op(), and sha256Op().
|
private |
Definition at line 479 of file crypto.cc.
References gem5::ArmISA::i, and gem5::output().
Referenced by sha1H(), sha1Su1(), and sha256Su0().
|
private |
Definition at line 492 of file crypto.cc.
References gem5::ArmISA::i, and gem5::output().
Referenced by sha1Op(), sha1Su0(), sha256H(), sha256H2(), and sha256Su1().
|
inlineprivate |
Definition at line 107 of file crypto.hh.
Referenced by _sha1Op(), and sha256Op().
|
inlineprivate |
|
inlineprivate |
Definition at line 92 of file crypto.hh.
References gem5::ArmISA::shift, and gem5::RiscvISA::x.
Referenced by _sha1Op(), sha1H(), sha1Su1(), sha256Su0(), sha256Su1(), sigma0(), and sigma1().
void gem5::ArmISA::Crypto::sha1C | ( | uint8_t * | output, |
uint8_t * | input, | ||
uint8_t * | input2 ) |
Definition at line 409 of file crypto.cc.
References CHOOSE, gem5::output(), and sha1Op().
void gem5::ArmISA::Crypto::sha1H | ( | uint8_t * | output, |
uint8_t * | input ) |
Definition at line 436 of file crypto.cc.
References load2Reg(), gem5::output(), ror(), and store1Reg().
void gem5::ArmISA::Crypto::sha1M | ( | uint8_t * | output, |
uint8_t * | input, | ||
uint8_t * | input2 ) |
Definition at line 427 of file crypto.cc.
References MAJORITY, gem5::output(), and sha1Op().
|
private |
Definition at line 396 of file crypto.cc.
References _sha1Op(), load3Reg(), gem5::X86ISA::op, gem5::output(), and store1Reg().
void gem5::ArmISA::Crypto::sha1P | ( | uint8_t * | output, |
uint8_t * | input, | ||
uint8_t * | input2 ) |
Definition at line 418 of file crypto.cc.
References gem5::output(), PARITY, and sha1Op().
void gem5::ArmISA::Crypto::sha1Su0 | ( | uint8_t * | output, |
uint8_t * | input, | ||
uint8_t * | input2 ) |
Definition at line 445 of file crypto.cc.
References load3Reg(), gem5::output(), and store1Reg().
void gem5::ArmISA::Crypto::sha1Su1 | ( | uint8_t * | output, |
uint8_t * | input ) |
Definition at line 463 of file crypto.cc.
References load2Reg(), gem5::output(), ror(), and store1Reg().
void gem5::ArmISA::Crypto::sha256H | ( | uint8_t * | output, |
uint8_t * | input, | ||
uint8_t * | input2 ) |
Definition at line 322 of file crypto.cc.
References load3Reg(), gem5::output(), sha256Op(), and store1Reg().
void gem5::ArmISA::Crypto::sha256H2 | ( | uint8_t * | output, |
uint8_t * | input, | ||
uint8_t * | input2 ) |
Definition at line 334 of file crypto.cc.
References load3Reg(), gem5::output(), sha256Op(), and store1Reg().
|
private |
Definition at line 278 of file crypto.cc.
References choose(), gem5::ArmISA::i, majority(), sigma0(), and sigma1().
Referenced by sha256H(), and sha256H2().
void gem5::ArmISA::Crypto::sha256Su0 | ( | uint8_t * | output, |
uint8_t * | input ) |
Definition at line 346 of file crypto.cc.
References load2Reg(), gem5::output(), ror(), and store1Reg().
void gem5::ArmISA::Crypto::sha256Su1 | ( | uint8_t * | output, |
uint8_t * | input, | ||
uint8_t * | input2 ) |
Definition at line 369 of file crypto.cc.
References load3Reg(), gem5::output(), ror(), and store1Reg().
|
inlineprivate |
|
inlineprivate |
|
private |
Definition at line 508 of file crypto.cc.
References gem5::ArmISA::i, and gem5::output().
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 76 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 70 of file crypto.hh.
Referenced by aesFFMul().
|
staticprivate |
Look up table for inverse subBytes transformation.
Definition at line 61 of file crypto.hh.
Referenced by aesInvSubBytes().
|
staticprivate |
Definition at line 64 of file crypto.hh.
Referenced by aesInvShiftRows().
|
staticprivate |
Look up table for subByttes transformation.
Definition at line 58 of file crypto.hh.
Referenced by aesSubBytes().
|
staticprivate |
Definition at line 63 of file crypto.hh.
Referenced by aesShiftRows().