mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-21 09:14:34 +00:00
apply a clean patch of the changes required to fix ci
This commit is contained in:
parent
c105531e48
commit
213a011051
3 changed files with 21 additions and 19 deletions
|
|
@ -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
|
timeout = 20 # reset the timeout after the first run to something shorter, now that any potential compilation step is done
|
||||||
|
|
||||||
proc = subprocess.Popen(
|
proc = subprocess.Popen(
|
||||||
[sys.executable, './tools/pddbdbg.py', '--name', args.name],
|
[sys.executable, './tools/pddbdbg.py', '--name', args.name, '--ci'],
|
||||||
stdout=subprocess.PIPE,
|
stdout=subprocess.PIPE,
|
||||||
stderr=subprocess.STDOUT,
|
stderr=subprocess.STDOUT,
|
||||||
encoding='utf-8',
|
encoding='utf-8',
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@
|
||||||
# Rust crate, so, in the worst case, we just get some invalid diagnostic results.
|
# Rust crate, so, in the worst case, we just get some invalid diagnostic results.
|
||||||
|
|
||||||
import Crypto.Cipher.AES as AES
|
import Crypto.Cipher.AES as AES
|
||||||
import pyaesni
|
# import pyaesni
|
||||||
import binascii
|
import binascii
|
||||||
import six
|
import six
|
||||||
import struct
|
import struct
|
||||||
|
|
@ -156,20 +156,20 @@ def le_uint64(i):
|
||||||
|
|
||||||
class AES_GCM_SIV(object):
|
class AES_GCM_SIV(object):
|
||||||
def __init__(self, key_gen_key, nonce):
|
def __init__(self, key_gen_key, nonce):
|
||||||
#aes_obj = AES.new(key_gen_key, AES.MODE_ECB)
|
aes_obj = AES.new(key_gen_key, AES.MODE_ECB)
|
||||||
#msg_auth_key = aes_obj.encrypt(le_uint32(0) + nonce)[0:8] + \
|
msg_auth_key = aes_obj.encrypt(le_uint32(0) + nonce)[0:8] + \
|
||||||
# aes_obj.encrypt(le_uint32(1) + 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] + \
|
#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]
|
# 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] + \
|
msg_enc_key = aes_obj.encrypt(le_uint32(2) + nonce)[0:8] + \
|
||||||
# aes_obj.encrypt(le_uint32(3) + 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] + \
|
#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]
|
# pyaesni.cbc256_encrypt(le_uint32(3) + nonce, key_gen_key, bytearray(16))[0:8]
|
||||||
if len(key_gen_key) == 32:
|
if len(key_gen_key) == 32:
|
||||||
#msg_enc_key += aes_obj.encrypt(le_uint32(4) + nonce)[0:8] + \
|
msg_enc_key += aes_obj.encrypt(le_uint32(4) + nonce)[0:8] + \
|
||||||
# aes_obj.encrypt(le_uint32(5) + 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] + \
|
#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]
|
# pyaesni.cbc256_encrypt(le_uint32(5) + nonce, key_gen_key, bytearray(16))[0:8]
|
||||||
self.msg_auth_key = msg_auth_key
|
self.msg_auth_key = msg_auth_key
|
||||||
self.msg_enc_key = msg_enc_key
|
self.msg_enc_key = msg_enc_key
|
||||||
self.nonce = nonce
|
self.nonce = nonce
|
||||||
|
|
@ -183,8 +183,8 @@ class AES_GCM_SIV(object):
|
||||||
block = initial_block
|
block = initial_block
|
||||||
output = b''
|
output = b''
|
||||||
while len(inp) > 0:
|
while len(inp) > 0:
|
||||||
#keystream_block = AES.new(key, AES.MODE_ECB).encrypt(block)
|
keystream_block = AES.new(key, AES.MODE_ECB).encrypt(block)
|
||||||
keystream_block = pyaesni.cbc256_encrypt(block, key, bytearray(16))
|
#keystream_block = pyaesni.cbc256_encrypt(block, key, bytearray(16))
|
||||||
#print("aes")
|
#print("aes")
|
||||||
#print(binascii.hexlify(keystream_block))
|
#print(binascii.hexlify(keystream_block))
|
||||||
#print(binascii.hexlify(keystream_block_a))
|
#print(binascii.hexlify(keystream_block_a))
|
||||||
|
|
@ -236,8 +236,8 @@ class AES_GCM_SIV(object):
|
||||||
|
|
||||||
# Polyval/tag calculation
|
# Polyval/tag calculation
|
||||||
S_s = self._polyval_calc(plaintext, additional_data)
|
S_s = self._polyval_calc(plaintext, additional_data)
|
||||||
#tag = AES.new(self.msg_enc_key).encrypt(bytes(S_s))
|
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 = pyaesni.cbc256_encrypt(bytes(S_s), self.msg_enc_key, bytearray(16))
|
||||||
|
|
||||||
# Encrypt
|
# Encrypt
|
||||||
counter_block = bytearray(tag)
|
counter_block = bytearray(tag)
|
||||||
|
|
|
||||||
|
|
@ -363,6 +363,8 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||||
.target_hosted()
|
.target_hosted()
|
||||||
.add_services(&user_pkgs)
|
.add_services(&user_pkgs)
|
||||||
.add_feature("pddb/ci")
|
.add_feature("pddb/ci")
|
||||||
|
.add_feature("pddb/pddbtest")
|
||||||
|
.add_feature("pddb/autobasis")
|
||||||
.add_feature("pddb/deterministic");
|
.add_feature("pddb/deterministic");
|
||||||
}
|
}
|
||||||
Some("pddb-btest") => {
|
Some("pddb-btest") => {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue