00001
00002
00003 #include "pch.h"
00004
00005 #ifndef CRYPTOPP_IMPORTS
00006
00007 #include "simple.h"
00008 #include "secblock.h"
00009
00010 NAMESPACE_BEGIN(CryptoPP)
00011
00012 void HashTransformationWithDefaultTruncation::TruncatedFinal(byte *digest, unsigned int digestSize)
00013 {
00014 ThrowIfInvalidTruncatedSize(digestSize);
00015 unsigned int fullDigestSize = DigestSize();
00016 if (digestSize == fullDigestSize)
00017 Final(digest);
00018 else
00019 {
00020 SecByteBlock buffer(fullDigestSize);
00021 Final(buffer);
00022 memcpy(digest, buffer, digestSize);
00023 }
00024 }
00025
00026 NAMESPACE_END
00027
00028 #endif