Skip to content
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

Making ivBytes accessible for _CBC.IV #260

Closed
wants to merge 1 commit into from

Conversation

maschall
Copy link

Checklist

  • I've run tests to see all new and existing tests pass
  • I've followed the code style of the rest of the project
  • I've read the Contribution Guidelines
  • I've updated the documentation if necessary

Motivation:

Right now, we're using CommonCrypto and would like to switch to Crypto instead. However, the requirement we need is that we send the data for IV to the server for them to verify the signature we are sending them. Similarly, they send us their IV and we verify the signature of other data. (Which is supported currently)

Modifications:

By making ivBytes public, we can access the randomly generated salt for our cipher.

Result:

I can replace CommonCrypto code in my repo with Crypto instead :)

@Lukasa
Copy link
Collaborator

Lukasa commented Sep 19, 2024

Thanks for this, this is a change we're generally happy to make. Can I make a few requests?

Firstly, let's prefer to offer an API that exposes an Array. That will generally be more useful than the tuple we have here.

Secondly, can you add a unit test that drives that API? It'll help us avoid regressing it.

@maschall
Copy link
Author

That is interesting about the [UInt8] because that is how I use it in my code, and had to repeat a lot of ivBytes.0, 1, 2,...

So I'm happy to expose and API and unit tests

@maschall
Copy link
Author

Closing in favor of #261

@maschall maschall closed this Sep 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants