This project simply wraps libsodium into a dynamic framework for iOS and macOS.
Current libsodium version used: 1.0.18
You have a few different options:
- Include the Sodium.xcodeproj as a dependency in your project. This is what the projects under
Examples/
are doing. Doing this means Sodium.framework will be compiled alongside your project, including after every clean. - Use a pre-built Sodium.framework. You can find them under Releases.
In your Package.swift
, add Sodium
as a dependency:
dependencies: [
.package(url: "https://github.com/OuterCorner/Sodium", from: "1.0.18")
],
Associate the dependency with your target:
targets: [
.target(name: "App", dependencies: ["Sodium"])
]
After importing the umbrella header:
#import <Sodium/Sodium.h>
You can simply start using libsodium APIs as usual.
crypto_secretbox_keygen(key);
randombytes_buf(nonce, sizeof(nonce));
See example projects under Examples/
.
This project is licensed under the MIT License - see LICENSE.
Note the underlying libsodium library LICENSE still applies when using this project.