Add Comment to DecryptWithNearWrap

Merge from widevine repo of http://go/wvgerrit/14933

There was some confusion what the test DecryptWithNearWrap is
testing.  This CL adds some expanatory comments.

Change-Id: I9228830d81c089f80e0878f647e7e94c3e49896a
This commit is contained in:
Fred Gylys-Colwell
2015-06-29 18:16:21 -07:00
parent fe4288c5d5
commit 54bb6ea3c8

View File

@@ -2689,6 +2689,15 @@ TEST_F(OEMCryptoSessionTestsDecryptEdgeCases, OddOffset) {
subsample_size);
}
// This tests that the algorithm used to increment the counter for
// AES-CTR mode is correct. There are two possible implementations:
// 1) increment the counter as if it were a 128 bit number,
// 2) increment the low 64 bits as a 64 bit number and leave the high bits alone.
// For CENC, the algorithm we should use is the second one. OpenSSL defaults to
// the first. If this test is not passing, you should look at the way you
// increment the counter. Look at the example code in ctr128_inc64 above.
// If you start with an IV of 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE, after you
// increment twice, you should get 0xFFFFFFFFFFFFFFFF0000000000000000.
TEST_F(OEMCryptoSessionTestsDecryptEdgeCases, DecryptWithNearWrap) {
vector<size_t> subsample_size;
subsample_size.push_back(150);