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

Add Web Crypto API tests and test vectors #34

Closed
wants to merge 13 commits into from
Closed

Add Web Crypto API tests and test vectors #34

wants to merge 13 commits into from

Commits on Jul 22, 2017

  1. Implements ECDSA.

    We use Sagemath for elliptic curve.
    
    -------------
    Created by MOE: https://github.com/google/moe
    MOE_MIGRATED_REVID=158512195
    cryptosubtlety authored and Thanh Bui committed Jul 22, 2017
    Configuration menu
    Copy the full SHA
    8f7c748 View commit details
    Browse the repository at this point in the history
  2. Implements ECDH.

    We use Sagemath's elliptic curve.
    
    -------------
    Created by MOE: https://github.com/google/moe
    MOE_MIGRATED_REVID=158512865
    cryptosubtlety authored and Thanh Bui committed Jul 22, 2017
    Configuration menu
    Copy the full SHA
    36086b0 View commit details
    Browse the repository at this point in the history
  3. Fix an accidental modification

    -------------
    Created by MOE: https://github.com/google/moe
    MOE_MIGRATED_REVID=158544445
    cryptosubtlety authored and Thanh Bui committed Jul 22, 2017
    Configuration menu
    Copy the full SHA
    ac932b7 View commit details
    Browse the repository at this point in the history
  4. - Update ecdsa_webcrypto_test.json to the latest version

    - 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
    thanhb committed Jul 22, 2017
    Configuration menu
    Copy the full SHA
    0f68ead View commit details
    Browse the repository at this point in the history
  5. Add presubmit tests

    -------------
    Created by MOE: https://github.com/google/moe
    MOE_MIGRATED_REVID=159454989
    thanhb committed Jul 22, 2017
    Configuration menu
    Copy the full SHA
    6592685 View commit details
    Browse the repository at this point in the history
  6. Add RSA encryption test.

    Also remove some logging lines that were left on some files.
    
    -------------
    Created by MOE: https://github.com/google/moe
    MOE_MIGRATED_REVID=161089409
    thanhb committed Jul 22, 2017
    Configuration menu
    Copy the full SHA
    84c69e9 View commit details
    Browse the repository at this point in the history
  7. Fix exception check on all tests.

    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
    thanhb committed Jul 22, 2017
    Configuration menu
    Copy the full SHA
    7d7dc97 View commit details
    Browse the repository at this point in the history
  8. Add ECDSA bias test.

    -------------
    Created by MOE: https://github.com/google/moe
    MOE_MIGRATED_REVID=161677807
    thanhb committed Jul 22, 2017
    Configuration menu
    Copy the full SHA
    3fd228a View commit details
    Browse the repository at this point in the history
  9. Add ECDH test.

    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
    thanhb committed Jul 22, 2017
    Configuration menu
    Copy the full SHA
    e06d4df View commit details
    Browse the repository at this point in the history
  10. Sync Github --> Google3

    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
    thanhb committed Jul 22, 2017
    Configuration menu
    Copy the full SHA
    6f0a21d View commit details
    Browse the repository at this point in the history
  11. Add BUILD rules for test vectors

    -------------
    Created by MOE: https://github.com/google/moe
    MOE_MIGRATED_REVID=162749326
    thanhb committed Jul 22, 2017
    Configuration menu
    Copy the full SHA
    cf0494c View commit details
    Browse the repository at this point in the history
  12. Update the list of opensource files to include test vectors and javas…

    …cript files.
    
    -------------
    Created by MOE: https://github.com/google/moe
    MOE_MIGRATED_REVID=162786781
    thanhb committed Jul 22, 2017
    Configuration menu
    Copy the full SHA
    48acd4e View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    282f0d3 View commit details
    Browse the repository at this point in the history