-
Notifications
You must be signed in to change notification settings - Fork 292
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
Add Web Crypto API tests and test vectors #34
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
We use Sagemath for elliptic curve. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=158512195
We use Sagemath's elliptic curve. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=158512865
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=158544445
- Refactor the code to make it more clear. - The code is able to run on Chrome, Firefox, and Microsoft Edge now. It cannot run on IE because IE only supports older version of Web Crypto API (the 2014's version). Some notes for MS Edge: - Doesn't support ECDSA. - Doesn't support SHA-1. - For AES-GCM, IV's length must be 96 bits and the message's length and aad's length must be not 0. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=159232933
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=159454989
Also remove some logging lines that were left on some files. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=161089409
With our test vectors, no exception should be thrown during RSA and ECDSA signature verification and AES-GCM encryption. I also changed the code from using fail() when the test fails to using reject(). It is a more proper way of dealing with asynchronous test cases. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=161210264
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=161677807
I modified Daniel's scripts in experimental folder to generate ECDH test vectors. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=161969143
Move init into the loop. (#32) The current code fails to initialize the cipher c after a c.doFinal() fails. According to JCE documentation, a cipher is in an undefined state after throwing an exception. ------------- Release a few more bugs. (#33) ------------- Add tests for partially-overlapping input/output buffers (#29) update/doFinal are required to be "copy-safe". From the javadoc: Note: this method should be copy-safe, which means the input and output buffers can reference the same block of memory and no unprocessed input data is overwritten when the result is copied into the output buffer. However many implementations of JCE methods do not implement this property in all cases. Notably, BouncyCastle fails this test on arrays, and the built-in OpenJDK providers fail when the input bytebuffer is either a read-only array-backed byte buffer, or if the buffers are direct buffers. For SunJCE, this has been acknowledged publicly by Oracle at https://bugs.openjdk.java.net/browse/JDK-8181386 . These new tests verify correct overlapping buffer handling for AES/GCM specifically; as future work, it would be good to generalize these tests for other ciphers and modes. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=730842ac8c39be6080a867bbfd163fae660c5248 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=162496072
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=162749326
…cript files. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=162786781
This was referenced Jul 22, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.