Skip to content

Commit bae2371

Browse files
authored
Remove comment about zero padding HMAC{256,384,512} keys. (dotnet#8761)
The zero padding is not observed in the `Key` property. It's an implementation detail of how HMAC works. To avoid any confusion, let's just remove this comment. We don't have it for HMACSHA1 or HMACMD5.
1 parent a480f04 commit bae2371

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

xml/System.Security.Cryptography/HMACSHA256.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@
178178
<Parameter Name="key" Type="System.Byte[]" />
179179
</Parameters>
180180
<Docs>
181-
<param name="key">The secret key for <see cref="T:System.Security.Cryptography.HMACSHA256" /> encryption. The key can be any length. However, the recommended size is 64 bytes. If the key is more than 64 bytes long, it is hashed (using SHA-256) to derive a 64-byte key. If it is less than 64 bytes long, it is padded to 64 bytes.</param>
181+
<param name="key">The secret key for <see cref="T:System.Security.Cryptography.HMACSHA256" /> encryption. The key can be any length. However, the recommended size is 64 bytes. If the key is more than 64 bytes long, it is hashed (using SHA-256) to derive a 64-byte key.</param>
182182
<summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.HMACSHA256" /> class with the specified key data.</summary>
183183
<remarks>
184184
<format type="text/markdown"><![CDATA[

xml/System.Security.Cryptography/HMACSHA384.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@
182182
<Parameter Name="key" Type="System.Byte[]" />
183183
</Parameters>
184184
<Docs>
185-
<param name="key">The secret key for <see cref="T:System.Security.Cryptography.HMACSHA384" /> encryption. The key can be any length. However, the recommended size is 128 bytes. If the key is more than 128 bytes long, it is hashed (using SHA-384) to derive a 128-byte key. If it is less than 128 bytes long, it is padded to 128 bytes.</param>
185+
<param name="key">The secret key for <see cref="T:System.Security.Cryptography.HMACSHA384" /> encryption. The key can be any length. However, the recommended size is 128 bytes. If the key is more than 128 bytes long, it is hashed (using SHA-384) to derive a 128-byte key.</param>
186186
<summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.HMACSHA384" /> class by using the specified key data.</summary>
187187
<remarks>
188188
<format type="text/markdown"><![CDATA[

xml/System.Security.Cryptography/HMACSHA512.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@
182182
<Parameter Name="key" Type="System.Byte[]" />
183183
</Parameters>
184184
<Docs>
185-
<param name="key">The secret key for <see cref="T:System.Security.Cryptography.HMACSHA512" /> encryption. The key can be any length. However, the recommended size is 128 bytes. If the key is more than 128 bytes long, it is hashed (using SHA-512) to derive a 128-byte key. If it is less than 128 bytes long, it is padded to 128 bytes.</param>
185+
<param name="key">The secret key for <see cref="T:System.Security.Cryptography.HMACSHA512" /> encryption. The key can be any length. However, the recommended size is 128 bytes. If the key is more than 128 bytes long, it is hashed (using SHA-512) to derive a 128-byte key.</param>
186186
<summary>Initializes a new instance of the <see cref="T:System.Security.Cryptography.HMACSHA512" /> class with the specified key data.</summary>
187187
<remarks>
188188
<format type="text/markdown"><![CDATA[

0 commit comments

Comments
 (0)