GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-99108: Refactor _sha256 & _sha512 into _sha2. by gpshead · Pull Request #101924 · python/cpython

Conversation

@gpshead

@gpshead gpshead commented Feb 15, 2023 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

This merges their code. They're backed by the same single HACL* static library, having them be a single module simplifies maintenance.

This should unbreak the wasm enscripten builds that currently fail due to linking in --whole-archive mode and the HACL* library appearing twice.

Long unnoticed error fixed: _sha512.SHA384Type was doubly assigned and was actually SHA512Type. Nobody depends on those internal names.

This is a followup to PRs #101707 and #101917.

  • Issue: Replace built-in hashlib with verified implementations from HACL* #99108

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@gpshead
pythongh-99108: Refactor _sha256 & _sha512 into _sha2.
fea4cdf
This merges their code. They're backed by the same single HACL* star static
library, having them be a single module simplifies maintenance.

This should unbreak the wasm enscripten builds that currently fail due to
linking in --whole-archive mode and the HACL* library appearing twice.

Long unnoticed error fixed: `_sha512.SHA384Type` was doubly assigned and was
actually SHA512Type. Nobody depends on those internal names.
@bedevere-bot bedevere-bot added the awaiting core review label Feb 15, 2023
@bedevere-bot bedevere-bot mentioned this pull request Feb 15, 2023
Replace built-in hashlib with verified implementations from HACL* #99108
Closed
@gpshead gpshead self-assigned this Feb 15, 2023
@gpshead gpshead added extension-modules C modules in the Modules dir build The build process and cross-build labels Feb 15, 2023
gpshead added 2 commits February 15, 2023 02:11
@gpshead
update stdlib module names list.
30c9955
@gpshead
remove the added subTest calls (no real value).
4c6a4fb
@gpshead gpshead added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Feb 15, 2023
@bedevere-bot

bedevere-bot commented Feb 15, 2023

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @gpshead for commit 4c6a4fb 🤖

If you want to schedule another build, you need to add the :hammer: test-with-buildbots label again.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Feb 15, 2023
@gpshead
gpshead marked this pull request as ready for review February 15, 2023 03:04
@gpshead
gpshead requested review from a team, corona10, erlend-aasland and tiran as code owners February 15, 2023 03:04
erlend-aasland
erlend-aasland reviewed Feb 15, 2023
View reviewed changes
Comment thread configure.ac Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Modules/sha2module.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Modules/sha2module.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Modules/sha2module.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Modules/sha2module.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Modules/sha2module.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Modules/sha2module.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Modules/sha2module.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

@erlend-aasland

erlend-aasland commented Feb 15, 2023

Copy link
Copy Markdown
Contributor

BTW, I'm pretty sure the refleaks are related to #101908.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

msprotz
msprotz reviewed Feb 15, 2023
View reviewed changes
Comment thread Misc/NEWS.d/next/Library/2023-02-15-01-54-06.gh-issue-99108.rjTSic.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

gpshead added 5 commits February 15, 2023 14:53
@gpshead
cleanup per review comments.
cf6b330
@gpshead
rename the _sha2 types and simplify module init to use PyModule_AddType.
610cf36
@gpshead
Explicitly test that direct type constructors fail.
40fd92a
@gpshead
missing param
d379e28
(this is how useful github vscode editor w/o ability to build and test before commit is...)
@gpshead
remove the unconstructable test (not a valid constraint for everything)
fb6454d
@gpshead gpshead added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Feb 16, 2023
@bedevere-bot

bedevere-bot commented Feb 16, 2023

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @gpshead for commit fb6454d 🤖

If you want to schedule another build, you need to add the :hammer: test-with-buildbots label again.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Feb 16, 2023
@gpshead
Merge branch 'main' into build/sha2
32b8f91
@gpshead gpshead added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Feb 16, 2023
@bedevere-bot

bedevere-bot commented Feb 16, 2023

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @gpshead for commit 32b8f91 🤖

If you want to schedule another build, you need to add the :hammer: test-with-buildbots label again.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Feb 16, 2023
gpshead added 4 commits February 15, 2023 17:23
@gpshead
fix compiler warnings.
b7259c3
@gpshead
Merge branch 'build/sha2' of github.com:gpshead/cpython into build/sha2
cbd04b0
@gpshead
Merge remote-tracking branch 'upstream/main' into build/sha2
bc52384
@gpshead
rename LIBHACL_ make vars to LIBHACL_SHA2_
b67918d
@gpshead gpshead added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Feb 16, 2023
@bedevere-bot

bedevere-bot commented Feb 16, 2023

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @gpshead for commit b67918d 🤖

If you want to schedule another build, you need to add the :hammer: test-with-buildbots label again.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Feb 16, 2023
@gpshead
gpshead merged commit 0b13575 into python:main Feb 16, 2023
@bedevere-bot bedevere-bot removed the awaiting core review label Feb 16, 2023
@gpshead
gpshead deleted the build/sha2 branch February 16, 2023 06:08
@asottile asottile mentioned this pull request Feb 16, 2023
add hacl2 files to sha256module in Modules/Setup #101829
Closed
picnixz added a commit that referenced this pull request Mar 3, 2025
@picnixz
gh-130149: refactor tests for HMAC (#130150)
8f11af4
Since we plan to introduce a built-in implementation for HMAC based on HACL*,
it becomes important for the HMAC tests to be flexible enough to avoid code
duplication.

In addition to the new layout based on mixin classes, we extend test coverage by
also testing the `__repr__` of HMAC objects and the HMAC one-shot functions.

We also fix the import to `_sha256` which, since gh-101924, resulted in some tests being
skipped as the module is no more available (its content was moved to the `_sha2` module).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@erlend-aasland erlend-aasland erlend-aasland left review comments
@tiran tiran Awaiting requested review from tiran
@corona10 corona10 Awaiting requested review from corona10 corona10 is a code owner
+1 more reviewer
@msprotz msprotz msprotz left review comments
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@gpshead gpshead

Labels

build The build process and cross-build extension-modules C modules in the Modules dir

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@gpshead @bedevere-bot @erlend-aasland @msprotz
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.