Change inclusiveMin param of ArbitraryPrecisionInteger.random from UInt64 to UInt (#242)

This commit is contained in:
Si Beaumont authored and GitHub committed 2024-06-27 15:01:40 +01:00
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()