Skip to content

Implement KeySizeInBytes on AesGcm and AesCcm.#129770

Merged
vcsjones merged 3 commits into
mainfrom
copilot/implement-approved-api-72191
Jun 24, 2026
Merged

Implement KeySizeInBytes on AesGcm and AesCcm.#129770
vcsjones merged 3 commits into
mainfrom
copilot/implement-approved-api-72191

Conversation

Copilot AI commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Implements #72191

Copilot AI and others added 3 commits June 23, 2026 20:20
Co-authored-by: vcsjones <361677+vcsjones@users.noreply.github.com>
Co-authored-by: vcsjones <361677+vcsjones@users.noreply.github.com>
Co-authored-by: vcsjones <361677+vcsjones@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 23, 2026 21:21
Copilot AI removed the request for review from Copilot June 23, 2026 21:21
@vcsjones vcsjones changed the title Update AES key size XML documentation Implement KeySizeInBytes on AesGcm and AesCcm. Jun 23, 2026
@vcsjones vcsjones marked this pull request as ready for review June 23, 2026 21:22
Copilot AI review requested due to automatic review settings June 23, 2026 21:22
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @bartonjs, @vcsjones, @dotnet/area-system-security
See info in area-owners.md if you want to be subscribed.

Copilot AI 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.

Pull request overview

This PR adds a new public instance property, KeySizeInBytes, to AesGcm and AesCcm, allowing callers to query the key length used to construct an instance.

Changes:

  • Introduces KeySizeInBytes as a public property on AesGcm and AesCcm.
  • Initializes KeySizeInBytes in all relevant constructors (including obsolete AesGcm ctors).
  • Adds unit tests validating KeySizeInBytes for 128/192/256-bit keys and updates the ref assembly surface.
Show a summary per file
File Description
src/libraries/System.Security.Cryptography/tests/AesCcmTests.cs Adds coverage asserting AesCcm.KeySizeInBytes matches the provided key length.
src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AesGcm.cs Ensures the obsolete AesGcm(ReadOnlySpan<byte>) constructor populates KeySizeInBytes.
src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AesCcm.cs Adds KeySizeInBytes API and sets it in both constructors.
src/libraries/System.Security.Cryptography/ref/System.Security.Cryptography.cs Exposes KeySizeInBytes in the public ref contract for both AesGcm and AesCcm.
src/libraries/Common/tests/System/Security/Cryptography/AesGcmTests.cs Adds coverage asserting AesGcm.KeySizeInBytes across both obsolete and tag-size ctors (as applicable).
src/libraries/Common/src/System/Security/Cryptography/AesGcm.cs Adds KeySizeInBytes API and sets it in the tag-size constructor.

Copilot's findings

  • Files reviewed: 6/6 changed files
  • Comments generated: 0

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.

4 participants