87 unsigned int blockSize = this->BlockSize();
88 unsigned int num =
ModPowerOf2(m_countLo, blockSize);
89 size = blockSize - num;
90 return (
byte *)DataBuf() + num;
95 const unsigned int blockSize = this->BlockSize();
97 T* dataBuf = this->DataBuf();
107 if (IsAligned<HashWordType>(input))
110 this->HashEndianCorrectedBlock(input);
114 std::memcpy(dataBuf, input, blockSize);
115 this->HashEndianCorrectedBlock(dataBuf);
120 if (IsAligned<HashWordType>(input))
124 this->HashEndianCorrectedBlock(dataBuf);
128 std::memcpy(dataBuf, input, blockSize);
130 this->HashEndianCorrectedBlock(dataBuf);
134 input += blockSize/
sizeof(T);
137 while (length >= blockSize);
143 unsigned int blockSize = this->BlockSize();
144 unsigned int num =
ModPowerOf2(m_countLo, blockSize);
145 T* dataBuf = this->DataBuf();
146 byte* data = (
byte *)dataBuf;
148 data[num++] = padFirst;
149 if (num <= lastBlockSize)
150 memset(data+num, 0, lastBlockSize-num);
153 memset(data+num, 0, blockSize-num);
155 memset(data, 0, lastBlockSize);
161 m_countLo = m_countHi = 0;
167 CRYPTOPP_ASSERT(digest != NULLPTR);
168 this->ThrowIfInvalidTruncatedSize(size);
170 T* dataBuf = this->DataBuf();
171 T* stateBuf = this->StateBuf();
172 unsigned int blockSize = this->BlockSize();
175 PadLastBlock(blockSize - 2*
sizeof(HashWordType));
181 if (IsAligned<HashWordType>(digest) && size%
sizeof(HashWordType)==0)
182 ConditionalByteReverse<HashWordType>(order, (HashWordType *)(
void*)digest, stateBuf, size);
185 ConditionalByteReverse<HashWordType>(order, stateBuf, stateBuf, this->DigestSize());
186 std::memcpy(digest, stateBuf, size);