Skip to content

sodium: Use opaque objects for SHAKE state - #24351

Merged
TimWolla merged 5 commits into
php:PHP-8.6from
TimWolla:sodium-xof-opaque
Oct 27, 2026
Merged

TimWolla merged 5 commits into
php:PHP-8.6from
TimWolla:sodium-xof-opaque

Conversation

@TimWolla

Copy link
Copy Markdown
Member

Alternative to #24182.

@TimWolla
TimWolla requested review from a team, DanielEScherzer, edorian and jedisct1 October 15, 2026 13:38
@TimWolla
TimWolla requested a review from kocsismate as a code owner October 15, 2026 13:38
@TimWolla TimWolla changed the title Sodium xof opaque sodium: Use opaque objects for SHAKE state Oct 15, 2026
function sodium_crypto_xof_shake128_init(?int $domain = null): SodiumCryptoXofShake128State {}

function sodium_crypto_xof_shake128_update(string &$state, string $message): true {}
function sodium_crypto_xof_shake128_update(SodiumCryptoXofShake128State $state, string $message): void {}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Should $message also have #[\SensitiveParameter]?

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.

Not a bad idea.

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.

BTW, do we need this before merging?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

BTW, do we need this before merging?

Not necessary before merging. This is a simple stub change (and also not a breaking change with regard to the API), this can happen separately and probably also makes sense to have as a separate commit.

TimWolla

This comment was marked as resolved.

Comment thread ext/sodium/libsodium.c Resolved
Comment thread ext/sodium/libsodium.c Resolved
@DanielEScherzer

Copy link
Copy Markdown
Member

This seems to address the original issue, we just need to decide if it is too late for PHP 8.6
I'd like to make sure that if we go with opaque objects we get this into the next RC
Ping @php/release-managers-86 - do you think this is okay to include in the release that is already well past the hard feature freeze?

@mbeccati mbeccati 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.

On behalf of the 8.6 RMs /cc @svpernova09

@TimWolla
TimWolla merged commit bdca5a9 into php:PHP-8.6 Oct 27, 2026
18 checks passed
TimWolla added a commit that referenced this pull request Oct 27, 2026
* PHP-8.6:
  sodium: Use opaque objects for SHAKE state (#24351)
@TimWolla
TimWolla deleted the sodium-xof-opaque branch October 27, 2026 16:11
@DanielEScherzer

Copy link
Copy Markdown
Member

Will also need UPRGADING for the new classes

TimWolla added a commit that referenced this pull request Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants