mirror of
https://github.com/open-quantum-safe/liboqs.git
synced 2025-10-07 00:10:54 -04:00
Fix nightly qtesla failure on gcc5 (#573)
This commit is contained in:
parent
b4b262281c
commit
d68bacfa58
@ -140,7 +140,7 @@ def available_use_options_by_name():
|
||||
with open(os.path.join('include', 'oqs', 'oqsconfig.h')) as fh:
|
||||
for line in fh:
|
||||
if line.startswith("#define USE_") and line.endswith("1\n"):
|
||||
option_name = line.split(' ')[1][len("USE_"):-1]
|
||||
option_name = line.split(' ')[1][len("USE_"):]
|
||||
enabled_use_options.append(option_name)
|
||||
return enabled_use_options
|
||||
|
||||
|
@ -28,10 +28,11 @@ def test_sig(sig_name):
|
||||
)
|
||||
output = output.replace("\r\n", "\n")
|
||||
kats = []
|
||||
avx2_aes_enabled = helpers.is_use_option_enabled_by_name('AVX2_INSTRUCTIONS') and helpers.is_use_option_enabled_by_name('AES_INSTRUCTIONS')
|
||||
for filename in os.listdir(os.path.join('tests', 'KATs', 'sig')):
|
||||
if filename.startswith(sig_name + '.') and filename.endswith('.kat'):
|
||||
# qtesla's avx2 implementation uses an optimized sampling method that results in different KAT values; we use the correct one
|
||||
if not sig_name.startswith('qTesla') or not (bool(helpers.is_use_option_enabled_by_name('AVX2_INSTRUCTION')) ^ bool('avx2' in filename)):
|
||||
# qtesla's avx2 implementation uses an optimized sampling method that results in different KAT values; we use the correct one (if avx2/aes instructions are available)
|
||||
if not (sig_name.startswith('qTesla')) or any([avx2_aes_enabled and 'avx2' in filename, not avx2_aes_enabled and not 'avx2' in filename]):
|
||||
with open(os.path.join('tests', 'KATs', 'sig', filename), 'r') as myfile:
|
||||
kats.append(myfile.read())
|
||||
assert(output in kats)
|
||||
|
Loading…
x
Reference in New Issue
Block a user