swift-crypto icon indicating copy to clipboard operation
swift-crypto copied to clipboard

Add Sendable annotation to Crypto Extras

Open 0xTim opened this issue 2 years ago • 2 comments

New API Proposal: Sendable Support

Motivation:

Use Swift Crypto types in concurrency contexts invariably starts to hit issues as no types are Sendable. I'm aware there are issues around the main Crypto target as that has match CryptoKit (or does it? Could we add Sendable conformance on Linux?) but it would be great to add it to the types in Crypto Extras

Importance:

It's possible to achieve this with a mix of @preconcurrency and @unchecked Sendable but neither of these are ideal for obvious reasons.

0xTim avatar Nov 06 '23 11:11 0xTim

Yes, the goal is that the Crypto API exactly matches the CryptoKit one. This avoids users needing to deal with platform-specific imports or other logic.

For CryptoExtras, this can definitely be done separately. @rnro want to take a look at CryptoExtras?

Lukasa avatar Nov 06 '23 11:11 Lukasa

Yep, sure.

rnro avatar Nov 06 '23 13:11 rnro

Fixed in #211

0xTim avatar Jul 23 '24 13:07 0xTim