mirror of
https://github.com/apple/swift-crypto
synced 2026-11-29 05:14:21 +00:00
Fix build for 32-bit platforms (#85)
Motivation: I couldn't build for Android armv7 on the CI I set up without this. Modifications: Initialize with the right size of UInt to BoringSSL. Result: I can build for armv7 again. Co-authored-by: Cory Benfield <lukasa@apple.com>
This commit is contained in:
1 parent
eefb07cc59
commit
01c3fdfb85
1 file changed
+2
-2
@@ -78,7 +78,7 @@ extension String {
|
||||
|
||||
extension FixedWidthInteger {
|
||||
func withBignumPointer<ReturnType>(_ block: (UnsafeMutablePointer<BIGNUM>) throws -> ReturnType) rethrows -> ReturnType {
|
||||
precondition(self.bitWidth <= 64)
|
||||
precondition(self.bitWidth <= UInt.bitWidth)
|
||||
|
||||
var bn = BIGNUM()
|
||||
CCryptoBoringSSL_BN_init(&bn)
|
||||
@@ -86,7 +86,7 @@ extension FixedWidthInteger {
|
||||
CCryptoBoringSSL_BN_clear(&bn)
|
||||
}
|
||||
|
||||
CCryptoBoringSSL_BN_set_word(&bn, UInt64(self))
|
||||
CCryptoBoringSSL_BN_set_word(&bn, .init(self))
|
||||
|
||||
return try block(&bn)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user