Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def sbox_output(self):
"""SBox Output."""
return AES128_8bit(aes128_leakage.SBox_output)
def round_1_2_state_diff_sbox(self):
"""Hamming distance between round 1 and 2 state during sbox lookup
operation.
"""
return AES128_8bit(aes128_leakage.Round1Round2StateDiff_SBox)
def sbox_input_successive(self):
"""Successive Sbox input."""
return AES128_8bit(aes128_leakage.SBoxInputSuccessive)
def plaintext_key_xor(self):
"""Plain text key XOR."""
return AES128_8bit(aes128_leakage.PtKey_XOR)
def inverse_sbox_output(self):
"""Inverse Sbox output."""
return AES128_8bit(aes128_leakage.InvSBox_output)
def last_round_state_diff(self):
"""Last round state using hamming distance."""
return AES128_8bit(aes128_leakage.LastroundStateDiff)
def last_round_state(self):
"""Last round state."""
return AES128_8bit(aes128_leakage.LastroundHW)
def last_round_state_diff_alternate(self):
"""Last round state using hamming distance, alternate."""
return AES128_8bit(aes128_leakage.LastroundStateDiffAlternate)
def mix_columns_output(self):
"""Output of the mix columns operation."""
return AES128_8bit(aes128_leakage.Mixcolumns_output)
def getPartitionNum(self, trace, tnum):
key = trace.getKnownKey(tnum)
text = trace.getTextin(tnum)
guess = [0] * 16
for i in range(0, 16):
guess[i] = AES128_8bit.getHW(sbox(text[i] ^ key[i]))
return guess