Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explore hashlib use of the Windows Crypto API NG #91281

Open
gpshead opened this issue Mar 26, 2022 · 2 comments
Open

Explore hashlib use of the Windows Crypto API NG #91281

gpshead opened this issue Mar 26, 2022 · 2 comments
Labels
3.13 new features, bugs and security fixes extension-modules C modules in the Modules dir OS-windows performance Performance or resource usage type-feature A feature request or enhancement

Comments

@gpshead
Copy link
Member

gpshead commented Mar 26, 2022

BPO 47125
Nosy @gpshead, @pfmoore, @tjguk, @zware, @zooba, @corona10

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = None
created_at = <Date 2022-03-26.00:53:13.596>
labels = ['extension-modules', 'OS-windows', 'performance']
title = 'Explore hashlib use of the Windows Crypto API NG'
updated_at = <Date 2022-03-29.01:50:03.983>
user = 'https://github.com/gpshead'

bugs.python.org fields:

activity = <Date 2022-03-29.01:50:03.983>
actor = 'corona10'
assignee = 'none'
closed = False
closed_date = None
closer = None
components = ['Extension Modules', 'Windows']
creation = <Date 2022-03-26.00:53:13.596>
creator = 'gregory.p.smith'
dependencies = []
files = []
hgrepos = []
issue_num = 47125
keywords = []
message_count = 2.0
messages = ['416033', '416181']
nosy_count = 6.0
nosy_names = ['gregory.p.smith', 'paul.moore', 'tim.golden', 'zach.ware', 'steve.dower', 'corona10']
pr_nums = []
priority = 'normal'
resolution = None
stage = None
status = 'open'
superseder = None
type = 'performance'
url = 'https://bugs.python.org/issue47125'
versions = []

@gpshead
Copy link
Member Author

gpshead commented Mar 26, 2022

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

@gpshead gpshead added extension-modules C modules in the Modules dir OS-windows performance Performance or resource usage labels Mar 26, 2022
@zooba
Copy link
Member

zooba commented Mar 28, 2022

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.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
@iritkatriel iritkatriel added type-feature A feature request or enhancement 3.12 bugs and security fixes labels Sep 10, 2022
@gpshead gpshead added 3.13 new features, bugs and security fixes and removed 3.12 bugs and security fixes labels May 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.13 new features, bugs and security fixes extension-modules C modules in the Modules dir OS-windows performance Performance or resource usage type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

3 participants