mirror of
https://github.com/open-quantum-safe/liboqs.git
synced 2025-10-10 00:03:09 -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:
|
with open(os.path.join('include', 'oqs', 'oqsconfig.h')) as fh:
|
||||||
for line in fh:
|
for line in fh:
|
||||||
if line.startswith("#define USE_") and line.endswith("1\n"):
|
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)
|
enabled_use_options.append(option_name)
|
||||||
return enabled_use_options
|
return enabled_use_options
|
||||||
|
|
||||||
|
@ -28,10 +28,11 @@ def test_sig(sig_name):
|
|||||||
)
|
)
|
||||||
output = output.replace("\r\n", "\n")
|
output = output.replace("\r\n", "\n")
|
||||||
kats = []
|
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')):
|
for filename in os.listdir(os.path.join('tests', 'KATs', 'sig')):
|
||||||
if filename.startswith(sig_name + '.') and filename.endswith('.kat'):
|
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
|
# 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 not (bool(helpers.is_use_option_enabled_by_name('AVX2_INSTRUCTION')) ^ bool('avx2' in filename)):
|
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:
|
with open(os.path.join('tests', 'KATs', 'sig', filename), 'r') as myfile:
|
||||||
kats.append(myfile.read())
|
kats.append(myfile.read())
|
||||||
assert(output in kats)
|
assert(output in kats)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user