scripts/crypto/gen-hash-testvecs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
'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: 15c64c47e484 ("lib/crypto: tests: Add SHA3 kunit tests")
Signed-off-by: Jie Zhan <zhanjie9@hisilicon.com>
---
scripts/crypto/gen-hash-testvecs.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/crypto/gen-hash-testvecs.py b/scripts/crypto/gen-hash-testvecs.py
index c1d0517140bd..c773294fba64 100755
--- a/scripts/crypto/gen-hash-testvecs.py
+++ b/scripts/crypto/gen-hash-testvecs.py
@@ -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('')
--
2.33.0
On Wed, Jan 07, 2026 at 09:58:29AM +0800, Jie Zhan wrote:
> '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: 15c64c47e484 ("lib/crypto: tests: Add SHA3 kunit tests")
> Signed-off-by: Jie Zhan <zhanjie9@hisilicon.com>
> ---
> scripts/crypto/gen-hash-testvecs.py | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
I'll apply this, but it's weird that 'make binrpm-pkg' is doing anything
with this script. It's not executed during the kernel build process.
It's only run manually to generate some files that are checked in
elsewhere in the tree.
- Eric
On Tue, Jan 06, 2026 at 07:30:19PM -0800, Eric Biggers wrote:
> On Wed, Jan 07, 2026 at 09:58:29AM +0800, Jie Zhan wrote:
> > '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: 15c64c47e484 ("lib/crypto: tests: Add SHA3 kunit tests")
> > Signed-off-by: Jie Zhan <zhanjie9@hisilicon.com>
> > ---
> > scripts/crypto/gen-hash-testvecs.py | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
>
> I'll apply this, but it's weird that 'make binrpm-pkg' is doing anything
> with this script. It's not executed during the kernel build process.
> It's only run manually to generate some files that are checked in
> elsewhere in the tree.
>
> - Eric
Applied to https://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/linux.git/log/?h=libcrypto-fixes
- Eric
© 2016 - 2026 Red Hat, Inc.