Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: apple/swift-crypto
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 3.7.1
Choose a base ref
...
head repository: apple/swift-crypto
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 3.8.0
Choose a head ref
  • 5 commits
  • 14 files changed
  • 4 contributors

Commits on Sep 16, 2024

  1. extras: Add RSA primitives decoding API (#249)

    Motivation:
    
    At times we might need to get the raw elements of an RSA key, e.g when debugging.
    
    Modifications:
    
    Add a getKeyPrimitives method to the RSA (public and private) key structures that returns the elements.
    To do this we leverage the built in BoringSSL methods (CCryptoBoringSSL_RSA_get0_n etc.) which return the raw elements of the key. In the Security version of the key we convert the key to a BoringSSL one and just call the BoringSSL method.
    
    Once we get ASN.1 support in _CryptoExtras it might make sense switching the implementation of this method to decode the ASN.1 structure and returns the elements from there.
    
    Result:
    
    New APIs to fetch the key primitives.
    
    ---------
    
    Co-authored-by: Cory Benfield <[email protected]>
    ptoffy and Lukasa authored Sep 16, 2024
    Configuration menu
    Copy the full SHA
    55201a8 View commit details
    Browse the repository at this point in the history
  2. extras: Add API to create RSA keys with random primes (#250)

    This adds a _createFromNumbers API which creates an RSA key generating p and q primes based on n, e and d
    
    Motivation:
    
    There might be cases where private RSA keys have to be generated based on their raw elements (modulus n, exponent e and private exponent d) without p and q. These are random primes which are integral parts of the key but can be generated based on the former numbers, and are not always included when representing RSA keys, for example these parameters are not required in JWKs
    
    Modifications:
    
    This adds a static _createFromNumbers method which creates a new RSA key given its raw modulus, exponent and private exponent, generating the needed p and q primes without having to provide them as parameters. The algorithm to generate primes is based on a hybrid approach of the Miller Rabin primality test and the proof of Fact 1 in Dan Boneh's Twenty Years of Attacks on the RSA Cryptosystem paper. To write this algorithm, some additions had to be made to the ArbitraryPrecisionInteger
    
    Result:
    
    Private RSA keys can now be generated without providing p and q
    ptoffy authored Sep 16, 2024
    Configuration menu
    Copy the full SHA
    e8f2ddd View commit details
    Browse the repository at this point in the history

Commits on Sep 18, 2024

  1. Only include privacy manifest on Darwin (#257)

    Motivation:
    
    The privacy manifest is only required on Darwin. It's currently included
    on all platforms which results in build warnings.
    
    Modifications:
    
    - Only include manifest on Darwin
    - Exclude the privacy manifest from the build on other platforms
    
    Result:
    
    - Fewer warnings
    - Resolves #256
    glbrntt authored Sep 18, 2024
    Configuration menu
    Copy the full SHA
    a24950b View commit details
    Browse the repository at this point in the history

Commits on Sep 19, 2024

  1. Configuration menu
    Copy the full SHA
    3570357 View commit details
    Browse the repository at this point in the history

Commits on Oct 2, 2024

  1. Configuration menu
    Copy the full SHA
    ffca28b View commit details
    Browse the repository at this point in the history
Loading