mirror of
https://github.com/apple/swift-crypto
synced 2026-11-26 04:47:49 +00:00
### Motivation: We don't have any API for `AES.GCM.seal` or `open` a read-only buffer into a caller-provided destination. ### Modifications: - Add `seal` and `open` helpers to `BoringSSLAEAD.AEADContext` that take `RawSpan` as input and append to an `OutputRawSpan`. - Refactor the in-place versions to throw from inside the BoringSSL call, to match the new functions. - Add `AES.GCM._seal(_:using:nonce:authenticating:tag:output:)` and `AES.GCM._open(_:using:nonce:authenticating:tag:output:)` to CryptoExtras. - Add tests. ### Result: New API in CryptoExtras: - `AES.GCM._seal(_:using:nonce:authenticating:tag:output:)` - `AES.GCM._open(_:using:nonce:authenticating:tag:output:)` --------- Co-authored-by: Cory Benfield <lukasa@apple.com>