Skip to content

Commit

Permalink
Fix WASI platform build issue (#291)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyle-Ye authored Oct 30, 2024
1 parent 62958ed commit 06dc63c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Sources/CryptoBoringWrapper/Util/RandomBytes.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ extension UnsafeMutableRawBufferPointer {

#if canImport(Darwin) || os(Linux) || os(Android) || os(Windows)
var rng = SystemRandomNumberGenerator()
#else
fatalError("No secure random number generator on this platform.")
#endif
precondition(count <= self.count)

// We store bytes 64-bits at a time until we can't anymore.
Expand All @@ -41,6 +38,9 @@ extension UnsafeMutableRawBufferPointer {
remainingWord >>= 8
targetPtr = UnsafeMutableRawBufferPointer(rebasing: targetPtr[1...])
}
#else
fatalError("No secure random number generator on this platform.")
#endif
}
}

Expand Down

0 comments on commit 06dc63c

Please sign in to comment.