Files
wycheproof/java/com
bdonlan 730842ac8c 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.
2017-06-13 16:43:50 -07:00
..