Skip to content

Commit

Permalink
Fix WASI platform build issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyle-Ye committed Oct 30, 2024
1 parent 62958ed commit ca29cc2
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 ca29cc2

Please sign in to comment.