CTR mode tries to be both a stream and block cipher and fails at both

Review Request #2458 - Created Nov. 19, 2019 and updated

Jason King

CTR mode doesn't work with segment sizes other than AES_BLOCK_LEN. As it is a stream cipher, it should work with any sized input, and as a stream cipher shouldn't accumulate any input data between calls -- it should always be able to act upon an arbitrary size input and immediately produce output.

Updated crypto tests to test different segment sizes, ran updated crypto tests (with and without this change) to verify it works.


  • 2
  • 8
  • 0
  • 10
Description From Last Updated
Can we use more descriptive names for these? It's weird, for example, that out_data_2 is unused. At least, naively. Robert Mustacchi Robert Mustacchi
Previously we cared about pData being NULL, but now we don't care about it at all and are instead only ... Robert Mustacchi Robert Mustacchi
Robert Mustacchi