Closed simonjbeaumont closed 2 weeks ago
- We require that any import of the
CCryptoBoringSSL
module is imported using@_implementationOnly
.
@Lukasa based on our discussion, we believe that this is not a requirement and that we can actually drop the @_implementationOnly
on our imports, which we can front-run in its own, targeted PR?
@swift-server-bot test this please
Thanks for this Si, much appreciated.
Motivation
Before this PR, the
Crypto
module had an internalArbitraryPrecisionInteger
type that manages the lifetime of a BoringSSLBIGNUM
and exposes severalBIGNUM
operations. We'd like to make use of this from the_CryptoExtras
module and also for code that will run on Darwin platforms.Modifications
ArbitraryPrecisionInteger
to theCryptoBoringWrapper
module.public
.RawPointer
andMutableRawPointer
APIs (and hide typed pointer APIs).BIGNUM
pointer APIs.ArbitraryPrecisionIntegerTests
to (new)CryptoWrapperTests
test target.There are a number of other ways this could have been achieved but none of them seemed great given the requirements, specifically:
CCryptoBoringSSL
module is imported using@_implementationOnly
.ArbitraryPrecisionInteger
(or, of course,BIGNUM
) in the public API ofCrypto
.@inlineable
and@usableFromInline
annotations on existing APIs that make use ofArbitraryPrecisionInteger
, which itself was@usableFromInline
before this PR.Result
ArbitraryPrecisionInteger
is now in a shared place that can be used from the_CryptoExtras
module.