Files
swift-crypto/Sources/Crypto/Docs.docc/index.md
T
Francesco Paolo SeverinoandCory Benfield 0bf9f479b8 Improve DocC landing pages (#313)
Improve DocC landing pages by mimicking Apple's CryptoKit docs

### Motivation:

Right now the DocC docs group all APIs by protocols, structures and
enums.
By adding a topics section in the landing page we can group them by type
("Ciphers", "Public key cryptography", etc.) exactly in the way Apple
does in [CryptoKit
docs](https://developer.apple.com/documentation/cryptokit/).

### Modifications:

- Fix DocC compilation errors in `_CryptoExtras`
- Add topics section in `_CryptoExtras` landing page
- Add topics section in `Crypto` landing page

### Result:

APIs will be grouped by type.

---------

Co-authored-by: Cory Benfield <lukasa@apple.com>
2024-12-16 12:52:12 +00:00

1.3 KiB

Crypto

A cryptography library for Swift.

Overview

Swift Crypto provides a Swift library for common cryptographic operations. It is available as a Swift package and provides two main libraries:

  • Crypto - an open-source implementation of a substantial portion of the API of Apple CryptoKit suitable for use on Linux platforms. It enables cross-platform or server applications with the advantages of CryptoKit.
  • CryptoExtras - a collection of additional cryptographic primitives and utilities that are not part of CryptoKit but useful in a server environment.

Swift Crypto is built on top of BoringSSL, Google's fork of OpenSSL. The current features of Swift Crypto cover key exchange, key derivation, encryption and decryption, hashing, message authentication, and more.

Topics

Cryptographically secure hashes

  • HashFunction
  • SHA512
  • SHA384
  • SHA256

Message authentication codes

  • HMAC
  • SymmetricKey
  • SymmetricKeySize

Ciphers

  • AES
  • ChaChaPoly

Public key cryptography

  • Curve25519
  • P521
  • P384
  • P256
  • SharedSecret
  • HPKE

Key derivation functions

  • HKDF

Errors

  • CryptoKitError
  • CryptoKitASN1Error

Legacy algorithms

  • Insecure