Skip to content

abstract SHA256 implementaiton differences behind a single implementation #274

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

Merged
merged 2 commits into from
Dec 22, 2021

Conversation

tomerd
Copy link
Contributor

@tomerd tomerd commented Dec 22, 2021

motivation: reduce boilerplate on call sites

changes:

  • rename the internal implementation of SHA256 to InternalSHA256 and make it internal
  • rename the CryptoKit implementation of SHA256 to _CryptoKitSHA256 and make it internal
  • create a public SHA256 that delegates to CryptoKit / Internal based on platform availability
  • mark CryptoKitSHA256 as deprecated encouraging users to move to the SHA256 abstraction
  • adjust and add tests

…tion

motivation: reduce boilerplate on call sites

changes:
* rename the internal implementation of SHA256 to InternalSHA256 and make it internal
* rename the CryptoKit implementation of SHA256 to _CryptoKitSHA256 and make it internal
* create a public SHA256 that delegates to CryptoKit / Internal based on platform availability
* mark CryptoKitSHA256 as deprecated encouraging users to move to the SHA256 abstraction
* adjust and add tests
@tomerd
Copy link
Contributor Author

tomerd commented Dec 22, 2021

@swift-ci test

@tomerd tomerd added the ready Author believes the PR is ready to be merged & any feedback has been addressed label Dec 22, 2021
@abertelrud
Copy link
Contributor

Besides the other advantages it seems that this could be good for performance, assuming that the system implementation is heavily optimized. Nice!

@tomerd
Copy link
Contributor Author

tomerd commented Dec 22, 2021

@swift-ci test

@tomerd
Copy link
Contributor Author

tomerd commented Dec 22, 2021

@swift-ci test Linux

@tomerd tomerd merged commit 4ac04c4 into swiftlang:main Dec 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready Author believes the PR is ready to be merged & any feedback has been addressed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants