Spelling corrections
parent
b877782692
commit
5ace5e478a
15
filters.cpp
15
filters.cpp
|
|
@ -694,12 +694,13 @@ void StreamTransformationFilter::NextPutModifiable(byte *inString, size_t length
|
|||
|
||||
void StreamTransformationFilter::LastPut(const byte *inString, size_t length)
|
||||
{
|
||||
// This block is new to StreamTransformationFilter. It somewhat of a hack and was added
|
||||
// for OCB mode; see GitHub Issue 515. The rub with OCB is, its a block cipher and the
|
||||
// last block size can be 0. However, "last block = 0" is not the 0 predacted in the
|
||||
// original code. In the orginal code 0 means "nothing special" so DEFAULT_PADDING is
|
||||
// applied. OCB's 0 literally means a final block size can be 0 or non-0; and no padding
|
||||
// is needed in either case because OCB has its own scheme (see handling of P_* and A_*).
|
||||
// This block is new to StreamTransformationFilter. It is somewhat of a hack and was
|
||||
// added for OCB mode; see GitHub Issue 515. The rub with OCB is, its a block cipher
|
||||
// and the last block size can be 0. However, "last block = 0" is not the 0 predicated
|
||||
// in the original code. In the orginal code 0 means "nothing special" so
|
||||
// DEFAULT_PADDING is applied. OCB's 0 literally means a final block size can be 0 or
|
||||
// non-0; and no padding is needed in either case because OCB has its own scheme (see
|
||||
// handling of P_* and A_*).
|
||||
// Stream ciphers have policy objects to convey how to operate the cipher. The Crypto++
|
||||
// framework operates well when MinLastBlockSize() is 1. However, it did not appear to
|
||||
// cover the OCB case either because we can't stream OCB. It needs full block sizes. In
|
||||
|
|
@ -712,7 +713,7 @@ void StreamTransformationFilter::LastPut(const byte *inString, size_t length)
|
|||
// In some respect we have already hit the need for more information. For example, OCB
|
||||
// calculates the checksum on the cipher text at the same time, so we don't need the
|
||||
// disjoint behavior of calling "EncryptBlock" followed by a separate "AuthenticateBlock".
|
||||
// Additional information may allow us to avoid the two spearate calls.
|
||||
// Additional information may allow us to avoid the two separate calls.
|
||||
if (m_isSpecial)
|
||||
{
|
||||
const size_t leftOver = length % m_mandatoryBlockSize;
|
||||
|
|
|
|||
Loading…
Reference in New Issue