mirror of
https://github.com/apple/swift-crypto
synced 2026-11-28 05:04:21 +00:00
[5.x] Remove bindMemory(to:) calls and the CCryptoBoringSSLShims target (#455)
## Motivation Some of our calls to our C library dependencies use either a C shim layer or the use of `bindMemory(to:)`, neither of which are still required. The shims themselves cite that once SR-11087 lands, they are no longer needed. That issue was addressed and has been available in all the Swift versions this package currently supports. We can now remove most of these workarounds that add complexity to the C interop. ## Modifications - Remove uses of `bindMemory(to:)` calls since we can now pass the buffer pointer directly to these C functions now. - Replace use of `BN_mod` (macro, needed shim) with `BN_div` (no shim required). - Replace all other shims with call to corresponding un-shimmed function directly. - Remove shim target entirely from package. ## Result Less hand-rolled code for C interop, reducing complexity for project.
This commit is contained in:
1 parent
15b0fb5b45
commit
b3746b1441
33 files changed
+70
-532
No files matched your search
@@ -71,7 +71,7 @@ extension MessageAuthenticationCode {
|
||||
|
||||
public func makeIterator() -> Array<UInt8>.Iterator {
|
||||
self.withUnsafeBytes({ (buffPtr) in
|
||||
return Array(buffPtr.bindMemory(to: UInt8.self)).makeIterator()
|
||||
return Array(buffPtr).makeIterator()
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user