Skip to content

Commit af251f7

Browse files
authored
Fix usage instructions to use revision rather than tag. (#3)
This works around an issue with using unsafe flags in a tagged release.
1 parent 8ec551c commit af251f7

File tree

2 files changed

+22
-4
lines changed

2 files changed

+22
-4
lines changed

README.md

+11-2
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,19 @@ Swift Homomorphic Encryption requires:
5858
> Swift Homomorphic Encryption relies on [SystemRandomNumberGenerator](https://developer.apple.com/documentation/swift/systemrandomnumbergenerator) as a cryptographically secure random number generator, which may have platform-dependent behavior.
5959
6060
Swift Homomorphic Encryption is available as a Swift Package Manager package.
61-
To use Swift Homomorphic Encryption, add the following dependency in your `Package.swift`:
61+
To use Swift Homomorphic Encryption, choose a [tag](https://github.com/apple/swift-homomorphic-encryption/tags).
62+
Then, add the following dependency in your `Package.swift`, adding the commit hash associated with the tag.
6263
```swift
63-
.package(url: "https://github.com/apple/swift-homomorphic-encryption", .upToNextMajor(from: "0.1.0")),
64+
.package(
65+
url: "https://github.com/apple/swift-homomorphic-encryption",
66+
revision: "git-commit-associated-with-the-tag"),
6467
```
68+
69+
> [!NOTE]
70+
> Due to the use of `unsafeFlags` in Swift Homomorphic Encryption, you shouldn't depend on a git tag, which could prevent tagged releases of downstream projects.
71+
> In particular, without the `cross-module-optimization` flag, performance degrades dramatically.
72+
> One workaround is to add `SwiftHomomorphicEncryption` as a submodule rather than a package dependency.
73+
6574
To use the `HomomorphicEncryption` library, add
6675
```swift
6776
.product(name: "HomomorphicEncryption", package: "swift-homomorphic-encryption"),

Sources/HomomorphicEncryption/HomomorphicEncryption.docc/UsingSwiftHomomorphicEncryption.md

+11-2
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,19 @@ Swift Homomorphic Encryption requires:
1111
> Note: Swift Homomorphic Encryption relies on [SystemRandomNumberGenerator](https://developer.apple.com/documentation/swift/systemrandomnumbergenerator) as a cryptographically secure random number generator, which may have platform-dependent behavior.
1212
1313
Swift Homomorphic Encryption is available as a Swift Package Manager package.
14-
To use Swift Homomorphic Encryption, add the following dependency in your `Package.swift`:
14+
To use Swift Homomorphic Encryption, choose a [tag](https://github.com/apple/swift-homomorphic-encryption/tags).
15+
Then, add the following dependency in your `Package.swift`, adding the commit hash associated with the tag.
1516
```swift
16-
.package(url: "https://github.com/apple/swift-homomorphic-encryption", .upToNextMajor(from: "0.1.0")),
17+
.package(
18+
url: "https://github.com/apple/swift-homomorphic-encryption",
19+
revision: "git-commit-associated-with-the-tag"),
1720
```
21+
22+
> Note:
23+
> Due to the use of `unsafeFlags` in Swift Homomorphic Encryption, you shouldn't depend on a git tag, which could prevent tagged releases of downstream projects.
24+
> In particular, without the `cross-module-optimization` flag, performance degrades dramatically.
25+
> One workaround is to add `SwiftHomomorphicEncryption` as a submodule rather than a package dependency.
26+
1827
To use the `HomomorphicEncryption` library, add
1928
```swift
2029
.product(name: "HomomorphicEncryption", package: "swift-homomorphic-encryption"),

0 commit comments

Comments
 (0)