mirror of
https://github.com/apple/swift-crypto
synced 2026-11-22 04:30:39 +00:00
Change inclusiveMin param of ArbitraryPrecisionInteger.random from UInt64 to UInt (#242)
This commit is contained in:
1 parent
fdfdc11707
commit
33f65a3cbc
1 file changed
+2
-2
@@ -436,12 +436,12 @@ extension ArbitraryPrecisionInteger {
|
||||
}
|
||||
|
||||
@inlinable
|
||||
public static func random(inclusiveMin: UInt64, exclusiveMax: ArbitraryPrecisionInteger) throws -> ArbitraryPrecisionInteger {
|
||||
public static func random(inclusiveMin: UInt, exclusiveMax: ArbitraryPrecisionInteger) throws -> ArbitraryPrecisionInteger {
|
||||
var result = ArbitraryPrecisionInteger()
|
||||
|
||||
guard result.withUnsafeMutableBignumPointer({ resultPtr in
|
||||
exclusiveMax.withUnsafeBignumPointer { exclusiveMaxPtr in
|
||||
CCryptoBoringSSL_BN_rand_range_ex(resultPtr, inclusiveMin, exclusiveMaxPtr)
|
||||
CCryptoBoringSSL_BN_rand_range_ex(resultPtr, BN_ULONG(inclusiveMin), exclusiveMaxPtr)
|
||||
}
|
||||
}) == 1 else {
|
||||
throw CryptoBoringWrapperError.internalBoringSSLError()
|
||||
|
||||
Reference in new issue
Block a user