apple / apple/swift-crypto

Add `Span` functions where applicable

Open
#426 1 comment 3 reactions 0 assignees View on GitHub
Dominant language
Assembly
Stars
1.7k
Forks
223
Avg merge
1d 2h
Merged PRs (30d)
7

Description

### New API Proposal: `Span` support

#### Motivation:

Lots of types, especially around keys, allow you to access the underlying storage with `func withUnsafeBytes(_ body: (UnsafeRawBufferPointer) throws -> R) rethrows -> R`. `Span` was introduced to support these exact scenarios in a safe way and Crypto should support it

#### Importance:

Unsafe code is unsafe, safe alternatives should be provided

Contributor guide

Open the contributing guide

Research direction

Start by auditing Crypto types, especially key types, that expose withUnsafeBytes, and compare their APIs with Swift Span support. The issue does not name files or tests, so first identify the applicable entry points and existing API conventions. Done means safe Span-based alternatives are provided wherever appropriate and the relevant tests cover them.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
cryptography
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.