Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 13 additions & 7 deletions release-notes/11.0/preview/rc1/libraries.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,6 @@ The `Memory<byte>` and `ReadOnlyMemory<byte>` schemas remain non-nullable (`"typ
For a union with object-shaped cases, specify the classifier on the union to select the case from its distinguishing property names:

```csharp
#:property LangVersion=preview

using System.Text.Json;
using System.Text.Json.Serialization;

Expand Down Expand Up @@ -213,17 +211,25 @@ On an Apple M1 Ultra running macOS Tahoe 26.6, encrypting a 16-byte payload with

## AES Key Wrap support

The `Aes` class now supports the unpadded AES Key Wrap algorithm defined by RFC 3394 ([dotnet/runtime #132477](https://github.com/dotnet/runtime/pull/132477)). The new `EncryptKeyWrap`, `DecryptKeyWrap`, `TryDecryptKeyWrap`, and `GetKeyWrapLength` methods complement the padded AES-KWP APIs added earlier in .NET 11.
The `Aes` class now supports the unpadded AES Key Wrap algorithm defined by RFC 3394 ([dotnet/runtime #132477](https://github.com/dotnet/runtime/pull/132477)). The new `EncryptKeyWrap`, `DecryptKeyWrap`, `TryDecryptKeyWrap`, and `GetKeyWrapLength` methods complement the padded AES-KWP APIs added in .NET 10.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This change is correct; thanks. dotnet/runtime#130490


The APIs provide array-returning and span-based overloads for wrapping cryptographic keys, including scenarios used by JOSE libraries.

## Breaking changes
```csharp
using System.Security.Cryptography;

### Numeric conversions are now correctly rounded
using Aes aes = Aes.Create();
aes.Key = RandomNumberGenerator.GetBytes(32);

Starting in .NET 11 Preview 7, conversions between `decimal` and binary floating-point types, and conversions from `BigInteger` to binary floating-point types, round the exact source value once to the nearest representable destination value ([dotnet/runtime #130565](https://github.com/dotnet/runtime/pull/130565), [dotnet/runtime #130566](https://github.com/dotnet/runtime/pull/130566)). The previous conversions could lose significant digits or round through an intermediate value, so existing binaries and code rebuilt with a .NET 11 Preview 7 or later SDK can produce different results.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We missed catching this breaking change note in the Preview 7 release notes as we didn't document it until RC1.

#10542 (comment)

Please check with @tannergooding before removing this per their comment linked there, and I too thought it was a pretty noteworthy thing to cover, albeit late.

byte[] keyToWrap = RandomNumberGenerator.GetBytes(16);
byte[] wrappedKey = aes.EncryptKeyWrap(keyToWrap);
byte[] unwrappedKey = aes.DecryptKeyWrap(wrappedKey);

For example, converting the `double` literal `1.23` to `decimal` now preserves the exact binary floating-point value rather than producing `1.23`. If a value is intended to be decimal, use a decimal literal such as `1.23m` instead of converting a `double` literal. Update tests and serialized expected values that relied on the previous result; there is no compatibility switch to restore the former conversion algorithms. For complete guidance, see [dotnet/docs#55743](https://github.com/dotnet/docs/issues/55743).
Console.WriteLine(
CryptographicOperations.FixedTimeEquals(keyToWrap, unwrappedKey));
```

## Breaking changes

### HTTP metrics are observable instruments

Expand Down
Loading