Reduce data copying in CCM mode by timw · Pull Request #34 · bcgit/bc-java
Remove unnecessary data copying in the CCM mode implementation:
- ByteArrayOutputStream buffers for AD and data are accessed directly to avoid extra allocate+copy of each
- The output buffer is used directly by processPacket output without allocate+copy of a temporary buffer
Tim, this changes the signature of a public method (CCMBlockCipher.processPacket). Please preserve the old version (can deprecate it if you like) and its test coverage.
Also, it would be nice to return the number of output bytes from the new version of processPacket.
Merged with minor changes - the main one beings I've made the ByteArrayOutputStream extension private to the class and I've added a return value to the processPacket method, leaving the other one in place.
bcgit
removed their assignment
This file contains hidden or 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