File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -329,6 +329,25 @@ sk2 = make_key(b"2-"+seed) # different key
329329assert sk1a.to_string() != sk2.to_string()
330330```
331331
332+ In case the application will verify a lot of signatures made with a single
333+ key, it's possible to precompute some of the internal values to make
334+ signature verification significantly faster. The break-even point occurs at
335+ about 100 signatures verified.
336+
337+ To perform precomputation, you can call the ` precompute() ` method
338+ on ` VerifyingKey ` instance:
339+ ``` python
340+ from ecdsa import SigningKey, NIST384p
341+ sk = SigningKey.generate(curve = NIST384p)
342+ vk = sk.verifying_key
343+ vk.precompute()
344+ signature = sk.sign(b " message" )
345+ assert vk.verify(signature, b " message" )
346+ ```
347+
348+ Once ` precompute() ` was called, all signature verifications with this key will
349+ be faster to execute.
350+
332351## OpenSSL Compatibility
333352
334353To produce signatures that can be verified by OpenSSL tools, or to verify
You can’t perform that action at this time.
0 commit comments