Skip to content

Inconsistence usage of type KeySizes in AesGcm (size in byte vs. size in bit) #1910

@dhcgn

Description

@dhcgn

In AesGcm.cs the properties NonceByteSizes and TagByteSizes represents the size in Byte.

private const int NonceSize = 12;
public static KeySizes NonceByteSizes { get; } = new KeySizes(NonceSize, NonceSize, 1);
public static KeySizes TagByteSizes { get; } = new KeySizes(12, 16, 1);

But the used type KeySizes represent valid key sizes in Bit.

<summary>Specifies the maximum key size in bits.</summary>
<value>The maximum key size in bits.</value>

see https://github.com/dotnet/dotnet-api-docs/blob/01e31683fa1feea031c94a1243b01d8ee0255a6d/xml/System.Security.Cryptography/KeySizes.xml#L135

In the namespace System.Security.Cryptography properties like "Size" vary between amount of bit and bytes. In this case the documentation is not consistent with the name of the property, ByteSizes to Specifies the maximum key size in bits.

I hope this description meets your quality standards for new issues.

Metadata

Metadata

Assignees

Labels

area-System.SecuritydocumentationDocumentation bug or enhancement, does not impact product or test code

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions