-
Notifications
You must be signed in to change notification settings - Fork 170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move ArbitraryPrecisionInteger type to CryptoBoringWrapper module #236
Move ArbitraryPrecisionInteger type to CryptoBoringWrapper module #236
Conversation
…toKitError.internalBoringSSLError
2407071
to
6cfa683
Compare
@Lukasa based on our discussion, we believe that this is not a requirement and that we can actually drop the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI I think we can drop the proposed raw pointer APIs on ArbitraryPrecisionInteger
and these shims back to typed pointers if we're willing to drop @_implementationOnly import
in this project.
@swift-server-bot test this please |
3708319
to
50e358f
Compare
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.