diff --git a/tools/pddbci.py b/tools/pddbci.py index 4377ad932..143f62057 100755 --- a/tools/pddbci.py +++ b/tools/pddbci.py @@ -96,7 +96,7 @@ def main(): timeout = 20 # reset the timeout after the first run to something shorter, now that any potential compilation step is done proc = subprocess.Popen( - [sys.executable, './tools/pddbdbg.py', '--name', args.name], + [sys.executable, './tools/pddbdbg.py', '--name', args.name, '--ci'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT, encoding='utf-8', diff --git a/tools/rfc8452.py b/tools/rfc8452.py index d7eb4b1b9..0b47bcc05 100644 --- a/tools/rfc8452.py +++ b/tools/rfc8452.py @@ -15,7 +15,7 @@ # Rust crate, so, in the worst case, we just get some invalid diagnostic results. import Crypto.Cipher.AES as AES -import pyaesni +# import pyaesni import binascii import six import struct @@ -156,20 +156,20 @@ def le_uint64(i): class AES_GCM_SIV(object): def __init__(self, key_gen_key, nonce): - #aes_obj = AES.new(key_gen_key, AES.MODE_ECB) - #msg_auth_key = aes_obj.encrypt(le_uint32(0) + nonce)[0:8] + \ - # aes_obj.encrypt(le_uint32(1) + nonce)[0:8] - msg_auth_key = pyaesni.cbc256_encrypt(le_uint32(0) + nonce, key_gen_key, bytearray(16))[0:8] + \ - pyaesni.cbc256_encrypt((le_uint32(1) + nonce), key_gen_key, bytearray(16))[0:8] - #msg_enc_key = aes_obj.encrypt(le_uint32(2) + nonce)[0:8] + \ - # aes_obj.encrypt(le_uint32(3) + nonce)[0:8] - msg_enc_key = pyaesni.cbc256_encrypt(le_uint32(2) + nonce, key_gen_key, bytearray(16))[0:8] + \ - pyaesni.cbc256_encrypt(le_uint32(3) + nonce, key_gen_key, bytearray(16))[0:8] + aes_obj = AES.new(key_gen_key, AES.MODE_ECB) + msg_auth_key = aes_obj.encrypt(le_uint32(0) + nonce)[0:8] + \ + aes_obj.encrypt(le_uint32(1) + nonce)[0:8] + #msg_auth_key = pyaesni.cbc256_encrypt(le_uint32(0) + nonce, key_gen_key, bytearray(16))[0:8] + \ + # pyaesni.cbc256_encrypt((le_uint32(1) + nonce), key_gen_key, bytearray(16))[0:8] + msg_enc_key = aes_obj.encrypt(le_uint32(2) + nonce)[0:8] + \ + aes_obj.encrypt(le_uint32(3) + nonce)[0:8] + #msg_enc_key = pyaesni.cbc256_encrypt(le_uint32(2) + nonce, key_gen_key, bytearray(16))[0:8] + \ + # pyaesni.cbc256_encrypt(le_uint32(3) + nonce, key_gen_key, bytearray(16))[0:8] if len(key_gen_key) == 32: - #msg_enc_key += aes_obj.encrypt(le_uint32(4) + nonce)[0:8] + \ - # aes_obj.encrypt(le_uint32(5) + nonce)[0:8] - msg_enc_key += pyaesni.cbc256_encrypt(le_uint32(4) + nonce, key_gen_key, bytearray(16))[0:8] + \ - pyaesni.cbc256_encrypt(le_uint32(5) + nonce, key_gen_key, bytearray(16))[0:8] + msg_enc_key += aes_obj.encrypt(le_uint32(4) + nonce)[0:8] + \ + aes_obj.encrypt(le_uint32(5) + nonce)[0:8] + #msg_enc_key += pyaesni.cbc256_encrypt(le_uint32(4) + nonce, key_gen_key, bytearray(16))[0:8] + \ + # pyaesni.cbc256_encrypt(le_uint32(5) + nonce, key_gen_key, bytearray(16))[0:8] self.msg_auth_key = msg_auth_key self.msg_enc_key = msg_enc_key self.nonce = nonce @@ -183,8 +183,8 @@ class AES_GCM_SIV(object): block = initial_block output = b'' while len(inp) > 0: - #keystream_block = AES.new(key, AES.MODE_ECB).encrypt(block) - keystream_block = pyaesni.cbc256_encrypt(block, key, bytearray(16)) + keystream_block = AES.new(key, AES.MODE_ECB).encrypt(block) + #keystream_block = pyaesni.cbc256_encrypt(block, key, bytearray(16)) #print("aes") #print(binascii.hexlify(keystream_block)) #print(binascii.hexlify(keystream_block_a)) @@ -236,8 +236,8 @@ class AES_GCM_SIV(object): # Polyval/tag calculation S_s = self._polyval_calc(plaintext, additional_data) - #tag = AES.new(self.msg_enc_key).encrypt(bytes(S_s)) - tag = pyaesni.cbc256_encrypt(bytes(S_s), self.msg_enc_key, bytearray(16)) + tag = AES.new(self.msg_enc_key).encrypt(bytes(S_s)) + #tag = pyaesni.cbc256_encrypt(bytes(S_s), self.msg_enc_key, bytearray(16)) # Encrypt counter_block = bytearray(tag) diff --git a/xtask/src/main.rs b/xtask/src/main.rs index 624357c82..dd3443b05 100644 --- a/xtask/src/main.rs +++ b/xtask/src/main.rs @@ -363,6 +363,8 @@ fn main() -> Result<(), Box> { .target_hosted() .add_services(&user_pkgs) .add_feature("pddb/ci") + .add_feature("pddb/pddbtest") + .add_feature("pddb/autobasis") .add_feature("pddb/deterministic"); } Some("pddb-btest") => {