summaryrefslogtreecommitdiff
path: root/validat0.cpp
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2017-09-05 16:28:00 -0400
committerJeffrey Walton <noloader@gmail.com>2017-09-05 16:28:00 -0400
commit37e02f9e0e2ee627f0f95b7bc0a09f4ba1ce562e (patch)
treec8b8cc1e9b0b56998eed479f29aa6f3da33f1755 /validat0.cpp
parent23b939c62b7f497d6f99bfe97ad639b35287ac61 (diff)
downloadcryptopp-git-37e02f9e0e2ee627f0f95b7bc0a09f4ba1ce562e.tar.gz
Revert AltiVec and Power8 commits
The strategy of "cleanup under-aligned buffers" is not scaling well. Corner cases are still turing up. The library has some corner-case breaks, like old 32-bit Intels. And it still has not solved the AltiVec and Power8 alignment problems. For now we are backing out the changes and investigating other strategies
Diffstat (limited to 'validat0.cpp')
-rw-r--r--validat0.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/validat0.cpp b/validat0.cpp
index 43ac4f06..6ee466bd 100644
--- a/validat0.cpp
+++ b/validat0.cpp
@@ -2467,16 +2467,16 @@ bool TestHuffmanCodes()
{
try
{
- SecByteBlock data1(0xfff);
- SecBlock<word32> data2(0xff);
+ byte data1[0xfff]; // Place on stack, avoid new
+ unsigned int data2[0xff];
unsigned int len1 = GlobalRNG().GenerateWord32(4, 0xfff);
- GlobalRNG().GenerateBlock(data1.BytePtr(), data1.SizeInBytes());
+ GlobalRNG().GenerateBlock(data1, len1);
unsigned int len2 = GlobalRNG().GenerateWord32(4, 0xff);
- GlobalRNG().GenerateBlock(data2.BytePtr(), data2.SizeInBytes());
+ GlobalRNG().GenerateBlock((byte*)data2, len2*sizeof(unsigned int));
- ArraySource source(data1.BytePtr(), data1.SizeInBytes(), false);
- HuffmanDecoder decoder(data2.begin(), data2.size());
+ ArraySource source(data1, len1, false);
+ HuffmanDecoder decoder(data2, len2);
LowFirstBitReader reader(source);
unsigned int val;