Skip to content

Commit 010ea89

Browse files
M1chaamoskopp
authored andcommitted
scripts/imgtool/keys: add test_sig_statistical
1 parent 82441bd commit 010ea89

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

scripts/imgtool/keys/imgtool_keys_pkcs11_test.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,21 @@ def test_env(self):
102102
self.assertRaises(pkcs11.exceptions.NoSuchKey,
103103
k.raw_sign, payload=b'test')
104104

105+
def test_sig_statistical(self):
106+
k = PKCS11()
107+
buf = b'This is the message'
108+
109+
total = 1750
110+
for n in range(total):
111+
sys.stdout.write(f'\rtest signature {n} / {total} ...')
112+
sys.stdout.flush()
113+
114+
sig = k.raw_sign(buf)
115+
116+
k.verify(
117+
signature=sig,
118+
payload=buf)
119+
105120

106121
if __name__ == '__main__':
107122
unittest.main()

0 commit comments

Comments
 (0)