Skip to content

Conversation

@simonjbeaumont
Copy link
Contributor

Motivation

CryptoKit is adding API for SHA-3, which BoringSSL does not support. To maintain API parity, we need to provide a backing implementation. For this, we can use XKCP1, which provides the reference implementation, as well as several optimized solutions, suitable for vendoring into other projects.

Modifications

The following changes have been made in separate commits to help with the review:

  • Add vendor-xkcp.sh script
  • Revendor xkcp#master (heads/master-0-g11297f5)
  • Add CXCKP target with modulemap and umbrella header
  • Add CXKCPTests test target with simple test vectors
  • Add CXKCPShims with function wrappers for macros to call from Swift
  • Remove #if false guard from HashFunctions_SHA3.swift
  • Add SHA-3 implementation backed by libXKCP
  • Add new DigestImplSHA3 platform-specific type alias
  • Remove #if false from DigestsTests.swift to get SHA-3 tests

Result

Swift Crypto provides functioning SHA-3 API.

Notes

This PR is for the wwdc-25 side branch.

Footnotes

  1. https://github.com/XKCP/XKCP

@simonjbeaumont simonjbeaumont added the 🆕 semver/minor Adds new public API. label Aug 11, 2025
@simonjbeaumont simonjbeaumont requested a review from Lukasa August 11, 2025 16:17
@Lukasa Lukasa merged commit d9f3641 into apple:wwdc-25 Aug 11, 2025
29 of 31 checks passed
This was referenced Sep 24, 2025
Lukasa added a commit that referenced this pull request Sep 26, 2025
This change updates Crypto to WWDC25 equivalent code.

Each of these changes were individually merged to the WWDC25 branch.
This includes:

- #359
- #363
- #365
- #367
- #368
- #397
- #403
- #410
- #407
- #401
- #415

---------

Co-authored-by: YourMJK <37852512+YourMJK@users.noreply.github.com>
Co-authored-by: Si Beaumont <beaumont@apple.com>
Co-authored-by: Rick Newton-Rogers <rnro@apple.com>
Co-authored-by: Raphael <josephnoir@users.noreply.github.com>
Co-authored-by: Evan Wilde <ewilde@apple.com>
Co-authored-by: Tim Condon <0xTim@users.noreply.github.com>
Co-authored-by: Gus Cairo <gus.cairo@apple.com>
Co-authored-by: George Barnett <gbarnett@apple.com>
Co-authored-by: Fabrice de Gans <Steelskin@users.noreply.github.com>
Co-authored-by: Wojciech Nagrodzki <278594+wnagrodzki@users.noreply.github.com>
Co-authored-by: Jesse L. Zamora <xtremekforever@gmail.com>
Co-authored-by: aryan-25 <aryan_shah@apple.com>
Co-authored-by: Gwynne Raskind <gwynne@vapor.codes>
Co-authored-by: 3405691582 <dsk@google.com>
Co-authored-by: Paul Toffoloni <69189821+ptoffy@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🆕 semver/minor Adds new public API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants