This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Explore hashlib use of the Windows Crypto API NG
Type: performance Stage:
Components: Extension Modules, Windows Versions:
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: corona10, gregory.p.smith, paul.moore, steve.dower, tim.golden, zach.ware
Priority: normal Keywords:

Created on 2022-03-26 00:53 by gregory.p.smith, last changed 2022-04-11 14:59 by admin.

Messages (2)
msg416033 - (view) Author: Gregory P. Smith (gregory.p.smith) * (Python committer) Date: 2022-03-26 00:53
https://docs.microsoft.com/en-us/windows/win32/seccng/creating-a-hash-with-cng

See if these are worthwhile vs using OpenSSL for the hashlib algorithms it supports.  OS APIs can in theory take better advantage of HW acceleration for performance.  Verify this on supported architectures.  Regardless it would allow some things to be fast if someone wanted to use a build without OpenSSL.

I'm not a Windows or Microsoft user.  I'm filing this for completeness, someone else would need to do the work.

similar macOS issue: https://bugs.python.org/issue47124
similar Linux issue: https://bugs.python.org/issue47102
msg416181 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2022-03-28 16:13
Did a basic test (with timeit and a work-internal library I already have) and the native functionality is *slightly* faster than OpenSSL.

But I think it's worthwhile anyway, to help reduce our dependency on OpenSSL.
History
Date User Action Args
2022-04-11 14:59:57adminsetgithub: 91281
2022-03-29 01:50:03corona10setnosy: + corona10
2022-03-28 16:13:36steve.dowersetmessages: + msg416181
2022-03-26 00:53:13gregory.p.smithcreate