Skip to content

Match the documented parameter names to the signatures - #463

Merged
simonjbeaumont merged 3 commits into
apple:mainfrom
darkdi:doc-params-match-signatures
Aug 31, 2026
Merged

simonjbeaumont merged 3 commits into
apple:mainfrom
darkdi:doc-params-match-signatures

Conversation

@darkdi

@darkdi darkdi commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Match the documented parameter names to the signatures in Crypto and CryptoExtras

Checklist

  • I've run tests to see all new and existing tests pass
  • I've followed the code style of the rest of the project
  • I've read the Contribution Guidelines
  • I've updated the documentation if necessary

Motivation:

Both AES.GCM._SIV.open overloads document a nonce, with the paragraph about keeping it unique for every use of the key, and neither of them takes one -- it arrives inside the sealed box. That paragraph is copied down from seal, where it belongs. In a crypto API this seems worse than a typo, since it sends the reader looking for a parameter that is not there. Cipher.open carries the same copy. The other four look like plain name drift.

Modifications:

Dropped the three nonce entries, renamed four entries to the names the signatures use. Comments only, no code touched.

Result:

The parameter lists match the signatures.

@simonjbeaumont simonjbeaumont self-assigned this Aug 28, 2026

@simonjbeaumont simonjbeaumont left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@darkdi thanks for taking the time to open this PR 🙏

In general these housekeeping PRs are usually very welcome -- it's good for us to have the doc comments line up properly, especially for public API -- however, because this project shares code with another changes the tradeoffs.

Files that do not have the _boring or _xkcp suffix are part of the public API of CryptoKit. Changing these requires passing a higher bar, as any change in these files must be accompanied by a change in CryptoKit itself.

-- source: https://github.com/apple/swift-crypto#code-organisation

Could you revert the changes made to the files in Crypto/ so that the patch only affects the changes in CryptoExtras/?

There's no user benefit to those changes anyway, since those documentation comments are not on public symbols. Conversely, one of the changes you made in CryptoExtras is useful since it fixes the broken documentation on public API 👍

@simonjbeaumont simonjbeaumont added area/documentation Improvements or additions to documentation. semver/none No version bump required. labels Aug 28, 2026
@darkdi
darkdi force-pushed the doc-params-match-signatures branch from 15b1190 to f1f67ae Compare August 29, 2026 09:49
@darkdi

darkdi commented Aug 29, 2026

Copy link
Copy Markdown
Contributor Author

Reverted, the patch touches only CryptoExtras now. I missed the code organisation note in the README about the files without the _boring suffix, that is on me.

@simonjbeaumont simonjbeaumont left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverted, the patch touches only CryptoExtras now. I missed the code organisation note in the README about the files without the _boring suffix, that is on me.

No worries at all. And thank you for the contribution 🙏

@simonjbeaumont
simonjbeaumont enabled auto-merge (squash) August 29, 2026 14:04
auto-merge was automatically disabled August 30, 2026 21:50

Head branch was pushed to by a user without write access

@darkdi

darkdi commented Aug 31, 2026

Copy link
Copy Markdown
Contributor Author

The two workflow runs for this head are sitting in action_required, so nothing has reported back and the merge is blocked on missing checks rather than on the patch. They need the approval click.

@simonjbeaumont

Copy link
Copy Markdown
Contributor

No worries. I'll take care of this tomorrow.

@simonjbeaumont
simonjbeaumont enabled auto-merge (squash) August 31, 2026 20:36
@simonjbeaumont
simonjbeaumont merged commit 315a799 into apple:main Aug 31, 2026
47 of 48 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/documentation Improvements or additions to documentation. semver/none No version bump required.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants