Merge pull request #869 from betrusted-io/clean-base-pddbci-2

apply a clean patch of the changes required to fix ci
This commit is contained in:
bunnie 2026-05-06 09:33:44 +02:00 committed by GitHub
commit 9cfb409f6b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 21 additions and 19 deletions

View file

@ -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',

View file

@ -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)

View file

@ -363,6 +363,8 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
.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") => {