Commit 0f42c2a5 authored by Jie Zhan's avatar Jie Zhan Committed by Eric Biggers
Browse files

lib/crypto: tests: Fix syntax error for old python versions



'make binrpm-pkg' throws me this error, with Python 3.9:

*** Error compiling '.../gen-hash-testvecs.py'...
  File ".../scripts/crypto/gen-hash-testvecs.py", line 121
    return f'{alg.upper().replace('-', '_')}_DIGEST_SIZE'
                                   ^
SyntaxError: f-string: unmatched '('

Old python versions, presumably <= 3.11, can't resolve these quotes.

Fix it with double quotes for compatibility.

Fixes: 15c64c47 ("lib/crypto: tests: Add SHA3 kunit tests")
Signed-off-by: default avatarJie Zhan <zhanjie9@hisilicon.com>
Link: https://lore.kernel.org/r/20260107015829.2000699-1-zhanjie9@hisilicon.com


Signed-off-by: default avatarEric Biggers <ebiggers@kernel.org>
parent fcff71fd
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -118,7 +118,7 @@ def print_c_struct_u8_array_field(name, value):
def alg_digest_size_const(alg):
    if alg.startswith('blake2'):
        return f'{alg.upper()}_HASH_SIZE'
    return f'{alg.upper().replace('-', '_')}_DIGEST_SIZE'
    return f"{alg.upper().replace('-', '_')}_DIGEST_SIZE"

def gen_unkeyed_testvecs(alg):
    print('')