issue_owner_repo listlengths 2 2 | issue_body stringlengths 0 261k ⌀ | issue_title stringlengths 1 925 | issue_comments_url stringlengths 56 81 | issue_comments_count int64 0 2.5k | issue_created_at stringlengths 20 20 | issue_updated_at stringlengths 20 20 | issue_html_url stringlengths 37 62 | issue_github_id int64 387k 2.46B | issue_number int64 1 127k |
|---|---|---|---|---|---|---|---|---|---|
[
"weidai11",
"cryptopp"
] | [`cryptest.sh`](http://github.com/weidai11/cryptopp/blob/master/cryptest.sh) reports the following under Apple Clang 6.0 (LLVM Clang 3.5). The machine is an early MacBook from 2010 with a Core2 Duo running OS X 10.9. The condition is a Debug build with either `-std=gnu++11` or `-std=c++11`. C++11 engages `alignas` rather than `attribute aligned`. Release builds are OK.
I've known about the potential alignment problem on Unix and GCC compatibles for some time. Under GCC on 64-bit machines, there's a macro `__BIGGEST_ALIGNMENT__` which is usually 16. 16 conflicts with the choice of 8 used by the library. I did not want to mess with it, but it looks like we have an actionable item.
Note: the testing occurs on the `constexpr` dev-branch, which enables `word128`. I've been using it for simultaneous testing. However, the `CRYPTOPP_ALIGN_DATA(8) T m_array ...` is in Master (its original code, and its been around for 15 or 20 years).
```
c++ -DDEBUG -g3 -O0 -std=c++11 -fPIC -march=native -pipe -c validat2.cpp
In file included from validat1.cpp:8:
In file included from ./pubkey.h:45:
In file included from ./integer.h:7:
./secblock.h:422:2: error: requested alignment is less than minimum alignment of 16 for type 'unsigned __int128 [8]'
CRYPTOPP_ALIGN_DATA(8) T m_array[(CRYPTOPP_BOOL_ALIGN16 && T_Align16) ? S+8/sizeof(T) : S];
^
./config.h:902:33: note: expanded from macro 'CRYPTOPP_ALIGN_DATA'
# define CRYPTOPP_ALIGN_DATA(x) alignas(x)
^
./secblock.h:437:19: note: in instantiation of template class 'CryptoPP::FixedSizeAllocatorWithCleanup<unsigned __int128, 8, CryptoPP::AllocatorWithCleanup<unsigned __int128, false>, false>' requested here
typedef typename A::value_type value_type;
^
./secblock.h:773:33: note: in instantiation of template class 'CryptoPP::SecBlock<unsigned __int128, CryptoPP::FixedSizeAllocatorWithCleanup<unsigned __int128, 8, CryptoPP::AllocatorWithCleanup<unsigned __int128, false>, false> >' requested here
class SecBlockWithHint : public SecBlock<T, A>
```
| error: requested alignment is less than minimum alignment of 16 for type 'unsigned __int128 [8]' | https://api.github.com/repos/weidai11/cryptopp/issues/256/comments | 4 | 2016-09-07T16:05:04Z | 2016-09-10T16:12:55Z | https://github.com/weidai11/cryptopp/issues/256 | 175,542,816 | 256 |
[
"weidai11",
"cryptopp"
] | This issue is related to [Issue 252: Rijndael Base::UncheckedSetKey and out-of-bounds read](http://github.com/weidai11/cryptopp/issues/252). In 252, after adding the self tests and changing some of the block ciphers to `FixedKeyLength`, we are catching symbol errors on OS X 10.5 (see below).
The issue is only present for `FixedKeyLength<params>::KEYLENGTH`, where template parameters are the expected ones, like `FixedKeyLength<16u, 4u, 0u>::KEYLENGTH` for a block cipher which only provides a 16-byte key (the `4u` comes from the `IVRequirement`).
Running `otool` on the archive shows the symbol is missing:
```
$ otool -Sv libcryptopp.a | c++filt | grep 'FixedKeyLength<16u, 4u, 0u>::KEYLENGTH'
$
```
OS X 10.5 provides GCC 4.0. This issue also surfaced under Ubuntu 12 with GCC 4.6 and CentOS 5 with GCC 4.1. Also, the issue is _only_ present under Debug Builds.
Finally, the issue is currently limited to the [constexpr dev-branch](http://github.com/weidai11/cryptopp/tree/constexpr).
---
OS X link error messages (Ubuntu and CentOS are similar):
```
g++ -o cryptest.exe -DNDEBUG -g2 -O2 -fPIC -pipe bench1.o bench2.o test.o validat1.o validat2.o validat3.o adhoc.o datatest.o regtest.o fipsalgt.o dlltest.o ./libcryptopp.a
Undefined symbols:
"CryptoPP::FixedKeyLength<20u, 3u, 4u>::KEYLENGTH", referenced from:
__ZN8CryptoPP14FixedKeyLengthILj20ELj3ELj4EE9KEYLENGTHE$non_lazy_ptr in validat1.o
__ZN8CryptoPP14FixedKeyLengthILj20ELj3ELj4EE9KEYLENGTHE$non_lazy_ptr in regtest.o
__ZN8CryptoPP14FixedKeyLengthILj20ELj3ELj4EE9KEYLENGTHE$non_lazy_ptr in libcryptopp.a(seal.o)
"CryptoPP::FixedKeyLength<12u, 4u, 0u>::KEYLENGTH", referenced from:
__ZN8CryptoPP14FixedKeyLengthILj12ELj4ELj0EE9KEYLENGTHE$non_lazy_ptr in validat1.o
__ZN8CryptoPP14FixedKeyLengthILj12ELj4ELj0EE9KEYLENGTHE$non_lazy_ptr in libcryptopp.a(3way.o)
"CryptoPP::FixedKeyLength<16u, 4u, 0u>::KEYLENGTH", referenced from:
__ZN8CryptoPP14FixedKeyLengthILj16ELj4ELj0EE9KEYLENGTHE$non_lazy_ptr in validat1.o
__ZN8CryptoPP14FixedKeyLengthILj16ELj4ELj0EE9KEYLENGTHE$non_lazy_ptr in regtest.o
__ZN8CryptoPP14FixedKeyLengthILj16ELj4ELj0EE9KEYLENGTHE$non_lazy_ptr in libcryptopp.a(square.o)
__ZN8CryptoPP14FixedKeyLengthILj16ELj4ELj0EE9KEYLENGTHE$non_lazy_ptr in libcryptopp.a(default.o)
__ZN8CryptoPP14FixedKeyLengthILj16ELj4ELj0EE9KEYLENGTHE$non_lazy_ptr in libcryptopp.a(idea.o)
__ZN8CryptoPP14FixedKeyLengthILj16ELj4ELj0EE9KEYLENGTHE$non_lazy_ptr in libcryptopp.a(des.o)
__ZN8CryptoPP14FixedKeyLengthILj16ELj4ELj0EE9KEYLENGTHE$non_lazy_ptr in libcryptopp.a(tea.o)
__ZN8CryptoPP14FixedKeyLengthILj16ELj4ELj0EE9KEYLENGTHE$non_lazy_ptr in libcryptopp.a(shark.o)
__ZN8CryptoPP14FixedKeyLengthILj16ELj4ELj0EE9KEYLENGTHE$non_lazy_ptr in libcryptopp.a(seed.o)
"CryptoPP::FixedKeyLength<8u, 4u, 0u>::KEYLENGTH", referenced from:
__ZN8CryptoPP14FixedKeyLengthILj8ELj4ELj0EE9KEYLENGTHE$non_lazy_ptr in validat1.o
__ZN8CryptoPP14FixedKeyLengthILj8ELj4ELj0EE9KEYLENGTHE$non_lazy_ptr in regtest.o
__ZN8CryptoPP14FixedKeyLengthILj8ELj4ELj0EE9KEYLENGTHE$non_lazy_ptr in libcryptopp.a(modes.o)
__ZN8CryptoPP14FixedKeyLengthILj8ELj4ELj0EE9KEYLENGTHE$non_lazy_ptr in libcryptopp.a(des.o)
"CryptoPP::FixedKeyLength<32u, 0u, 32u>::KEYLENGTH", referenced from:
__ZN8CryptoPP14FixedKeyLengthILj32ELj0ELj32EE9KEYLENGTHE$non_lazy_ptr in regtest.o
"CryptoPP::FixedKeyLength<20u, 4u, 0u>::KEYLENGTH", referenced from:
__ZN8CryptoPP14FixedKeyLengthILj20ELj4ELj0EE9KEYLENGTHE$non_lazy_ptr in validat3.o
__ZN8CryptoPP14FixedKeyLengthILj20ELj4ELj0EE9KEYLENGTHE$non_lazy_ptr in regtest.o
"CryptoPP::FixedKeyLength<24u, 4u, 0u>::KEYLENGTH", referenced from:
__ZN8CryptoPP14FixedKeyLengthILj24ELj4ELj0EE9KEYLENGTHE$non_lazy_ptr in validat1.o
__ZN8CryptoPP14FixedKeyLengthILj24ELj4ELj0EE9KEYLENGTHE$non_lazy_ptr in regtest.o
__ZN8CryptoPP14FixedKeyLengthILj24ELj4ELj0EE9KEYLENGTHE$non_lazy_ptr in dlltest.o
__ZN8CryptoPP14FixedKeyLengthILj24ELj4ELj0EE9KEYLENGTHE$non_lazy_ptr in libcryptopp.a(des.o)
__ZN8CryptoPP14FixedKeyLengthILj24ELj4ELj0EE9KEYLENGTHE$non_lazy_ptr in libcryptopp.a(fipstest.o)
"CryptoPP::FixedKeyLength<32u, 0u, 24u>::KEYLENGTH", referenced from:
__ZN8CryptoPP14FixedKeyLengthILj32ELj0ELj24EE9KEYLENGTHE$non_lazy_ptr in regtest.o
"CryptoPP::FixedKeyLength<32u, 4u, 0u>::KEYLENGTH", referenced from:
__ZN8CryptoPP14FixedKeyLengthILj32ELj4ELj0EE9KEYLENGTHE$non_lazy_ptr in validat1.o
__ZN8CryptoPP14FixedKeyLengthILj32ELj4ELj0EE9KEYLENGTHE$non_lazy_ptr in regtest.o
__ZN8CryptoPP14FixedKeyLengthILj32ELj4ELj0EE9KEYLENGTHE$non_lazy_ptr in libcryptopp.a(gost.o)
__ZN8CryptoPP14FixedKeyLengthILj32ELj4ELj0EE9KEYLENGTHE$non_lazy_ptr in libcryptopp.a(wake.o)
"CryptoPP::FixedKeyLength<10u, 4u, 0u>::KEYLENGTH", referenced from:
__ZN8CryptoPP14FixedKeyLengthILj10ELj4ELj0EE9KEYLENGTHE$non_lazy_ptr in validat1.o
__ZN8CryptoPP14FixedKeyLengthILj10ELj4ELj0EE9KEYLENGTHE$non_lazy_ptr in regtest.o
__ZN8CryptoPP14FixedKeyLengthILj10ELj4ELj0EE9KEYLENGTHE$non_lazy_ptr in libcryptopp.a(skipjack.o)
__ZN8CryptoPP14FixedKeyLengthILj10ELj4ELj0EE9KEYLENGTHE$non_lazy_ptr in libcryptopp.a(fipstest.o)
```
| OS X 10.5 and Missing symbols for FixedKeyLength<params>::KEYLENGTH | https://api.github.com/repos/weidai11/cryptopp/issues/255/comments | 1 | 2016-09-06T02:41:36Z | 2016-09-09T00:17:51Z | https://github.com/weidai11/cryptopp/issues/255 | 175,149,144 | 255 |
[
"weidai11",
"cryptopp"
] | I've recently encountered some kind of undefined behaviour and asked on stackoverflow and later on the [mailing list](https://groups.google.com/forum/#!topic/cryptopp-users/Vni5tsU7HT0) after figuring out what was wrong. (Using Version 5.6.3 from the website)
Debugging simultaneously with two Visual Studios (2015 - SP3) through the same solution using the same keys & data with different programs it showed that the values show a first difference at this line:
```
while (true)
{
rk[keylen/4] = rk[0] ^ _mm_extract_epi32(_mm_aeskeygenassist_si128(temp, 0), 3) ^ *(rc++); //<--- Here
```
Curious what is going on there, I checked all values in the line with the debugger, and saw that `rc` is apparently out of bounds.
```
static const word32 rcLE[] = {
0x01, 0x02, 0x04, 0x08,
0x10, 0x20, 0x40, 0x80,
0x1B, 0x36, /* for 128-bit blocks, Rijndael never uses more than 10 rcon values */
};
const word32 *rc = rcLE;
```
Adding a counter to the `while (true)` loop shows that it is being accessed **15 times,** while the in-place **array only has 10 values.**
Taking into consideration that BLOCKSIZE of Rijndael is 16-byte and KEYLENGTH_MULTIPLE is 8-byte, and my data is padded correctly, else it would throw an exception, it should work.
I've also re-checked it with other used algorithms (Blowfish, Twofish, Serpent) and they seemed to work as intended. - Compared hashes of decrypted data with original.
I can also only reproduce this behaviour in one program.
In the other programs or even in a new test project using directly CryptoPP, it still does access out-of-bounds. **It still loops 15 times,** but apparently some kind of... lets call them "magic constant values"... in the memory after it are being accessed and therefore it looks like it is working as intended.
| Rijndael Base::UncheckedSetKey and out-of-bounds read on rcLE | https://api.github.com/repos/weidai11/cryptopp/issues/252/comments | 21 | 2016-09-04T09:05:40Z | 2016-09-16T16:59:42Z | https://github.com/weidai11/cryptopp/issues/252 | 174,939,132 | 252 |
[
"weidai11",
"cryptopp"
] | I by far find Crypto++ beeter with Encrypting things better than the current Executable compressors 1 of them being UPX. It would be nice forsomeone to make a example project that would work as a executable compressor and/or encryptor.
| Make a Example of using Crypto++ as a basis of a Executable compressor. | https://api.github.com/repos/weidai11/cryptopp/issues/251/comments | 1 | 2016-08-30T22:10:30Z | 2016-09-02T04:47:11Z | https://github.com/weidai11/cryptopp/issues/251 | 174,138,685 | 251 |
[
"weidai11",
"cryptopp"
] | Did Crypto++ library support Curve25519 ? If not, when would expected implementation?
| Curve25519 support in Crypto++ | https://api.github.com/repos/weidai11/cryptopp/issues/250/comments | 4 | 2016-08-29T12:01:03Z | 2018-01-18T03:29:13Z | https://github.com/weidai11/cryptopp/issues/250 | 173,758,433 | 250 |
[
"weidai11",
"cryptopp"
] | I read crypto++ wiki https://cryptopp.com/wiki/CMake#Using_the_library_in_other_projects
I tried to add the following code in my cmake project:
``` cmake
find_package(CryptoPP REQUIRED)
target_link_libraries(YOUR_TARGET_NAME cryptopp-shared)
```
However, I got the following error message:
```
By not providing "FindCryptoPP.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "CryptoPP",
but CMake did not find one.
Could not find a package configuration file provided by "CryptoPP" with any
of the following names:
CryptoPPConfig.cmake
cryptopp-config.cmake
Add the installation prefix of "CryptoPP" to CMAKE_PREFIX_PATH or set
"CryptoPP_DIR" to a directory containing one of the above files. If
"CryptoPP" provides a separate development package or SDK, be sure it has
been installed.
```
It seems that "FindCryptoPP.cmake" not found. Does the file provide by cmake or crypto++?
I'm using cmake 3.6.1 and crypto++ 5.6.3.
| How to find crypto++ package using cmake? | https://api.github.com/repos/weidai11/cryptopp/issues/249/comments | 15 | 2016-08-29T02:57:29Z | 2021-11-02T11:04:39Z | https://github.com/weidai11/cryptopp/issues/249 | 173,687,191 | 249 |
[
"weidai11",
"cryptopp"
] | The following was reported by user _ahux_ on Stack Overflow at [Skip'ing on a Source does not work](http://stackoverflow.com/q/39166041):
> I use Crypto++ 5.6.3 and I need the `FileSource Skip(...)` function. Unfortunately this function does nothing!
>
> Here is a example for this function.
>
> ```
> string filename = ...;
> string str;
>
> FileSource file(filename, false, new HexEncoder(new StringSink(str)));
> file.Skip(24);
> file.PumpAll();
> ```
>
> Can somebody help me?
---
Below is the runnable test case using strings.
```
$ cat test.cxx
#include <string>
#include <iostream>
using namespace std;
#include <filters.h>
#include <hex.h>
using namespace CryptoPP;
int main(int argc, char* argv[])
{
string str1, str2;
HexEncoder enc(new StringSink(str1));
for(unsigned int i=0; i < 32; i++)
enc.Put((byte)i);
enc.MessageEnd();
cout << "str1: " << str1 <<endl;
StringSource ss(str1, false, new StringSink(str2));
ss.Skip(10);
ss.PumpAll();
cout << "str2: " << str2 << endl;
return 0;
}
```
Here the [un]expected output:
```
$ ./test.exe
str1: 000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F
str2: 000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F
```
| Skip'ing on a Source does not work | https://api.github.com/repos/weidai11/cryptopp/issues/248/comments | 4 | 2016-08-27T01:53:38Z | 2020-11-23T17:08:23Z | https://github.com/weidai11/cryptopp/issues/248 | 173,571,730 | 248 |
[
"weidai11",
"cryptopp"
] | [`cryptest.sh`](http://github.com/weidai11/cryptopp/blob/master/cryptest.sh) is revealing the following failure under Sun Studio 12.3 (SunCC 5.12). The box is running dual XEON's with SSE2, SSE3 and SSSE3, so it appears limited to `BLAKE2_SSE2_Compress64` at the moment.
```
CXX="/opt/solarisstudio12.3/bin/CC" CXXFLAGS="-DDEBUG -g -xO0 -D__SSE2__ -D__SSE3__ -D__SSSE3__" gmake -j 4
...
$ ./cryptest.exe v
...
BLAKE2b validation suite running...
passed algorithm name
FAILED BLAKE2b test set 0
FAILED BLAKE2b test set 1
FAILED BLAKE2b test set 2
FAILED BLAKE2b test set 3
FAILED BLAKE2b test set 4
FAILED BLAKE2b test set 5
FAILED BLAKE2b test set 6
FAILED BLAKE2b test set 7
FAILED BLAKE2b test set 8
FAILED BLAKE2b test set 9
FAILED BLAKE2b test set 10
FAILED BLAKE2b test set 11
FAILED BLAKE2b test set 12
FAILED BLAKE2b test set 13
FAILED BLAKE2b test set 14
FAILED BLAKE2b test set 15
FAILED BLAKE2b test set 16
FAILED BLAKE2b test set 17
FAILED BLAKE2b test set 18
FAILED BLAKE2b test set 19
FAILED BLAKE2b test set 20
FAILED BLAKE2b test set 21
FAILED BLAKE2b test set 22
FAILED BLAKE2b test set 23
FAILED BLAKE2b test set 24
FAILED BLAKE2b test set 25
FAILED BLAKE2b test set 26
FAILED BLAKE2b test set 27
FAILED BLAKE2b test set 28
FAILED BLAKE2b test set 29
FAILED BLAKE2b test set 30
FAILED BLAKE2b test set 31
FAILED BLAKE2b test set 32
FAILED BLAKE2b test set 33
FAILED BLAKE2b test set 34
FAILED BLAKE2b test set 35
FAILED BLAKE2b test set 36
FAILED BLAKE2b test set 37
FAILED BLAKE2b test set 38
FAILED BLAKE2b test set 39
FAILED BLAKE2b test set 40
FAILED BLAKE2b test set 41
FAILED BLAKE2b test set 42
FAILED BLAKE2b test set 43
FAILED BLAKE2b test set 44
FAILED BLAKE2b test set 45
FAILED BLAKE2b test set 46
FAILED BLAKE2b test set 47
FAILED BLAKE2b test set 48
FAILED BLAKE2b test set 49
FAILED BLAKE2b test set 50
FAILED BLAKE2b test set 51
FAILED BLAKE2b test set 52
FAILED BLAKE2b test set 53
FAILED BLAKE2b test set 54
FAILED BLAKE2b test set 55
FAILED BLAKE2b test set 56
FAILED BLAKE2b test set 57
FAILED BLAKE2b test set 58
FAILED BLAKE2b test set 59
FAILED 60 hashes and keyed hashes
```
| Sun Studio 12.3 and BLAKE2b failures | https://api.github.com/repos/weidai11/cryptopp/issues/247/comments | 1 | 2016-08-24T06:23:42Z | 2016-08-24T06:40:43Z | https://github.com/weidai11/cryptopp/issues/247 | 172,873,619 | 247 |
[
"weidai11",
"cryptopp"
] | [`cryptest.sh`](http://github.com/weidai11/cryptopp/blob/master/cryptest.sh) is revealing the following failure under ARM-32. The result is from a CubieTruck5 running Linaro.
```
Testing: Clang compiler
/usr/bin/clang++ -DNDEBUG -O3 -march=armv7-a -mfpu=neon-vfpv4 -mfloat-abi=hard -c cryptlib.cpp
clang: error: the clang compiler does not support '-mfpu=neon-vfpv4'
make: *** [cryptlib.o] Error 1
ERROR: failed to make cryptest.exe
```
And:
```
$ uname -a
Linux cubietruck 3.4.39 #35 SMP PREEMPT Tue Sep 15 17:17:33 CST 2015 armv7l armv7l armv7l GNU/Linux
$ lsb_release -a
No LSB modules are available.
Distributor ID: Linaro
Description: Linaro 14.04
Release: 14.04
Codename: trusty
```
And:
```
$ clang -v
Ubuntu clang version 3.5-1ubuntu1 (trunk) (based on LLVM 3.5)
Target: arm-unknown-linux-gnueabihf
Thread model: posix
```
| The clang compiler does not support '-mfpu=neon-vfpv4' | https://api.github.com/repos/weidai11/cryptopp/issues/246/comments | 1 | 2016-08-24T04:41:21Z | 2016-08-24T10:37:06Z | https://github.com/weidai11/cryptopp/issues/246 | 172,863,126 | 246 |
[
"weidai11",
"cryptopp"
] | [`cryptest.sh`](http://github.com/weidai11/cryptopp/blob/master/cryptest.sh) is revealing the following failure under Ubuntu 15. The main portion of the testing occurs using GCC. If Clang is available, then a quick testing pass is made with Clang. (The converse also holds. If Clang is the primary compiler for testing, then a quick pass is made with GCC).
The interesting thing below is the machine is a 5th generation Core i7, so `-march=native` should include a cornucopia CPU features, including AVX and BMI. Another unusual thing is the `CXXFLAGS` used. `-maes -mrdrnd -mrdseed -mpclmul` looks like artifacts from the _"AES, RDRAND and RDSEED"_ test.
```
************************************
Testing: Clang compiler
/usr/bin/clang++ -DNDEBUG -g2 -O2 -march=native -maes -mrdrnd -mrdseed -mpclmul -fPIC -march=native -pipe -c cryptlib.cpp
/usr/bin/clang++ -DNDEBUG -g2 -O2 -march=native -maes -mrdrnd -mrdseed -mpclmul -fPIC -march=native -pipe -c cpu.cpp
/usr/bin/clang++ -DNDEBUG -g2 -O2 -march=native -maes -mrdrnd -mrdseed -mpclmul -fPIC -march=native -pipe -c 3way.cpp
/usr/bin/clang++ -DNDEBUG -g2 -O2 -march=native -maes -mrdrnd -mrdseed -mpclmul -fPIC -march=native -pipe -c adler32.cpp
In file included from cpu.cpp:12:
In file included from ./cpu.h:78:
/usr/bin/../lib/clang/3.4/include/tmmintrin.h:28:2: error: "SSSE3 instruction set not enabled"
#error "SSSE3 instruction set not enabled"
^
In file included from cpu.cpp:12:
In file included from ./cpu.h:92:
/usr/bin/../lib/clang/3.4/include/smmintrin.h:28:2: error: "SSE4.1 instruction set not enabled"
#error "SSE4.1 instruction set not enabled"
^
2 errors generated.
make: *** [cpu.o] Error 1
make: *** Waiting for unfinished jobs....
ERROR: failed to make cryptest.exe
```
And:
```
$ clang --version
Ubuntu clang version 3.4-1ubuntu3 (tags/RELEASE_34/final) (based on LLVM 3.4)
Target: x86_64-pc-linux-gnu
Thread model: posix
```
| Clang and "error: SSSE3 instruction set not enabled" | https://api.github.com/repos/weidai11/cryptopp/issues/245/comments | 1 | 2016-08-22T22:51:24Z | 2016-08-24T10:37:23Z | https://github.com/weidai11/cryptopp/issues/245 | 172,573,707 | 245 |
[
"weidai11",
"cryptopp"
] | I am using cryptopp as submodule in a project. The install should go to "3rdparty/".
The CMakeLists.txt i use include the following directives
```
include(ExternalProject)
ExternalProject_Add(libcryptopp
GIT_REPOSITORY https://github.com/weidai11/cryptopp.git
PREFIX ${CRYPTOPP_SRC}
BUILD_IN_SOURCE 1
CONFIGURE_COMMAND cmake . -DCMAKE_INSTALL_PREFIX=${CMAKE_SOURCE_DIR}/3rdparty/
BUILD_COMMAND make install PREFIX=${CMAKE_SOURCE_DIR}/3rdparty/
)
```
This is intended to ensure installation into 3rdparty folder.
The project builds ok, but installation step issues following error:
```
-- Build files have been written to: /home/User/Projects/BitMRC/libcryptopp/src/libcryptopp
[ 10%] Performing build step for 'libcryptopp'
[ 13%] Performing install step for 'libcryptopp'
mkdir: das Verzeichnis »/usr/local/include/cryptopp“ kann nicht angelegt werden: Keine Berechtigung
make[3]: *** [install] Fehler 1
make[2]: *** [libcryptopp/src/libcryptopp-stamp/libcryptopp-install] Fehler 2
make[1]: *** [CMakeFiles/libcryptopp.dir/all] Fehler 2
make: *** [all] Fehler 2
```
Which is german for "the directory ... cannot be created: permission denied" ...
Interestingly, some headers still get installed headers after error, though:
```
$> ls 3rdparty/include/cryptopp/
3way.h argnames.h bench.h cbcmac.h cpu.h dh.h eccrypto.h factory.h gf2_32.h hex.h integer.h md4.h modes.h nr.h pkcspad.h rabin.h resource.h safer.h serpent.h simple.h stdcpp.h trunhash.h wake.h zdeflate.h
adler32.h asn.h blake2.h ccm.h crc.h dll.h ecp.h files.h gf256.h hkdf.h iterhash.h md5.h modexppc.h oaep.h polynomi.h randpool.h rijndael.h salsa.h serpentp.h skipjack.h strciphr.h ttmac.h whrlpool.h zinflate.h
aes.h authenc.h blowfish.h chacha.h cryptlib.h dmac.h elgamal.h filters.h gf2n.h hmac.h lubyrack.h mdc.h mqueue.h oids.h pssr.h rc2.h ripemd.h seal.h sha3.h smartptr.h tea.h twofish.h winpipes.h zlib.h
algebra.h base32.h blumshub.h channels.h default.h dsa.h emsa2.h fips140.h gfpcrypt.h hrtimer.h luc.h mersenne.h mqv.h osrng.h pubkey.h rc5.h rng.h secblock.h shacal2.h socketft.h tiger.h validate.h words.h
algparam.h base64.h camellia.h cmac.h des.h eax.h eprecomp.h fltrimpl.h gost.h ida.h mars.h misc.h nbtheory.h panama.h pwdbased.h rc6.h rsa.h seckey.h sha.h sosemanuk.h trap.h vmac.h xtrcrypt.h
arc4.h basecode.h cast.h config.h dh2.h ec2n.h esign.h gcm.h gzip.h idea.h md2.h modarith.h network.h pch.h queue.h rdrand.h rw.h seed.h shark.h square.h trdlocal.h wait.h xtr.h
```
Cannot figure out, where this "mkdir .." comes from :-(
| Install path cannot be modified for certain targets | https://api.github.com/repos/weidai11/cryptopp/issues/244/comments | 1 | 2016-08-22T08:55:56Z | 2017-08-26T23:20:52Z | https://github.com/weidai11/cryptopp/issues/244 | 172,400,117 | 244 |
[
"weidai11",
"cryptopp"
] | In case there's any interest to it: cross-compiling with toolchain android-ndk-r12b adding the c++11 flag fails.
Steps to reproduce:
```
export ANDROID_NDK_ROOT=~/tools/android-ndk-r12b
export CXXFLAGS=-std=c++11
. ./setenv-android.sh
make -f GNUmakefile-cross
arm-linux-androideabi-g++ -std=c++11 -march=armv5te -mtune=xscale -mthumb -msoft-float -funwind-tables
-fexceptions -frtti -DANDROID --sysroot=~/tools/android-ndk-r12b/platforms/android-21/arch-arm
-Wa,--noexecstack -I!/tools/android-ndk-r12b/sources/cxx-stl/stlport/stlport/ -c cryptlib.cpp
In file included from filters.h:21:0,
from cryptlib.cpp:20:
secblock.h: In member function 'void CryptoPP::AllocatorBase<T>::construct(U*, Args&& ...)':
secblock.h:67:66: error: 'forward' is not a member of 'std'
void construct(U* ptr, Args&&... args) {::new ((void*)ptr) U(std::forward<Args>(args)...);}
^
secblock.h:67:83: error: expected primary-expression before '>' token
void construct(U* ptr, Args&&... args) {::new ((void*)ptr) U(std::forward<Args>(args)...);}
^
GNUmakefile-cross:262: recipe for target 'cryptlib.o' failed
make: *** [cryptlib.o] Error 1
```
| Cross compiling for android with c++11 | https://api.github.com/repos/weidai11/cryptopp/issues/243/comments | 2 | 2016-08-18T10:41:00Z | 2016-08-19T01:36:55Z | https://github.com/weidai11/cryptopp/issues/243 | 171,871,388 | 243 |
[
"weidai11",
"cryptopp"
] | When using sha3.h on your repository I get the following warnings:
warning: 'SHA3_512' is deprecated (declared at ../../cryptopp-90f9d1a/sha3.h:84): SHA-3 will be changing in the future due to FIPS 202 finalization [-Wdeprecated-declarations]
CryptoPP::SHA3_512 sha512;
^
However, if I use cryptopp563, I don't get the warning.
Wasn't this already finalized in 2015? Or weren't these changes included in your repository? I'm confused.
Thanks in advance!
| SHA3 FIPS 202 Deprecation messages | https://api.github.com/repos/weidai11/cryptopp/issues/240/comments | 4 | 2016-08-06T00:00:40Z | 2016-09-10T22:05:17Z | https://github.com/weidai11/cryptopp/issues/240 | 169,716,990 | 240 |
[
"weidai11",
"cryptopp"
] | Damn I wish GCC would follow vendor specifications instead of doing things their own way...
```
Testing: Debug, Aarch32 on Aarch64
g++ -DDEBUG -g3 -O0 -march=armv8-a+crc -mtune=cortex-a53 -mfpu=crypto-neon-fp-armv8 -mfloat-abi=hard -Wno-deprecated-declarations -fPIC -D_GLIBCXX_DEBUG -c cryptlib.cpp
g++ -DDEBUG -g3 -O0 -march=armv8-a+crc -mtune=cortex-a53 -mfpu=crypto-neon-fp-armv8 -mfloat-abi=hard -Wno-deprecated-declarations -fPIC -D_GLIBCXX_DEBUG -c cpu.cpp
In file included from cpu.cpp:12:0:
cpu.h:37:28: fatal error: arm_acle.h: No such file or directory
# include <arm_acle.h>
^
compilation terminated.
make: *** [cpu.o] Error 1
```
| GCC, ARMv8 and "fatal error: arm_acle.h: No such file or directory" | https://api.github.com/repos/weidai11/cryptopp/issues/238/comments | 1 | 2016-08-01T16:59:58Z | 2016-08-01T18:55:36Z | https://github.com/weidai11/cryptopp/issues/238 | 168,693,318 | 238 |
[
"weidai11",
"cryptopp"
] | I'll preface this issue by saying I almost never use windows so I apologize in advance if the error is only on my end.
Building against 0b8cea5 on Kovri's win build machine:
```
$ mkdir kovri/deps/cryptopp/build && cd kovri/deps/cryptopp/build
$ cmake -G 'MSYS Makefiles' ../
-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is GNU 5.4.0
-- Check for working C compiler: C:/msys64/mingw64/bin/gcc.exe
-- Check for working C compiler: C:/msys64/mingw64/bin/gcc.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: C:/msys64/mingw64/bin/g++.exe
-- Check for working CXX compiler: C:/msys64/mingw64/bin/g++.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Check if the system is big endian
-- Searching 16 bit integer
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of unsigned short
-- Check size of unsigned short - done
-- Using unsigned short
-- Check if the system is big endian - little endian
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - found
-- Found Threads: TRUE
-- Configuring done
-- Generating done
-- Build files have been written to: C:/msys64/home/Administrator/kovri/deps/cryptopp/build
```
```
$ make
...
C:/msys64/home/Administrator/kovri/deps/cryptopp/cpu.cpp: In function 'bool CryptoPP::CpuId(CryptoPP::word32, CryptoPP::word32*)': [3/13]
C:/msys64/home/Administrator/kovri/deps/cryptopp/cpu.cpp:106:11: error: 'sigset_t' does not name a type
volatile sigset_t oldMask;
^
C:/msys64/home/Administrator/kovri/deps/cryptopp/cpu.cpp:107:28: error: 'sigset_t' was not declared in this scope
if (sigprocmask(0, NULL, (sigset_t*)&oldMask))
^
C:/msys64/home/Administrator/kovri/deps/cryptopp/cpu.cpp:107:37: error: expected primary-expression before ')' token
if (sigprocmask(0, NULL, (sigset_t*)&oldMask))
^
C:/msys64/home/Administrator/kovri/deps/cryptopp/cpu.cpp:107:39: error: 'oldMask' was not declared in this scope
if (sigprocmask(0, NULL, (sigset_t*)&oldMask))
^
C:/msys64/home/Administrator/kovri/deps/cryptopp/cpu.cpp:107:46: error: 'sigprocmask' was not declared in this scope
if (sigprocmask(0, NULL, (sigset_t*)&oldMask))
^
C:/msys64/home/Administrator/kovri/deps/cryptopp/cpu.cpp:128:28: error: 'sigset_t' was not declared in this scope
sigprocmask(SIG_SETMASK, (sigset_t*)&oldMask, NULL);
^
C:/msys64/home/Administrator/kovri/deps/cryptopp/cpu.cpp:128:37: error: expected primary-expression before ')' token
sigprocmask(SIG_SETMASK, (sigset_t*)&oldMask, NULL);
^
C:/msys64/home/Administrator/kovri/deps/cryptopp/cpu.cpp:128:39: error: 'oldMask' was not declared in this scope
sigprocmask(SIG_SETMASK, (sigset_t*)&oldMask, NULL);
^
C:/msys64/home/Administrator/kovri/deps/cryptopp/cpu.cpp:128:52: error: 'sigprocmask' was not declared in this scope
sigprocmask(SIG_SETMASK, (sigset_t*)&oldMask, NULL);
^
make[2]: *** [CMakeFiles/cryptopp-object.dir/build.make:87: CMakeFiles/cryptopp-object.dir/cpu.cpp.obj] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/Makefile2:68: CMakeFiles/cryptopp-object.dir/all] Error 2
make: *** [Makefile:139: all] Error 2
```
```
$ cd c:/msys64/mingw64 && grep -R sigset_t | grep types
x86_64-w64-mingw32/include/sys/types.h:typedef unsigned long long _sigset_t;
x86_64-w64-mingw32/include/sys/types.h:typedef unsigned long _sigset_t;
x86_64-w64-mingw32/include/sys/types.h:typedef _sigset_t sigset_t;
```
**Note:** mingw is not yet supported for Kovri so building manually within `deps/cryptopp` is needed for testing.
- The same results are given when running `cryptest.sh`
- Simply including `<sys/types.h>` in `cpu.cpp` has no effect
| Mingw-w64: 'sigset_t' does not name a type | https://api.github.com/repos/weidai11/cryptopp/issues/237/comments | 9 | 2016-07-31T23:08:27Z | 2016-08-01T20:25:38Z | https://github.com/weidai11/cryptopp/issues/237 | 168,543,399 | 237 |
[
"weidai11",
"cryptopp"
] | We're catching a compile error on CPU dev-branch with Debian/x86_64/GCC 4.9 and Cygwin/x86_64/GCC 5.4. The error surfaced after [Commit 0e603ddc5d9ac383](http://github.com/weidai11/cryptopp/commit/0e603ddc5d9ac3834d5f571d6c0c771ea041e36a), which used the data model to determine `word64` typedef.
The error is as follows on x86_64. There are 6 of them.
```
rdrand.cpp:178:37: error: invalid conversion from ‘CryptoPP::word64* {aka long unsigned int*}’
to ‘long long unsigned int*’ [-fpermissive]
if (_rdrand64_step((word64*)output))
^
In file included from /usr/lib/gcc/x86_64-linux-gnu/4.9/include/x86intrin.h:46:0,
from cpu.h:45,
from rdrand.cpp:9:
/usr/lib/gcc/x86_64-linux-gnu/4.9/include/immintrin.h:166:1: note: initializing argument 1
of ‘int _rdrand64_step(long long unsigned int*)’
_rdrand64_step (unsigned long long *__P)
^
```
If we typedef `word64` as `long long unsigned int`, then it breaks ARM:
```
$ gcc test.cc -o test.exe
test.cc: In function ‘int main(int, char**)’:
test.cc:21:16: error: invalid conversion from ‘my_u64* {aka long long unsigned int*}’ to
‘const uint64_t* {aka const long unsigned int*}’ [-fpermissive]
vld1q_u64(val);
^
In file included from test.cc:4:0:
/usr/lib/gcc/aarch64-linux-gnu/4.9/include/arm_neon.h:17003:1: note: initializing
argument 1 of ‘uint64x2_t vld1q_u64(const uint64_t*)’
vld1q_u64 (const uint64_t *a)
^
```
---
There are two open questions related to using the built-in types `unsigned long` and `unsigned long long`:
- [How to clear compile error when using rdrand64_step due to typedef'ing a 64-bit type?](http://gcc.gnu.org/ml/gcc-help/2016-07/msg00084.html) on the GCC Users mailing list
- [Selecting 'long' versus 'long long' as 64-bit type under LP64/ILP64/LLP64 data models?](http://stackoverflow.com/q/38681146) on Stack Overflow
| word64 compile problems due to SSE2 and NEON interfaces | https://api.github.com/repos/weidai11/cryptopp/issues/236/comments | 2 | 2016-07-31T06:09:27Z | 2016-09-08T06:23:40Z | https://github.com/weidai11/cryptopp/issues/236 | 168,503,926 | 236 |
[
"weidai11",
"cryptopp"
] | Pass by const reference for better perfrormance:
File _ecp.cpp_, line 348
`int operator-(const ZIterator& it2) {return int(it-it2.it);}`
File _integer.cpp_, line 372
`Word operator-(const Word& a)`
Another subject.
File _algebra.h_
`template <class T> class EuclideanDomainOf : public`AbstractEuclideanDomain<T>
Base class' protected member is redeclared as private:
`mutable Element result;`
It should have no effect with public inheritance.
| Suggested by code analyzer | https://api.github.com/repos/weidai11/cryptopp/issues/235/comments | 8 | 2016-07-30T23:08:23Z | 2016-08-03T18:23:53Z | https://github.com/weidai11/cryptopp/issues/235 | 168,491,474 | 235 |
[
"weidai11",
"cryptopp"
] | This is currently in the GCM dev-branch, but it will be moved to Master eventually.
```
/usr/bin/clang++ -DNDEBUG -g2 -O2 -march=armv8-a+crc+crypto -fPIC -pipe -c gcm.cpp
gcm.cpp:200:7: error: no matching function for call to 'vcombine_u64'
c1 = vcombine_u64(vgetq_lane_u64(c1, 0), vgetq_lane_u64(c2, 0));
^~~~~~~~~~~~
/usr/include/clang/3.5.0/include/arm_neon.h:4033:17: note: candidate function not viable: no known conversion
from 'uint64_t' (aka 'unsigned long') to 'uint64x1_t' (vector of 1 'uint64_t' value) for 1st argument
__ai uint64x2_t vcombine_u64(uint64x1_t __p0, uint64x1_t __p1) {
^
1 error generated.
```
| Clang 3.5 and "error: no matching function for call to vcombine_u64" | https://api.github.com/repos/weidai11/cryptopp/issues/234/comments | 2 | 2016-07-30T03:04:53Z | 2016-07-30T05:41:49Z | https://github.com/weidai11/cryptopp/issues/234 | 168,445,547 | 234 |
[
"weidai11",
"cryptopp"
] | We got an Aarch32 test case together with the help of GCC and SO. Aarch32 is basically the 32-bit instruction set from ARMv8. Its slightly different than the traditional 32-bit instruction set from ARMv7 and below. Also see [ARM NEON programming quick reference](https://community.arm.com/groups/android-community/blog/2015/03/27/arm-neon-programming-quick-reference).
We are experiencing a compiler crash on a Raspberry Pi 3 undr GCC 4.9.2:
```
$ make cpu.o
g++ -DNDEBUG -g2 -O3 -march=armv8-a+crc -mtune=cortex-a53 -mfpu=crypto-neon-fp-armv8 -fPIC -c cpu.cpp
cpu.cpp: In function ‘bool CryptoPP::TryPMULL()’:
cpu.cpp:476:16: internal compiler error: in expand_shift_1, at expmed.c:2318
result = (r1 != r2);
^
Please submit a full bug report...
```
Here's the relevant code from [`cpu.cpp`](http://github.com/weidai11/cryptopp/blob/master/cpu.cpp). It simply tests for the availability of `PMULL` and `PMULL2`:
```
const poly64_t a1={1}, b1={2};
const poly64x2_t a2={1}, b2={2};
const poly128_t r1 = vmull_p64(a1, b1);
const poly128_t r2 = vmull_high_p64(a2, b2);
result = (r1 != r2);
```
According to the GCC folks, the comparison is dodgy. Also see [Issue 72738 - internal compiler error: in expand_shift_1, at expmed.c:2318](http://gcc.gnu.org/bugzilla/show_bug.cgi?id=72738).
I kind of knew it was dodgy, but I did not pay it much mind. It was a low priority because I was having trouble finding the intrinsic to convert it to a `*_u64` or `*_u32` type. The code also worked under ARMv7 and ARMv8/Aarch64. Finally, there were no diagnostics at `-Wall -Wextra`.
Once in a more normal form, we can simply compare values after lane extraction. For example, the other tests perform:
```
result = !!(vgetq_lane_u64(x3,0) | vgetq_lane_u64(x4,1));
```
| Aarch32, GCC 4.9 and internal compiler error: in expand_shift_1, at expmed.c:2318 | https://api.github.com/repos/weidai11/cryptopp/issues/233/comments | 1 | 2016-07-28T12:00:36Z | 2016-07-29T03:58:23Z | https://github.com/weidai11/cryptopp/issues/233 | 168,078,993 | 233 |
[
"weidai11",
"cryptopp"
] | The following link errors occur **only** with clang when linking against [Kovri](https://github.com/monero-project/kovri). Tested on Arch, Ubuntu 14.04/15.10 and OSX 10.9.5 (clang 3.8.0, 3.6.0, 3.6.2, Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn), respectively).
I've only tested against 0b8cea5 and `CRYPTOPP_5_6_3`. Note: linkage is successful when building against the latest tag.
``` bash
$ git clone --recursive https://github.com/monero-project/kovri
$ git checkout 368bfdc # current HEAD (for reference)
$ cd kovri/ && export CC=clang CXX=clang++ && make -j4 dependencies && make -j4
```
Linux:
```
../../libkovri-core.a(AES.cpp.o):(.data.rel.ro._ZTVN8CryptoPP16BlockCipherFinalILNS_9CipherDirE1ENS_8Rijndael3DecEEE[_ZTVN8CryptoPP16BlockCipherFinalILNS_9CipherDirE1ENS_8Rijndael3DecEEE]+0xa8): undefined reference to `CryptoPP::Rijndael::
Dec::AdvancedProcessBlocks(unsigned char const*, unsigned char const*, unsigned char*, unsigned long, unsigned int) const'
../../libkovri-core.a(AES.cpp.o):(.data.rel.ro._ZTVN8CryptoPP16BlockCipherFinalILNS_9CipherDirE1ENS_8Rijndael3DecEEE[_ZTVN8CryptoPP16BlockCipherFinalILNS_9CipherDirE1ENS_8Rijndael3DecEEE]+0x120): undefined reference to `non-virtual thunk t
o CryptoPP::Rijndael::Dec::AdvancedProcessBlocks(unsigned char const*, unsigned char const*, unsigned char*, unsigned long, unsigned int) const'
../../libkovri-core.a(AES.cpp.o):(.data.rel.ro._ZTVN8CryptoPP12ClonableImplINS_16BlockCipherFinalILNS_9CipherDirE1ENS_8Rijndael3DecEEES4_EE[_ZTVN8CryptoPP12ClonableImplINS_16BlockCipherFinalILNS_9CipherDirE1ENS_8Rijndael3DecEEES4_EE]+0xa8)
: undefined reference to `CryptoPP::Rijndael::Dec::AdvancedProcessBlocks(unsigned char const*, unsigned char const*, unsigned char*, unsigned long, unsigned int) const'
../../libkovri-core.a(AES.cpp.o):(.data.rel.ro._ZTVN8CryptoPP12ClonableImplINS_16BlockCipherFinalILNS_9CipherDirE1ENS_8Rijndael3DecEEES4_EE[_ZTVN8CryptoPP12ClonableImplINS_16BlockCipherFinalILNS_9CipherDirE1ENS_8Rijndael3DecEEES4_EE]+0x118
): undefined reference to `non-virtual thunk to CryptoPP::Rijndael::Dec::AdvancedProcessBlocks(unsigned char const*, unsigned char const*, unsigned char*, unsigned long, unsigned int) const'
```
OSX 10.9.5:
```
Undefined symbols for architecture x86_64:
"CryptoPP::Rijndael::Dec::AdvancedProcessBlocks(unsigned char const*, unsigned char const*, unsigned char*, unsigned long, unsigned int) const", referenced from:
vtable for CryptoPP::BlockCipherFinal<(CryptoPP::CipherDir)1, CryptoPP::Rijndael::Dec> in libkovri-core.a(AES.cpp.o)
vtable for CryptoPP::ClonableImpl<CryptoPP::BlockCipherFinal<(CryptoPP::CipherDir)1, CryptoPP::Rijndael::Dec>, CryptoPP::Rijndael::Dec> in libkovri-core.a(AES.cpp.o)
"non-virtual thunk to CryptoPP::Rijndael::Dec::AdvancedProcessBlocks(unsigned char const*, unsigned char const*, unsigned char*, unsigned long, unsigned int) const", referenced from:
vtable for CryptoPP::BlockCipherFinal<(CryptoPP::CipherDir)1, CryptoPP::Rijndael::Dec> in libkovri-core.a(AES.cpp.o)
vtable for CryptoPP::ClonableImpl<CryptoPP::BlockCipherFinal<(CryptoPP::CipherDir)1, CryptoPP::Rijndael::Dec>, CryptoPP::Rijndael::Dec> in libkovri-core.a(AES.cpp.o)
```
Kovri's build is [successful](https://travis-ci.org/monero-project/kovri/builds/147921883) with gcc5/6.
I don't develop exclusively with clang so please forgive me if the solution is simple. Since building against the latest tagged crypto++ release is successful, I imagine that there is something newer that may be running amuck.
| Clang link errors when linking against Kovri | https://api.github.com/repos/weidai11/cryptopp/issues/232/comments | 8 | 2016-07-28T01:58:57Z | 2016-08-22T10:44:33Z | https://github.com/weidai11/cryptopp/issues/232 | 167,997,211 | 232 |
[
"weidai11",
"cryptopp"
] | Testing on a Raspberry Pi 3 is revealing a Bus Error. The RPI-3 is unique in that its ARMv8 with CRC extensions, but not Crypto extensions. Moreover, its running an ARMv7 hard-float (ARMHF) image. The combination explains the odd combinations of `CXXFLAGS` to enable features.
```
$ export CXXFLAGS="-DNDEBUG -g2 -O3 -march=armv8-a+crc -mfpu=neon -mfloat-abi=hard"
$ make
...
Using seed: 1469597911
Testing Settings...
passed: Your machine is little endian.
passed: Your machine allows unaligned data access.
passed: sizeof(byte) == 1
passed: sizeof(word16) == 2
passed: sizeof(word32) == 4
passed: sizeof(word64) == 8
passed: sizeof(hword) == 2, sizeof(word) == 4, sizeof(dword) == 8
passed: hasNEON == 1, hasPMULL == 0, hasCRC32 == 1, hasAES == 0, hasSHA1 == 0, hasSHA2 == 0
...
Testing MessageDigest algorithm SHA-3-224.
....
Program received signal SIGBUS, Bus error.
0x0016b660 in CryptoPP::xorbuf (buf=0x31708a "",
mask=mask@entry=0x7effd414 "ghfghighijhijkijkljklmklmnlmnomnop)\352\345P\022\266s over the lazy dog", 'a' <repeats 141 times>..., count=count@entry=0x22)
at misc.cpp:49
49 ((word32*)(void*)buf)[i] ^= ((word32*)(void*)mask)[i];
(gdb)
```
I believe that's our old friend `ALLOW_UNALIGNED_DATA_ASCCESS`.
---
```
$ gcc --version
gcc (Raspbian 4.9.2-10) 4.9.2
```
| Raspberry Pi 3 and Bus Error | https://api.github.com/repos/weidai11/cryptopp/issues/231/comments | 1 | 2016-07-27T05:46:17Z | 2016-07-29T09:58:14Z | https://github.com/weidai11/cryptopp/issues/231 | 167,776,026 | 231 |
[
"weidai11",
"cryptopp"
] | [`cryptest.sh`](htts://github.com/weidai11/cryptopp/blob/master/cryptest.sh) is revealing the following issue on a Intel Core i7 5300. The 5th generation processor means BMI and BMI2 are available.
```
$ CXX=/bin/g++ gmake cpu.o
/bin/g++ -DNDEBUG -g2 -O2 -fPIC -march=native -Wa,--divide -pipe -c cpu.cpp
In file included from cpu.cpp:13:0:
misc.h: In function ‘unsigned int CryptoPP::TrailingZeros(CryptoPP::word64)’:
misc.h:706:35: error: ‘_tzcnt_u64’ was not declared in this scope
return (unsigned int)_tzcnt_u64(v);
^
misc.h: In function ‘bool CryptoPP::IsPowerOf2(const T&) [with T = long long unsigned int]’:
misc.h:821:37: error: ‘_blsr_u64’ was not declared in this scope
return value > 0 && _blsr_u64(value) == 0;
^
gmake: *** [cpu.o] Error 1
```
And:
```
$ /bin/g++ --version
g++ (GCC) 4.8.2
Copyright (C) 2013 Free Software Foundation, Inc.
```
| Sun GCC and missing 64-bit BMI/BMI2 instructions | https://api.github.com/repos/weidai11/cryptopp/issues/230/comments | 1 | 2016-07-20T04:57:58Z | 2016-07-20T08:08:50Z | https://github.com/weidai11/cryptopp/issues/230 | 166,495,896 | 230 |
[
"weidai11",
"cryptopp"
] | Compiling `rijndael.cpp` under Sun Studio 12.2 is failing to compile due to:
```
std::swap(*(__m128i *)(void *)(rk), *(__m128i *)(void *)(rk+4*m_rounds));
```
`__m128i` is an `unsigned long long[2]`, and C++03 does not provide the support to swap an array (C++11 formally added it). It seems all the other compilers simply accept it.
```
/opt/solarisstudio12.3/bin/CC -DDEBUG -g3 -xO0 -D__SSE2__ -D__SSE3__ -D__SSSE3__ -D__SSE4_1__ -D__SSE4_2__ -D__AES__ -D__PCLMUL__ \
-D__RDRND__ -D__RDSEED__ -D__AVX__ -D__AVX2__ -D__BMI__ -D__BMI2__ -native -m64 -KPIC -template=no%extdef -c rijndael.cpp
CC: Warning: -xchip=native detection failed, falling back to -xchip=generic
"/opt/solarisstudio12.3/prod/include/CC/Cstd/algorithm", line 283: Error: Cannot use vector unsigned long long[2] to initialize vector unsigned long long[2].
"rijndael.cpp", line 277: Where: While instantiating "std::swap<vector unsigned long long[2]>(unsigned long long(&)[2], unsigned long long(&)[2])".
"rijndael.cpp", line 277: Where: Instantiated from non-template code.
1 Error(s) detected.
gmake: *** [rijndael.o] Error 2
gmake: *** Waiting for unfinished jobs....
ERROR: failed to make cryptest.exe
```
| Sun Studio 12.1-12.3 and Error: cannot use vector unsigned long long[2] to initialize vector unsigned long long[2] | https://api.github.com/repos/weidai11/cryptopp/issues/229/comments | 1 | 2016-07-17T02:52:49Z | 2016-07-17T03:55:40Z | https://github.com/weidai11/cryptopp/issues/229 | 165,957,525 | 229 |
[
"weidai11",
"cryptopp"
] | The _Platform CXXFLAGS_ are `-D__SSE2__ -D__SSE3__ -D__SSSE3__ -D__SSE4_1__ -D__SSE4_2__ -D__AES__ -D__PCLMUL__ -D__RDRND__ -D__AVX__`. They are the defines that correspond to the CPU features from `isainfo -v`. They are how we determine the ASM and intrinsics to use because SunCC does not define them. Each machine will have different platform defines because each processor can be different.
I don't recall seeing this issue under another Solaris test machine. The other machine has dual Xeon's, so it only uses `-D__SSE2__ -D__SSE3__ -D__SSSE3__`. That means it could be related to SSE4+ defines. More testing is needed.
There's a similar report at [Studio Express under Linux can't handle <string> header](http://community.oracle.com/thread/1995416?start=0&tstart=0) on the Oracle message boards. No useful answers. Also see [Strange C++ error when using newer Sun Studio compiler](http://community.oracle.com/thread/1994545?start=0&tstart=0), which does provide useful information.
```
************************************
Testing: Sun Studio 12.2, debug, default CXXFLAGS
/opt/solstudio12.2/bin/CC -DDEBUG -g -xO0 -D__SSE2__ -D__SSE3__ -D__SSSE3__ -D__SSE4_1__ -D__SSE4_2__ -D__AES__ -D__PCLMUL__ -D__RDRND__ -D__AVX__ -native -m64 -KPIC -template=no%extdef -w -erroff=wvarhidemem -erroff=voidretw -c cryptlib.cpp
/opt/solstudio12.2/bin/CC -DDEBUG -g -xO0 -D__SSE2__ -D__SSE3__ -D__SSSE3__ -D__SSE4_1__ -D__SSE4_2__ -D__AES__ -D__PCLMUL__ -D__RDRND__ -D__AVX__ -native -m64 -KPIC -template=no%extdef -w -erroff=wvarhidemem -erroff=voidretw -c cpu.cpp
CC: Warning: -xchip=native detection failed, falling back to -xchip=generic
CC: Warning: -xchip=native detection failed, falling back to -xchip=generic
"/opt/solstudio12.2/prod/include/CC/new", line 39: Error: operator new(unsigned long) was declared before with a different language.
"/opt/solstudio12.2/prod/include/CC/new", line 42: Error: operator delete(void*) was declared before with a different language.
"/opt/solstudio12.2/prod/include/CC/new", line 44: Error: operator new[](unsigned long) was declared before with a different language.
"/opt/solstudio12.2/prod/include/CC/new", line 47: Error: operator delete[](void*) was declared before with a different language.
"/opt/solstudio12.2/prod/include/CC/new", line 60: Error: Only one of a set of overloaded functions can be extern "C".
"/opt/solstudio12.2/prod/include/CC/new", line 61: Error: Only one of a set of overloaded functions can be extern "C".
"/opt/solstudio12.2/prod/include/CC/new", line 62: Error: Only one of a set of overloaded functions can be extern "C".
"/opt/solstudio12.2/prod/include/CC/new", line 63: Error: Only one of a set of overloaded functions can be extern "C".
"/opt/solstudio12.2/prod/include/CC/Cstd/rw/iterator", line 107: Error: Template declarations cannot have extern "C" linkage.
"/opt/solstudio12.2/prod/include/CC/Cstd/rw/iterator", line 170: Error: Template declarations cannot have extern "C" linkage.
"/opt/solstudio12.2/prod/include/CC/Cstd/rw/iterator", line 186: Error: Template declarations cannot have extern "C" linkage.
"/opt/solstudio12.2/prod/include/CC/Cstd/rw/iterator", line 199: Error: Template declarations cannot have extern "C" linkage.
"/opt/solstudio12.2/prod/include/CC/Cstd/rw/iterator", line 203: Error: Template declarations cannot have extern "C" linkage.
"/opt/solstudio12.2/prod/include/CC/Cstd/rw/iterator", line 207: Error: Template declarations cannot have extern "C" linkage.
"/opt/solstudio12.2/prod/include/CC/Cstd/rw/iterator", line 218: Error: Only one of a set of overloaded functions can be extern "C".
"/opt/solstudio12.2/prod/include/CC/Cstd/rw/iterator", line 226: Error: Template declarations cannot have extern "C" linkage.
"/opt/solstudio12.2/prod/include/CC/Cstd/rw/iterator", line 240: Error: Template declarations cannot have extern "C" linkage.
"/opt/solstudio12.2/prod/include/CC/Cstd/rw/iterator", line 250: Error: Template declarations cannot have extern "C" linkage.
"/opt/solstudio12.2/prod/include/CC/Cstd/rw/iterator", line 265: Error: Template declarations cannot have extern "C" linkage.
"/opt/solstudio12.2/prod/include/CC/Cstd/rw/iterator", line 276: Error: Template declarations cannot have extern "C" linkage.
"/opt/solstudio12.2/prod/include/CC/Cstd/rw/iterator", line 279: Error: Template declarations cannot have extern "C" linkage.
"/opt/solstudio12.2/prod/include/CC/Cstd/rw/iterator", line 280: Error: Only one of a set of overloaded functions can be extern "C".
"/opt/solstudio12.2/prod/include/CC/Cstd/rw/iterator", line 282: Error: Template declarations cannot have extern "C" linkage.
"/opt/solstudio12.2/prod/include/CC/Cstd/rw/iterator", line 284: Error: Only one of a set of overloaded functions can be extern "C".
"/opt/solstudio12.2/prod/include/CC/Cstd/rw/iterator", line 284: Error: Only one of a set of overloaded functions can be extern "C".
Compilation aborted, too many Error messages.
gmake: *** [cpu.o] Error 2
gmake: *** Waiting for unfinished jobs....
ERROR: failed to make cryptest.exe
************************************
Testing: Sun Studio 12.2, release, default CXXFLAGS
/opt/solstudio12.2/bin/CC -DNDEBUG -g0 -xO2 -D__SSE2__ -D__SSE3__ -D__SSSE3__ -D__SSE4_1__ -D__SSE4_2__ -D__AES__ -D__PCLMUL__ -D__RDRND__ -D__AVX__ -native -m64 -KPIC -template=no%extdef -w -erroff=wvarhidemem -erroff=voidretw -c cryptlib.cpp
/opt/solstudio12.2/bin/CC -DNDEBUG -g0 -xO2 -D__SSE2__ -D__SSE3__ -D__SSSE3__ -D__SSE4_1__ -D__SSE4_2__ -D__AES__ -D__PCLMUL__ -D__RDRND__ -D__AVX__ -native -m64 -KPIC -template=no%extdef -w -erroff=wvarhidemem -erroff=voidretw -c cpu.cpp
CC: Warning: -xchip=native detection failed, falling back to -xchip=generic
CC: Warning: -xchip=native detection failed, falling back to -xchip=generic
"/opt/solstudio12.2/prod/include/CC/new", line 39: Error: operator new(unsigned long) was declared before with a different language.
"/opt/solstudio12.2/prod/include/CC/new", line 42: Error: operator delete(void*) was declared before with a different language.
"/opt/solstudio12.2/prod/include/CC/new", line 44: Error: operator new[](unsigned long) was declared before with a different language.
"/opt/solstudio12.2/prod/include/CC/new", line 47: Error: operator delete[](void*) was declared before with a different language.
"/opt/solstudio12.2/prod/include/CC/new", line 60: Error: Only one of a set of overloaded functions can be extern "C".
"/opt/solstudio12.2/prod/include/CC/new", line 61: Error: Only one of a set of overloaded functions can be extern "C".
"/opt/solstudio12.2/prod/include/CC/new", line 62: Error: Only one of a set of overloaded functions can be extern "C".
"/opt/solstudio12.2/prod/include/CC/new", line 63: Error: Only one of a set of overloaded functions can be extern "C".
"/opt/solstudio12.2/prod/include/CC/Cstd/rw/iterator", line 107: Error: Template declarations cannot have extern "C" linkage.
"/opt/solstudio12.2/prod/include/CC/Cstd/rw/iterator", line 170: Error: Template declarations cannot have extern "C" linkage.
"/opt/solstudio12.2/prod/include/CC/Cstd/rw/iterator", line 186: Error: Template declarations cannot have extern "C" linkage.
"/opt/solstudio12.2/prod/include/CC/Cstd/rw/iterator", line 199: Error: Template declarations cannot have extern "C" linkage.
"/opt/solstudio12.2/prod/include/CC/Cstd/rw/iterator", line 203: Error: Template declarations cannot have extern "C" linkage.
"/opt/solstudio12.2/prod/include/CC/Cstd/rw/iterator", line 207: Error: Template declarations cannot have extern "C" linkage.
"/opt/solstudio12.2/prod/include/CC/Cstd/rw/iterator", line 218: Error: Only one of a set of overloaded functions can be extern "C".
"/opt/solstudio12.2/prod/include/CC/Cstd/rw/iterator", line 226: Error: Template declarations cannot have extern "C" linkage.
"/opt/solstudio12.2/prod/include/CC/Cstd/rw/iterator", line 240: Error: Template declarations cannot have extern "C" linkage.
"/opt/solstudio12.2/prod/include/CC/Cstd/rw/iterator", line 250: Error: Template declarations cannot have extern "C" linkage.
"/opt/solstudio12.2/prod/include/CC/Cstd/rw/iterator", line 265: Error: Template declarations cannot have extern "C" linkage.
"/opt/solstudio12.2/prod/include/CC/Cstd/rw/iterator", line 276: Error: Template declarations cannot have extern "C" linkage.
"/opt/solstudio12.2/prod/include/CC/Cstd/rw/iterator", line 279: Error: Template declarations cannot have extern "C" linkage.
"/opt/solstudio12.2/prod/include/CC/Cstd/rw/iterator", line 280: Error: Only one of a set of overloaded functions can be extern "C".
"/opt/solstudio12.2/prod/include/CC/Cstd/rw/iterator", line 282: Error: Template declarations cannot have extern "C" linkage.
"/opt/solstudio12.2/prod/include/CC/Cstd/rw/iterator", line 284: Error: Only one of a set of overloaded functions can be extern "C".
"/opt/solstudio12.2/prod/include/CC/Cstd/rw/iterator", line 284: Error: Only one of a set of overloaded functions can be extern "C".
Compilation aborted, too many Error messages.
gmake: *** [cpu.o] Error 2
gmake: *** Waiting for unfinished jobs....
ERROR: failed to make cryptest.exe
```
| SunCC 12.2 and failed compile using Platform CXXFLAGS | https://api.github.com/repos/weidai11/cryptopp/issues/228/comments | 2 | 2016-07-15T19:51:43Z | 2016-07-15T21:55:47Z | https://github.com/weidai11/cryptopp/issues/228 | 165,864,462 | 228 |
[
"weidai11",
"cryptopp"
] | [Issue 226, SunCC 12.2-12.4 with C++11 and failed compile for gcm.cpp](http://github.com/weidai11/cryptopp/issues/226), was a bit too specific in its remediation. As was [Issue 220: Sun Studio 12.5 and "assertion failed in function pr_post_process_node() @ preopt.c:3868"](http://github.com/weidai11/cryptopp/issues/220). It appears the compile problems with `gcm.cpp` run a bit deeper than cursory testing revealed.
```
$ ssh 172.16.2.2
Warning: Permanently added '172.16.2.2' (RSA) to the list of known hosts.
Last login: Thu Jul 14 13:40:58 2016 from 172.16.4.25
Oracle Corporation SunOS 5.11 11.3 September 2015
$ /usr/gnu/bin/egrep -B 6 'ERROR:' cryptest-result.txt
assert(nd_eq_(scope_first_stmt_(node), first_s))
/opt/developerstudio12.5/bin/CC -DDEBUG -g3 -O0 -Wno-deprecated-declarations -native -m64 -KPIC -template=no%extdef -w -erroff=wvarhidemem -erroff=voidretw -c arc4.cpp
CC: ube failed for gcm.cpp
gmake: *** [gcm.o] Error 2
gmake: *** Waiting for unfinished jobs....
ERROR: failed to make cryptest.exe
--
assertion failed in function pr_post_process_node() @ preopt.c:3868
assert(nd_eq_(scope_first_stmt_(node), first_s))
CC: ube failed for gcm.cpp
gmake: *** [gcm.o] Error 2
gmake: *** Waiting for unfinished jobs....
ERROR: failed to make cryptest.exe
--
assertion failed in function pr_post_process_node() @ preopt.c:3868
assert(nd_eq_(scope_first_stmt_(node), first_s))
CC: ube failed for gcm.cpp
gmake: *** [gcm.o] Error 2
gmake: *** Waiting for unfinished jobs....
ERROR: failed to make cryptest.exe
--
...
```
| SunCC 12.2-12.5 and failed compile for gcm.cpp | https://api.github.com/repos/weidai11/cryptopp/issues/227/comments | 2 | 2016-07-15T19:29:47Z | 2016-09-18T14:30:09Z | https://github.com/weidai11/cryptopp/issues/227 | 165,860,864 | 227 |
[
"weidai11",
"cryptopp"
] | Sun Studio 12.2-12.4 reports the following when compiling gcm.cpp with AES-NI enabled:
```
$ cat ~/gcm.txt
$ /opt/solarisstudio12.4/bin/CC -DNDEBUG -g2 -O2 -std=c++11 -D__SSE2__ -D__SSE3__ -D__SSSE3__
-D__SSE4_1__ -D__SSE4_2__ -D__AES__ -D__PCLMUL__ -D__RDRND__ -D__AVX__ -native -m64 -KPIC
-template=no%extdef -w -erroff=wvarhidemem -erroff=voidretw -c gcm.cpp
>> Assertion: (../lnk/g3mangler.cc, line 825)
while processing gcm.cpp at line 300.
```
The problem is witnessed when using both (1) AES-NI/CLMUL or (2) `-std=c++03` or `-std=c++11`. Using only one or the other is OK.
We have an open question on Stack Overflow at [What causes SunCC crash in g3mangler.cc?](http://stackoverflow.com/q/39442243/608639)
| SunCC 12.2-12.4 failed compile with C++{03|11} for gcm.cpp | https://api.github.com/repos/weidai11/cryptopp/issues/226/comments | 3 | 2016-07-15T08:53:22Z | 2018-07-16T00:24:00Z | https://github.com/weidai11/cryptopp/issues/226 | 165,740,101 | 226 |
[
"weidai11",
"cryptopp"
] | I'm trying to compile it on NVIDIA TX1 which is having arm64 A57 processor, and getting follow error:
``` shell
ubuntu@tegra-ubuntu:~/cryptopp-CRYPTOPP_5_6_3$ make
WARNING: CRYPTOPP_NO_UNALIGNED_DATA_ACCESS is not defined in config.h.
WARNING: CRYPTOPP_INIT_PRIORITY is not defined in config.h.
WARNING: CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 is defined in config.h.
WARNING: You should make these changes in config.h, and not CXXFLAGS.
WARNING: You can 'mv config.recommend config.h', but it breaks versioning.
WARNING: See http://cryptopp.com/wiki/config.h for more details.
g++ -DNDEBUG -g2 -O2 -pipe -fPIC -c cryptlib.cpp
g++ -DNDEBUG -g2 -O2 -pipe -fPIC -c 3way.cpp
g++ -DNDEBUG -g2 -O2 -pipe -fPIC -c adler32.cpp
g++ -DNDEBUG -g2 -O2 -pipe -fPIC -c algebra.cpp
g++ -DNDEBUG -g2 -O2 -pipe -fPIC -c algparam.cpp
g++ -DNDEBUG -g2 -O2 -pipe -fPIC -c arc4.cpp
g++ -DNDEBUG -g2 -O2 -pipe -fPIC -c asn.cpp
g++ -DNDEBUG -g2 -O2 -pipe -fPIC -c authenc.cpp
g++ -DNDEBUG -g2 -O2 -pipe -fPIC -c base32.cpp
g++ -DNDEBUG -g2 -O2 -pipe -fPIC -c base64.cpp
g++ -DNDEBUG -g2 -O2 -pipe -fPIC -c basecode.cpp
g++ -DNDEBUG -g2 -O2 -pipe -fPIC -c bfinit.cpp
g++ -DNDEBUG -g2 -O2 -pipe -fPIC -c blowfish.cpp
g++ -DNDEBUG -g2 -O2 -pipe -fPIC -c blumshub.cpp
g++ -DNDEBUG -g2 -O2 -pipe -fPIC -c camellia.cpp
g++ -DNDEBUG -g2 -O2 -pipe -fPIC -c cast.cpp
g++ -DNDEBUG -g2 -O2 -pipe -fPIC -c casts.cpp
g++ -DNDEBUG -g2 -O2 -pipe -fPIC -c cbcmac.cpp
g++ -DNDEBUG -g2 -O2 -pipe -fPIC -c ccm.cpp
g++ -DNDEBUG -g2 -O2 -pipe -fPIC -c channels.cpp
g++ -DNDEBUG -g2 -O2 -pipe -fPIC -c cmac.cpp
g++ -DNDEBUG -g2 -O2 -pipe -fPIC -c crc.cpp
g++ -DNDEBUG -g2 -O2 -pipe -fPIC -c default.cpp
default.cpp: In constructor ‘CryptoPP::DefaultEncryptorWithMAC::DefaultEncryptorWithMAC(const char*, CryptoPP::BufferedTransformation*)’:
default.cpp:220:39: warning: ‘DefaultEncryptor’ is deprecated (declared at default.h:29): DefaultEncryptor will be changing in the near future because the algorithms are no longer secure [-Wdeprecated-declarations]
SetFilter(new HashFilter(*m_mac, new DefaultEncryptor(passphrase), true));
^
default.cpp: In constructor ‘CryptoPP::DefaultEncryptorWithMAC::DefaultEncryptorWithMAC(const byte*, size_t, CryptoPP::BufferedTransformation*)’:
default.cpp:227:39: warning: ‘DefaultEncryptor’ is deprecated (declared at default.h:29): DefaultEncryptor will be changing in the near future because the algorithms are no longer secure [-Wdeprecated-declarations]
SetFilter(new HashFilter(*m_mac, new DefaultEncryptor(passphrase, passphraseLength), true));
^
default.cpp: In constructor ‘CryptoPP::DefaultDecryptorWithMAC::DefaultDecryptorWithMAC(const char*, CryptoPP::BufferedTransformation*, bool)’:
default.cpp:243:16: warning: ‘DefaultDecryptor’ is deprecated (declared at default.h:63): DefaultDecryptor will be changing in the near future because the algorithms are no longer secure [-Wdeprecated-declarations]
SetFilter(new DefaultDecryptor(passphrase, m_hashVerifier=new HashVerifier(*m_mac, NULL, HashVerifier::PUT_MESSAGE), throwException));
^
default.cpp: In constructor ‘CryptoPP::DefaultDecryptorWithMAC::DefaultDecryptorWithMAC(const byte*, size_t, CryptoPP::BufferedTransformation*, bool)’:
default.cpp:251:16: warning: ‘DefaultDecryptor’ is deprecated (declared at default.h:63): DefaultDecryptor will be changing in the near future because the algorithms are no longer secure [-Wdeprecated-declarations]
SetFilter(new DefaultDecryptor(passphrase, passphraseLength, m_hashVerifier=new HashVerifier(*m_mac, NULL, HashVerifier::PUT_MESSAGE), throwException));
^
default.cpp: In member function ‘CryptoPP::DefaultDecryptor::State CryptoPP::DefaultDecryptorWithMAC::CurrentState() const’:
default.cpp:256:44: warning: ‘DefaultDecryptor’ is deprecated (declared at default.h:63): DefaultDecryptor will be changing in the near future because the algorithms are no longer secure [-Wdeprecated-declarations]
return static_cast<const DefaultDecryptor *>(m_filter.get())->CurrentState();
^
g++ -DNDEBUG -g2 -O2 -pipe -fPIC -c des.cpp
g++ -DNDEBUG -g2 -O2 -pipe -fPIC -c dessp.cpp
g++ -DNDEBUG -g2 -O2 -pipe -fPIC -c dh2.cpp
g++ -DNDEBUG -g2 -O2 -pipe -fPIC -c dh.cpp
g++ -DNDEBUG -g2 -O2 -pipe -fPIC -c dll.cpp
{standard input}: Assembler messages:
{standard input}:167101: Warning: end of file not at end of a line; newline inserted
{standard input}:167480: Error: unknown mnemonic `m' -- `m'
{standard input}: Error: open CFI at the end of file; missing .cfi_endproc directive
g++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.8/README.Bugs> for instructions.
make: *** [dll.o] Error 4
```
Not sure what to troubleshoot looking at this part:
``` shell
{standard input}: Assembler messages:
{standard input}:167101: Warning: end of file not at end of a line; newline inserted
{standard input}:167480: Error: unknown mnemonic `m' -- `m'
{standard input}: Error: open CFI at the end of file; missing .cfi_endproc directive
g++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.8/README.Bugs> for instructions.
make: *** [dll.o] Error 4
```
| Compiling cryptopp 5.6.3 on arm64 | https://api.github.com/repos/weidai11/cryptopp/issues/225/comments | 11 | 2016-07-15T03:54:14Z | 2016-07-22T01:54:59Z | https://github.com/weidai11/cryptopp/issues/225 | 165,706,469 | 225 |
[
"weidai11",
"cryptopp"
] | Sun Studio 12.4 reports the following when compiling `rijndael.cpp` with AES-NI enabled (its the only file we have not been able to enable):
```
/opt/solarisstudio12.4/bin/CC -D__SSE2__ -D__SSE3__ -D__SSSE3__ -D__SSE4_1__ -D__SSE4_2__ -D__PCLMUL__ -D__AES__ -D__RDRND__ -D__AVX__ -native -m64 -KPIC -template=no%extdef -w -erroff=wvarhidemem -erroff=voidretw -c rijndael.cpp
"rijndael.cpp", line 1237: Error: Could not find a match for CryptoPP::AESNI_AdvancedProcessBlocks<F1, F4>(void(unsigned long long(&)[2],unsigned long long(*)[2],unsigned), void(unsigned long long(&)[2],unsigned long long(&)[2],unsigned long long(&)[2],unsigned long long(&)[2],unsigned long long(*)[2],unsigned), unsigned long long(*)[2], unsigned, const unsigned char*, const unsigned char*, unsigned char*, unsigned long, unsigned) needed in CryptoPP::Rijndael::Enc::AdvancedProcessBlocks(const unsigned char*, const unsigned char*, unsigned char*, unsigned long, unsigned) const.
"rijndael.cpp", line 1316: Error: Could not find a match for CryptoPP::AESNI_AdvancedProcessBlocks<F1, F4>(void(unsigned long long(&)[2],unsigned long long(*)[2],unsigned), void(unsigned long long(&)[2],unsigned long long(&)[2],unsigned long long(&)[2],unsigned long long(&)[2],unsigned long long(*)[2],unsigned), unsigned long long(*)[2], const unsigned, const unsigned char*, const unsigned char*, unsigned char*, unsigned long, unsigned) needed in CryptoPP::Rijndael::Dec::AdvancedProcessBlocks(const unsigned char*, const unsigned char*, unsigned char*, unsigned long, unsigned) const.
2 Error(s) detected.
gmake: *** [rijndael.o] Error 2
```
| SunCC and failed compile for rijndael.cpp | https://api.github.com/repos/weidai11/cryptopp/issues/224/comments | 2 | 2016-07-15T03:47:40Z | 2017-01-25T01:51:31Z | https://github.com/weidai11/cryptopp/issues/224 | 165,705,897 | 224 |
[
"weidai11",
"cryptopp"
] | Uri reported approximately 36 of these when using `-Ofast` on OS X.
```
Testing MAC algorithm Panama-BE.
....==22085== Conditional jump or move depends on uninitialised value(s)
==22085== at 0x1000BFEB0: TestSymmetricCipher(std::__1::map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > >&, CryptoPP::NameValuePairs const&) (cryptlib.h:353)
==22085== by 0x1000C5975: TestDataFile(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, CryptoPP::NameValuePairs const&, unsigned int&, unsigned int&) (datatest.cpp:796)
==22085== by 0x1000C625F: RunTestDataFile(char const*, CryptoPP::NameValuePairs const&, bool) (datatest.cpp:843)
==22085== by 0x10005A681: ValidateAll(bool) (validat1.cpp:107)
==22085== by 0x100049DA2: Validate(int, bool, char const*) (test.cpp:889)
==22085== by 0x10003FFB1: main (test.cpp:358)
==22085== Uninitialised value was created by a stack allocation
==22085== at 0x1000BF80D: TestSymmetricCipher(std::__1::map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > >&, CryptoPP::NameValuePairs const&) (datatest.cpp:353)
==22085==
```
| Valgrind findings on uninitialized data on OS X when using -Ofast | https://api.github.com/repos/weidai11/cryptopp/issues/223/comments | 1 | 2016-07-13T04:26:29Z | 2016-07-13T04:43:22Z | https://github.com/weidai11/cryptopp/issues/223 | 165,234,604 | 223 |
[
"weidai11",
"cryptopp"
] | Trying to check for crytopp headers, I have this on configure.ac: `AC_CHECK_HEADERS(cryptopp/cryptlib.h,, AC_MSG_ERROR([cryptopp/cryptlib.h header not found or not usable]) )`
Configure reports error:
```
checking for libcryptopp... checking cryptopp/cryptlib.h usability... no
checking cryptopp/cryptlib.h presence... yes
configure: WARNING: cryptopp/cryptlib.h: present but cannot be compiled
configure: WARNING: cryptopp/cryptlib.h: check for missing prerequisite headers?
configure: WARNING: cryptopp/cryptlib.h: see the Autoconf documentation
configure: WARNING: cryptopp/cryptlib.h: section "Present But Cannot Be Compiled"
configure: WARNING: cryptopp/cryptlib.h: proceeding with the compiler's result
configure: WARNING: ## -------------------------------------------- ##
configure: WARNING: ## Report this to ........................... ##
configure: WARNING: ## -------------------------------------------- ##
checking for cryptopp/cryptlib.h... no
configure: error: cryptopp/cryptlib.h header not found or not usable
```
Checking the log, it leads to config.h:
```
// OK to comment the following out, but please report it so we can fix it.
#if (defined(__cplusplus) && (__cplusplus >= 199711L)) && !defined(CRYPTOPP_UNCAUGHT_EXCEPTION_AVAILABLE)
# error "std::uncaught_exception is not available. This is likely a configuration error."
#endif
```
Here are some related environment variables:
ARCH=arm
CXX=.../bin/arm-linux-androideabi-g++
| android cross compile autoconf header check | https://api.github.com/repos/weidai11/cryptopp/issues/222/comments | 11 | 2016-07-11T14:48:46Z | 2016-07-20T10:18:19Z | https://github.com/weidai11/cryptopp/issues/222 | 164,855,795 | 222 |
[
"weidai11",
"cryptopp"
] | Here is a small issue compiling the libraries in GCC for OSX (10.10.5 sdk):
```
/usr/bin/clang++ -std=c++11 -arch x86_64 -stdlib=libc++ -DCRYPTOPP_DISABLE_ASM -c rsa.cpp
In file included from rsa.cpp:4:
In file included from ./rsa.h:12:
./pubkey.h:638:26: warning: defaulted move assignment operator of 'InvertibleRSAFunction' will move assign virtual base class 'CryptoMaterial' multiple times
[-Wmultiple-move-vbase]
class CRYPTOPP_NO_VTABLE TF_ObjectImpl : public TF_ObjectImplBase<BASE, SCHEME_OPTIONS, KEY_CLASS>
^
./rsa.h:62:44: note: 'CryptoMaterial' is a virtual base class of base class 'CryptoPP::RSAFunction' declared here
class CRYPTOPP_DLL InvertibleRSAFunction : public RSAFunction, public TrapdoorFunctionInverse, public PKCS8PrivateKey
^~~~~~~~~~~~~~~~~~
./rsa.h:62:96: note: 'CryptoMaterial' is a virtual base class of base class 'CryptoPP::PKCS8PrivateKey' declared here
class CRYPTOPP_DLL InvertibleRSAFunction : public RSAFunction, public TrapdoorFunctionInverse, public PKCS8PrivateKey
^
1 warning generated.
```
And the headers inserted in my project give the following warnings:
```
In file included from ../../../97 JucePlugins/../00 SDKs/Cryptopp/cryptopp563/rsa.h:12:
../../../97 JucePlugins/../00 SDKs/Cryptopp/cryptopp563/pubkey.h:238:26: warning: 'CryptoPP::TF_Base<CryptoPP::TrapdoorFunctionInverse, CryptoPP::PK_EncryptionMessageEncodingMethod>' has virtual functions but non-virtual destructor [-Wnon-virtual-dtor]
class CRYPTOPP_NO_VTABLE TF_Base
^
../../../97 JucePlugins/../00 SDKs/Cryptopp/cryptopp563/pubkey.h:281:108: note: in instantiation of template class 'CryptoPP::TF_Base<CryptoPP::TrapdoorFunctionInverse, CryptoPP::PK_EncryptionMessageEncodingMethod>' requested here
class CRYPTOPP_NO_VTABLE TF_CryptoSystemBase : public PK_FixedLengthCryptoSystemImpl<INTERFACE>, protected BASE
^
../../../97 JucePlugins/../00 SDKs/Cryptopp/cryptopp563/pubkey.h:300:65: note: in instantiation of template class 'CryptoPP::TF_CryptoSystemBase<CryptoPP::PK_Decryptor, CryptoPP::TF_Base<CryptoPP::TrapdoorFunctionInverse, CryptoPP::PK_EncryptionMessageEncodingMethod> >' requested here
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE TF_DecryptorBase : public TF_CryptoSystemBase<PK_Decryptor, TF_Base<TrapdoorFunctionInverse, PK_EncryptionMessageEncodingMethod> >
^
../../../97 JucePlugins/../00 SDKs/Cryptopp/cryptopp563/pubkey.h:238:26: warning: 'CryptoPP::TF_Base<CryptoPP::RandomizedTrapdoorFunction, CryptoPP::PK_EncryptionMessageEncodingMethod>' has virtual functions but non-virtual destructor [-Wnon-virtual-dtor]
class CRYPTOPP_NO_VTABLE TF_Base
^
../../../97 JucePlugins/../00 SDKs/Cryptopp/cryptopp563/pubkey.h:281:108: note: in instantiation of template class 'CryptoPP::TF_Base<CryptoPP::RandomizedTrapdoorFunction, CryptoPP::PK_EncryptionMessageEncodingMethod>' requested here
class CRYPTOPP_NO_VTABLE TF_CryptoSystemBase : public PK_FixedLengthCryptoSystemImpl<INTERFACE>, protected BASE
^
../../../97 JucePlugins/../00 SDKs/Cryptopp/cryptopp563/pubkey.h:312:65: note: in instantiation of template class 'CryptoPP::TF_CryptoSystemBase<CryptoPP::PK_Encryptor, CryptoPP::TF_Base<CryptoPP::RandomizedTrapdoorFunction, CryptoPP::PK_EncryptionMessageEncodingMethod> >' requested here
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE TF_EncryptorBase : public TF_CryptoSystemBase<PK_Encryptor, TF_Base<RandomizedTrapdoorFunction, PK_EncryptionMessageEncodingMethod> >
^
../../../97 JucePlugins/../00 SDKs/Cryptopp/cryptopp563/pubkey.h:238:26: warning: 'CryptoPP::TF_Base<CryptoPP::RandomizedTrapdoorFunctionInverse, CryptoPP::PK_SignatureMessageEncodingMethod>' has virtual functions but non-virtual destructor [-Wnon-virtual-dtor]
class CRYPTOPP_NO_VTABLE TF_Base
^
../../../97 JucePlugins/../00 SDKs/Cryptopp/cryptopp563/pubkey.h:489:79: note: in instantiation of template class 'CryptoPP::TF_Base<CryptoPP::RandomizedTrapdoorFunctionInverse, CryptoPP::PK_SignatureMessageEncodingMethod>' requested here
class CRYPTOPP_NO_VTABLE TF_SignatureSchemeBase : public INTERFACE, protected BASE
^
../../../97 JucePlugins/../00 SDKs/Cryptopp/cryptopp563/pubkey.h:519:62: note: in instantiation of template class 'CryptoPP::TF_SignatureSchemeBase<CryptoPP::PK_Signer, CryptoPP::TF_Base<CryptoPP::RandomizedTrapdoorFunctionInverse, CryptoPP::PK_SignatureMessageEncodingMethod> >' requested here
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE TF_SignerBase : public TF_SignatureSchemeBase<PK_Signer, TF_Base<RandomizedTrapdoorFunctionInverse, PK_SignatureMessageEncodingMethod> >
^
../../../97 JucePlugins/../00 SDKs/Cryptopp/cryptopp563/pubkey.h:238:26: warning: 'CryptoPP::TF_Base<CryptoPP::TrapdoorFunction, CryptoPP::PK_SignatureMessageEncodingMethod>' has virtual functions but non-virtual destructor [-Wnon-virtual-dtor]
class CRYPTOPP_NO_VTABLE TF_Base
^
../../../97 JucePlugins/../00 SDKs/Cryptopp/cryptopp563/pubkey.h:489:79: note: in instantiation of template class 'CryptoPP::TF_Base<CryptoPP::TrapdoorFunction, CryptoPP::PK_SignatureMessageEncodingMethod>' requested here
class CRYPTOPP_NO_VTABLE TF_SignatureSchemeBase : public INTERFACE, protected BASE
^
../../../97 JucePlugins/../00 SDKs/Cryptopp/cryptopp563/pubkey.h:531:64: note: in instantiation of template class 'CryptoPP::TF_SignatureSchemeBase<CryptoPP::PK_Verifier, CryptoPP::TF_Base<CryptoPP::TrapdoorFunction, CryptoPP::PK_SignatureMessageEncodingMethod> >' requested here
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE TF_VerifierBase : public TF_SignatureSchemeBase<PK_Verifier, TF_Base<TrapdoorFunction, PK_SignatureMessageEncodingMethod> >
^
../../../97 JucePlugins/../00 SDKs/Cryptopp/cryptopp563/pubkey.h:1348:26: warning: 'CryptoPP::DL_SymmetricEncryptionAlgorithm' has virtual functions but non-virtual destructor [-Wnon-virtual-dtor]
class CRYPTOPP_NO_VTABLE DL_SymmetricEncryptionAlgorithm
^
5 warnings generated.
```
Pay attention that the last warning is related to **CryptoPP::DL_SymmetricEncryptionAlgorithm**
Thank you!
Gabriel Solsona
| Warnings in OSX GCC | https://api.github.com/repos/weidai11/cryptopp/issues/221/comments | 3 | 2016-07-10T12:12:10Z | 2016-07-12T19:50:05Z | https://github.com/weidai11/cryptopp/issues/221 | 164,712,920 | 221 |
[
"weidai11",
"cryptopp"
] | ```
$ CXX=/opt/developerstudio12.5/bin/CC CXXFLAGS="-DDEBUG -g3 -xO0" gmake
/opt/developerstudio12.5/bin/CC -DDEBUG -g3 -xO0 -native -m64 -KPIC -template=no%extdef -c gcm.cpp
assertion failed in function pr_post_process_node() @ preopt.c:3868
assert(nd_eq_(scope_first_stmt_(node), first_s))
CC: ube failed for gcm.cpp
gmake: *** [gcm.o] Error 2
```
| Sun Studio 12.5 and "assertion failed in function pr_post_process_node() @ preopt.c:3868" | https://api.github.com/repos/weidai11/cryptopp/issues/220/comments | 1 | 2016-07-09T09:57:40Z | 2016-07-15T20:07:02Z | https://github.com/weidai11/cryptopp/issues/220 | 164,660,264 | 220 |
[
"weidai11",
"cryptopp"
] | `cryptest.sh` reveals a build failure on Ubuntu 12.04 i686 with Binutils 2.22 when using the `ld.gold` linker _without_ PIC:
```
************************************
Testing: release, ld-gold linker
g++ -DNDEBUG -g2 -O2 -march=native -pipe -c cryptlib.cpp
g++ -DNDEBUG -g2 -O2 -march=native -pipe -c cpu.cpp
...
g++ -o cryptest.exe -DNDEBUG -g2 -O2 -march=native -pipe bench1.o bench2.o test.o validat1.o validat2.o
validat3.o adhoc.o datatest.o regtest.o fipsalgt.o dlltest.o ./libcryptopp.a -pthread -Wl,-fuse-ld=gold
/usr/bin/ld: -f may not be used without -shared
collect2: ld returned 1 exit status
```
| ld.gold and i686 without PIC: "/usr/bin/ld: -f may not be used without -shared" | https://api.github.com/repos/weidai11/cryptopp/issues/219/comments | 2 | 2016-07-06T16:26:39Z | 2016-07-06T23:21:08Z | https://github.com/weidai11/cryptopp/issues/219 | 164,118,271 | 219 |
[
"weidai11",
"cryptopp"
] | UB and JW have been working on MacPorts improvements. MacPorts provides versions of GCC which are capable of using the Clang Integrated Assembler rather than the down level GNU AS. The compiler driver is told to use Clang IA with `-Wa,-q` compiler option. The down level GNU AS cannot assemble some SSE4+ instructions generated by the compiler, like AVX's `VZEROUPPER`.
Once the enhancements are tested we would like to merge them into Master.
Also see [Status of Crypto++ on OS X](http://groups.google.com/forum/#!topic/cryptopp-users/BI8yGpr2XNo) and [MacPorts and Clang Integrated Assembler testing](https://groups.google.com/forum/#!topic/cryptopp-users/nUxqAnPjNzc) on the User Group.
| Merge 'clang-ia' (clang integrated assembler) into Master | https://api.github.com/repos/weidai11/cryptopp/issues/218/comments | 2 | 2016-07-04T20:57:27Z | 2016-07-05T16:31:35Z | https://github.com/weidai11/cryptopp/issues/218 | 163,741,899 | 218 |
[
"weidai11",
"cryptopp"
] | Using [Visual C++ 2015 stand alone toolchain](http://blogs.msdn.microsoft.com/vcblog/2015/11/02/announcing-visual-c-build-tools-2015-standalone-c-tools-for-build-environments/) and [cryptest.nmake](http://github.com/weidai11/cryptopp/blob/master/cryptest.nmake):
```
cl.exe /nologo /W4 /D_MBCS /Zi /TP /EHsc /MD /FI sdkddkver.h /FI winapif
amily.h /c wait.cpp
wait.cpp
c:\users\jeff\desktop\cryptopp\wait.h(152): warning C4589: Constructor of abstra
ct class 'CryptoPP::WaitObjectsTracer' ignores initializer for virtual base clas
s 'CryptoPP::Tracer'
c:\users\jeff\desktop\cryptopp\wait.h(152): note: virtual base classes are only
initialized by the most-derived type
...
cl.exe /nologo /W4 /D_MBCS /Zi /TP /EHsc /MD /FI sdkddkver.h /FI winapif
amily.h /c network.cpp
network.cpp
c:\users\jeff\desktop\cryptopp\wait.h(152): warning C4589: Constructor of abstra
ct class 'CryptoPP::WaitObjectsTracer' ignores initializer for virtual base clas
s 'CryptoPP::Tracer'
c:\users\jeff\desktop\cryptopp\wait.h(152): note: virtual base classes are only
initialized by the most-derived type
...
cl.exe /nologo /W4 /D_MBCS /Zi /TP /EHsc /MD /FI sdkddkver.h /FI winapif
amily.h /c socketft.cpp
socketft.cpp
c:\users\jeff\desktop\cryptopp\wait.h(152): warning C4589: Constructor of abstra
ct class 'CryptoPP::WaitObjectsTracer' ignores initializer for virtual base clas
s 'CryptoPP::Tracer'
c:\users\jeff\desktop\cryptopp\wait.h(152): note: virtual base classes are only
initialized by the most-derived type
...
cl.exe /nologo /W4 /D_MBCS /Zi /TP /EHsc /MD /FI sdkddkver.h /FI winapif
amily.h /c winpipes.cpp
winpipes.cpp
c:\users\jeff\desktop\cryptopp\wait.h(152): warning C4589: Constructor of abstra
ct class 'CryptoPP::WaitObjectsTracer' ignores initializer for virtual base clas
s 'CryptoPP::Tracer'
c:\users\jeff\desktop\cryptopp\wait.h(152): note: virtual base classes are only
initialized by the most-derived type
...
cl.exe /nologo /W4 /D_MBCS /Zi /TP /EHsc /MD /FI sdkddkver.h /FI winapif
amily.h /c test.cpp
test.cpp
c:\users\jeff\desktop\cryptopp\wait.h(152): warning C4589: Constructor of abstra
ct class 'CryptoPP::WaitObjectsTracer' ignores initializer for virtual base clas
s 'CryptoPP::Tracer'
c:\users\jeff\desktop\cryptopp\wait.h(152): note: virtual base classes are only
initialized by the most-derived type
```
| VS2015 and multiple C4589 warnings, "Constructor of abstract class X ignores initializer for virtual base class Y" | https://api.github.com/repos/weidai11/cryptopp/issues/214/comments | 5 | 2016-07-04T12:45:56Z | 2018-01-21T16:55:45Z | https://github.com/weidai11/cryptopp/issues/214 | 163,669,703 | 214 |
[
"weidai11",
"cryptopp"
] | According to Microsoft ([here](http://answers.microsoft.com/en-us/windows/forum/windows_10-win_upgrade/which-edition-of-windows-10-will-support-arm64/d2c3396e-3a69-40a3-a3a7-4ec7db9e5c51?auth=1) and [here](http://blogs.windows.com/windowsexperience/2015/03/18/windows-10-iot-powering-the-internet-of-things/)), the company will support ARMv8/Aarch64 (ARM-64) in upcoming version of Windows 10. Additionally, Microsoft has [already supplied previews](http://www.zdnet.com/article/microsoft-rolls-out-windows-10-redstone-build-14267-to-fast-ring-testers/) so I'm guessing tool support is in place.
`config.h` has the following placeholder for Microsoft's Aarch64/ARM64 support. However, we [don't know what the defines are to detect it](http://stackoverflow.com/q/37244202/608639):
```
// Requires ARMv8 and ACLE 2.0.
// Microsoft plans to support ARM-64, but its not clear how to detect it.
// TODO: Add MSC_VER and ARM-64 platform define when available
#if !defined(CRYPTOPP_BOOL_ARM_CRC32_INTRINSICS_AVAILABLE) && !defined(CRYPTOPP_DISABLE_ASM)
# if defined(__ARM_FEATURE_CRC32) || defined(_M_ARM64)
# define CRYPTOPP_BOOL_ARM_CRC32_INTRINSICS_AVAILABLE 1
# endif
#endif
// Requires ARMv8 and ACLE 2.0.
// Microsoft plans to support ARM-64, but its not clear how to detect it.
// TODO: Add MSC_VER and ARM-64 platform define when available
#if !defined(CRYPTOPP_BOOL_ARM_CRYPTO_INTRINSICS_AVAILABLE) && !defined(CRYPTOPP_DISABLE_ASM)
# if defined(__ARM_FEATURE_CRYPTO) || defined(_M_ARM64)
# define CRYPTOPP_BOOL_ARM_CRYPTO_INTRINSICS_AVAILABLE 1
# endif
#endif
```
| Need to detect ARM64 for Windows | https://api.github.com/repos/weidai11/cryptopp/issues/213/comments | 3 | 2016-07-03T05:30:53Z | 2018-01-12T22:24:17Z | https://github.com/weidai11/cryptopp/issues/213 | 163,548,196 | 213 |
[
"weidai11",
"cryptopp"
] | Building with `export CXXFLAGS="-DDEBUG -g3 -O0 -std=c++03 -mfpu=neon -fPIC
-fsanitize=address -fno-omit-frame-pointer -D_GLIBCXX_DEBUG"` and under an Asan test, we get the following result.
Its hard to tell if this is a valid finding (one-off bug on our part), or an issue with Asan (a false positive). Based on the recursion, it looks like there's something wonky going on, and I suspect its due to an interaction with Asan. The compile is GCC 4.8.2.
Valgrind **_does not**_ cross-validate the result on this machine. Other ARM32 machines do not produce the finding, but they are using a different GCC version. For example, a 32-bit BeagleBone Black with GCC 4.9.2 in the same config does not witness it.
The trace below could be inaccurate with respect to addresses. Also see [Issue 22741: ASAN on ARM fails on fast unwind](http://llvm.org/bugs/show_bug.cgi?id=22741).
---
`filters.cpp:27` is below. I believe the offending expression is `m_attachment(attachment)`.
```
Filter::Filter(BufferedTransformation *attachment)
: m_attachment(attachment), m_inputPosition(0), m_continueAt(0)
{
}
```
`TestOS_RNG` from `validat1.cpp` is a little trickier. I believe its somewhere in here:
```
bool TestOS_RNG()
{
bool pass = true;
member_ptr<RandomNumberGenerator> rng;
#ifdef BLOCKING_RNG_AVAILABLE
try {rng.reset(new BlockingRng);}
catch (OS_RNG_Err &) {}
#endif
if (rng.get())
{
...
}
}
```
---
```
cubietruck:cryptopp$ ./cryptest.exe v 2>&1 | sed 's|/home/jwalton/cryptopp/||g' | asan_symbolize | c++filt
Using seed: 1467414503
Testing Settings...
passed: Your machine is little endian.
passed: Your machine allows unaligned data access.
passed: sizeof(byte) == 1
passed: sizeof(word16) == 2
passed: sizeof(word32) == 4
passed: sizeof(word64) == 8
passed: sizeof(hword) == 2, sizeof(word) == 4, sizeof(dword) == 8
passed: hasNEON == 1, hasCRC32 == 0, hasAES == 0, hasSHA1 == 0, hasSHA2 == 0
=================================================================
==3830== ERROR: AddressSanitizer: stack-buffer-overflow on address 0xbec5fac8 at pc 0x38b99d bp 0xbec5f990 sp 0xbec5f994
WRITE of size 4 at 0xbec5fac8 thread T0
#0 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#1 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#2 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#3 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#4 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#5 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#6 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#7 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#8 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#9 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#10 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#11 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#12 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#13 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#14 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#15 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#16 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#17 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#18 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#19 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#20 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#21 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#22 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#23 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#24 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#25 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#26 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#27 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#28 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#29 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#30 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#31 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#32 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#33 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#34 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#35 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#36 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#37 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#38 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#39 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#40 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#41 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#42 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#43 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#44 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#45 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#46 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#47 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#48 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#49 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#50 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#51 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#52 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#53 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#54 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#55 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#56 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#57 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#58 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#59 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#60 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#61 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#62 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#63 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#64 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#65 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#66 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#67 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#68 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#69 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#70 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#71 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#72 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#73 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#74 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#75 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#76 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#77 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#78 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#79 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#80 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#81 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#82 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#83 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#84 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#85 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#86 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#87 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#88 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#89 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#90 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#91 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#92 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#93 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#94 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#95 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#96 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#97 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#98 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#99 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#100 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#101 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#102 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#103 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#104 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#105 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#106 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#107 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#108 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#109 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#110 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#111 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#112 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#113 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#114 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#115 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#116 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#117 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#118 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#119 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#120 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#121 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#122 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#123 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#124 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#125 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#126 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#127 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#128 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#129 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#130 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#131 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#132 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#133 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#134 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#135 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#136 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#137 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#138 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#139 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#140 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#141 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#142 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#143 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#144 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#145 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#146 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#147 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#148 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#149 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#150 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#151 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#152 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#153 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#154 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#155 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#156 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#157 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#158 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#159 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#160 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#161 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#162 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#163 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#164 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#165 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#166 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#167 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#168 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#169 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#170 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#171 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#172 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#173 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#174 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#175 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#176 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#177 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#178 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#179 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#180 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#181 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#182 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#183 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#184 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#185 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#186 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#187 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#188 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#189 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#190 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#191 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#192 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#193 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#194 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#195 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#196 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#197 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#198 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#199 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#200 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#201 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#202 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#203 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#204 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#205 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#206 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#207 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#208 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#209 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#210 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#211 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#212 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#213 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#214 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#215 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#216 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#217 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#218 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#219 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#220 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#221 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#222 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#223 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#224 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#225 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#226 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#227 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#228 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#229 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#230 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#231 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#232 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#233 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#234 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#235 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#236 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#237 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#238 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#239 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#240 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#241 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#242 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#243 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#244 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#245 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#246 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#247 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#248 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#249 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#250 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#251 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
#252 0x38b99b in CryptoPP::Filter::Filter(CryptoPP::BufferedTransformation*) /home/jwalton/cryptopp/filters.cpp:27
Address 0xbec5fac8 is located at offset 112 in frame <TestOS_RNG> of T0's stack:
This frame has 3 object(s):
[32, 36) 'rng'
[96, 160) 'test'
[192, 312) 'meter'
HINT: this may be a false positive if your program uses some custom stack unwind mechanism or swapcontext
(longjmp and C++ exceptions *are* supported)
Shadow bytes around the buggy address:
0x37d8bf00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x37d8bf10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x37d8bf20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x37d8bf30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x37d8bf40: 00 00 00 00 00 00 00 00 00 00 00 f1 f1 f1 f1 04
=>0x37d8bf50: f4 f4 f4 f2 f2 f2 f2 00 00[f3]f3 f3 f3 00 00 f2
0x37d8bf60: f2 f2 f2 00 00 00 00 00 00 00 00 00 00 00 00 00
0x37d8bf70: 00 00 f4 00 00 00 00 00 00 00 00 00 00 00 00 00
0x37d8bf80: 00 00 f1 f1 f1 f1 04 f4 f4 f4 f2 f2 f2 f2 04 f4
0x37d8bf90: f4 f4 f3 f3 f3 f3 00 00 00 00 00 00 00 00 00 00
0x37d8bfa0: 00 00 00 00 00 00 00 00 00 00 f1 f1 f1 f1 04 f4
Shadow byte legend (one shadow byte represents 8 application bytes):
Addressable: 00
Partially addressable: 01 02 03 04 05 06 07
Heap left redzone: fa
Heap righ redzone: fb
Freed Heap region: fd
Stack left redzone: f1
Stack mid redzone: f2
Stack right redzone: f3
Stack partial redzone: f4
Stack after return: f5
Stack use after scope: f8
Global redzone: f9
Global init order: f6
Poisoned by user: f7
ASan internal: fe
==3830== ABORTING
cubietruck:cryptopp$
```
| ARM32, GCC 4.8 and Asan problems... | https://api.github.com/repos/weidai11/cryptopp/issues/212/comments | 1 | 2016-07-01T23:15:53Z | 2016-07-05T15:27:49Z | https://github.com/weidai11/cryptopp/issues/212 | 163,488,547 | 212 |
[
"weidai11",
"cryptopp"
] | Coverity produced a finding in `blake2.cpp` for lines 299-300:
```
CID 163670 (#1 of 1): Wrong size argument (SIZEOF_MISMATCH)suspicious_sizeof: Passing argument `this->m_block.data()` of type
`CryptoPP::AllocatorWithCleanup<CryptoPP::BLAKE2_ParameterBlock<true>, true>::pointer` and argument `32UL` to function `memset`
is suspicious because a multiple of `sizeof (CryptoPP::BLAKE2_Base<unsigned long long, true>::ParameterBlock) /*64*/` is expected.
299 ParameterBlock& block = *m_block.data();
300 memset(m_block.data(), 0x00, T_64bit ? 32 : 16);
...
```
This is a peephole optimization to avoid setting the `Salt` and `Personalization` buffers. A little further down, the user's parameters are copied in, and the buffer is back filled with 0's if its short:
```
306 ConstByteArrayParameter t;
307 if (params.GetValue(Name::Salt(), t))
308 {
309 if (t.begin() && t.size())
310 memcpy_s(block.salt, COUNTOF(block.salt), t.begin(), t.size());
311
312 const size_t rem = COUNTOF(block.salt) - t.size();
313 const size_t off = COUNTOF(block.salt) - rem;
314 if (rem)
315 memset(&block.salt[off], 0x00, rem);
316 }
317 else
318 {
319 memset(block.salt, 0x00, COUNTOF(block.salt));
320 }
```
| Coverity finding "The wrong size value is used as an argument to a function" | https://api.github.com/repos/weidai11/cryptopp/issues/210/comments | 1 | 2016-07-01T17:34:53Z | 2016-07-01T18:15:01Z | https://github.com/weidai11/cryptopp/issues/210 | 163,441,426 | 210 |
[
"weidai11",
"cryptopp"
] | We're catching a failure `Blake2s` under Visual Studio 2008 in a Win32/Release for the Validation Suite (`cryptest.exe v`). Win64 is OK, Win32/Debug is OK, and Test Vectors (`cryptest.exe tv blake2`) are OK.
```
BLAKE2s validation suite running...
passed algorithm name
FAILED BLAKE2s test set 0
FAILED BLAKE2s test set 1
FAILED BLAKE2s test set 2
FAILED BLAKE2s test set 3
FAILED BLAKE2s test set 4
FAILED BLAKE2s test set 5
FAILED BLAKE2s test set 6
FAILED BLAKE2s test set 7
FAILED BLAKE2s test set 8
FAILED BLAKE2s test set 9
FAILED BLAKE2s test set 10
```
It looks like bad code generation, but the reason is unclear.
| Blake2s fails under VS2008/Win32/Release for Validation Suite | https://api.github.com/repos/weidai11/cryptopp/issues/209/comments | 1 | 2016-06-30T20:27:44Z | 2016-07-01T18:31:37Z | https://github.com/weidai11/cryptopp/issues/209 | 163,259,578 | 209 |
[
"weidai11",
"cryptopp"
] | Denis Bider offered some arguments to remove some code from the library at [issue 23: Recent Windows 8 and Windows 10 support broke Windows 7/VS 2012](https://github.com/weidai11/cryptopp/issues/178#issuecomment-227908380). If I am parsing the comment correctly, DB suggests removing `Socket`, `Pipe` and `Thread` from the library. Its not clear if it includes the related `Sources` and `Sinks`.
I'd like to use this bug report to capture feedback, discover if anyone is using the classes, and track which files and classes are potential targets.
I know some of the classes are being used in the test program.
---
The Crypto++ wiki has a [Patch Page](http://www.cryptopp.com/wiki/Category:Patch). Its for components that may be useful to others, but don't quite fit into the library proper. If anything gets removed, then they surely would be placed there.
| Investigate moving OS specific Socket and Thread to the Patch Page | https://api.github.com/repos/weidai11/cryptopp/issues/208/comments | 5 | 2016-06-29T22:23:56Z | 2018-08-18T04:20:01Z | https://github.com/weidai11/cryptopp/issues/208 | 163,040,873 | 208 |
[
"weidai11",
"cryptopp"
] | Hi.
I'm using 5.6.3 currently. And can not find SONAME any more. (In 5.6.2, it exists). I used this command to check soname:
`objdump libcryptopp.so -x | grep soname
`
And used the following commands to build:
```
make -j 25
make -j 25 test
make install
make libcryptopp.a libcryptopp.so cryptest.exe
```
| SONAME not found in libcryptopp.so | https://api.github.com/repos/weidai11/cryptopp/issues/207/comments | 6 | 2016-06-29T12:19:14Z | 2016-09-11T02:28:28Z | https://github.com/weidai11/cryptopp/issues/207 | 162,911,008 | 207 |
[
"weidai11",
"cryptopp"
] | We have a couple of issues under GCC 4.8 and 4.9 when using `-std=c++11` and `-std=c++14`. The issue is the instructions `pclmulqdq128` and `aeskeygenassist128` used in inline assembly cannot compile:
```
$ make CXXFLAGS="-DDEBUG -g3 -O0 -std=c++11 -fPIC -march=native -pipe" vmac.o
g++ -DDEBUG -g3 -O0 -std=c++11 -fPIC -march=native -pipe -c vmac.cpp
In file included from /usr/lib/gcc/x86_64-linux-gnu/4.9/include/x86intrin.h:43:0,
from /usr/include/x86_64-linux-gnu/c++/4.9/bits/opt_random.h:33,
from /usr/include/c++/4.9/random:50,
from /usr/include/c++/4.9/bits/stl_algo.h:66,
from /usr/include/c++/4.9/algorithm:62,
from stdcpp.h:13,
from cryptlib.h:87,
from vmac.h:9,
from vmac.cpp:7:
cpu.h:96:1: error: expected ‘)’ before ‘__builtin_ia32_pclmulqdq128’
_mm_clmulepi64_si128 (__m128i a, __m128i b, const int i)
^
cpu.h:102:1: error: expected ‘)’ before ‘__builtin_ia32_aeskeygenassist128’
_mm_aeskeygenassist_si128 (__m128i a, const int i)
^
GNUmakefile:735: recipe for target 'vmac.o' failed
make: *** [vmac.o] Error 1
```
The unexpected ‘)’ is due to an intermediate cast to `__v2di`, which appears to be missing under Debug builds (`-O0`) when using C++11 (C++03 is OK):
```
$ grep -IR '__builtin_ia32_pclmulqdq128' /usr/lib
/usr/lib/gcc/x86_64-linux-gnu/4.9/include/wmmintrin.h: return (__m128i) __builtin_ia32_pclmulqdq128 ((__v2di)__X,
/usr/lib/gcc/x86_64-linux-gnu/4.9/include/wmmintrin.h: ((__m128i) __builtin_ia32_pclmulqdq128 ((__v2di)(__m128i)(X),
```
There's an open question on Stack Overflow at [Where is __v2di declared when using -std=c++11 under GCC?](http://stackoverflow.com/q/38051959)
| GCC 4.8/4.9, -std=c++11 and "error: expected ‘)’ before __builtin_ia32_pclmulqdq128" | https://api.github.com/repos/weidai11/cryptopp/issues/206/comments | 3 | 2016-06-27T10:57:48Z | 2016-09-19T01:22:53Z | https://github.com/weidai11/cryptopp/issues/206 | 162,425,429 | 206 |
[
"weidai11",
"cryptopp"
] | Uri Blumenthal reports the following after testing under Xcode when BMI is in effect:
```
clang++ -march=native -mbmi -c cryptlib.cpp
In file included from cryptlib.cpp:19:
./misc.h:644:23: error: use of undeclared identifier '_tzcnt_u32'; did you mean '__tzcnt_u32'?
return (unsigned int)_tzcnt_u32(v);
^~~~~~~~~~
__tzcnt_u32
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/bmiintrin.h:72:1: note: '__tzcnt_u32' declared here
__tzcnt_u32(unsigned int __X)
^
In file included from cryptlib.cpp:19:
./misc.h:675:23: error: use of undeclared identifier '_tzcnt_u64'; did you mean '__tzcnt_u64'?
return (unsigned int)_tzcnt_u64(v);
^~~~~~~~~~
__tzcnt_u64
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/bmiintrin.h:109:1a: note: '__tzcnt_u64' declared here
__tzcnt_u64(unsigned long long __X)
^
In file included from cryptlib.cpp:19:
./misc.h:784:22: error: use of undeclared identifier '_blsr_u32'; did you mean '__blsr_u32'?
return value > 0 && _blsr_u32(value) == 0;
^~~~~~~~~
__blsr_u32
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/bmiintrin.h:66:1: note: '__blsr_u32' declared here
__blsr_u32(unsigned int __X)
^
In file included from cryptlib.cpp:19:
./misc.h:790:22: error: use of undeclared identifier '_blsr_u64'; did you mean '__blsr_u64'?
return value > 0 && _blsr_u64(value) == 0;
^~~~~~~~~
__blsr_u64
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/bmiintrin.h:103:1: note: '__blsr_u64' declared here
__blsr_u64(unsigned long long __X)
^
4 errors generated.
GNUmakefile:735: recipe for target 'cryptlib.o' failed
make: *** [cryptlib.o] Error 1
```
| Use of undeclared identifiers '_tzcnt_u32' and '_blsr_u32' | https://api.github.com/repos/weidai11/cryptopp/issues/205/comments | 1 | 2016-06-26T10:11:27Z | 2016-06-26T13:54:25Z | https://github.com/weidai11/cryptopp/issues/205 | 162,321,310 | 205 |
[
"weidai11",
"cryptopp"
] | ```
AES::Encryption aesEncryption((byte *)key, AES::MAX_KEYLENGTH);
CFB_Mode_ExternalCipher::Encryption cfbEncryption(aesEncryption, iv);
StreamTransformationFilter cfbEncryptor(cfbEncryption, new HexEncoder(new StringSink(outstr)));
cfbEncryptor.Put((byte *)plainText, strlen(plainText));
cfbEncryptor.MessageEnd();
```
| I write this code, I need to release the resources of the 'new' ? | https://api.github.com/repos/weidai11/cryptopp/issues/204/comments | 1 | 2016-06-25T07:04:20Z | 2016-06-25T07:10:08Z | https://github.com/weidai11/cryptopp/issues/204 | 162,267,960 | 204 |
[
"weidai11",
"cryptopp"
] | An audit after plestrin uncovered [Issue 146: Timing Attack Counter Measure AES](http://github.com/weidai11/cryptopp/issues/146) revealed Camellia may have the same issue. This PR documents the potential issue and provides authorization for the repair.
| Timing Attack Counter Measure Camellia | https://api.github.com/repos/weidai11/cryptopp/issues/203/comments | 1 | 2016-06-22T20:42:35Z | 2016-06-22T20:44:17Z | https://github.com/weidai11/cryptopp/issues/203 | 161,780,964 | 203 |
[
"weidai11",
"cryptopp"
] | The following is from `cryptest.sh`. It appears Debian's X32 `chroot` environment does not mount `/proc`, and it causes ASAN failures:
```
# grep -B 1 'ERROR: ' cryptest-x32.txt
==28650==Sanitizer CHECK failed: ../../../../src/libsanitizer/sanitizer_common/sanitizer_procmaps_common.cc:68 ((proc_self_maps_.len)) > ((0)) (0, 0)
ERROR: failed to execute validation suite
==28654==Sanitizer CHECK failed: ../../../../src/libsanitizer/sanitizer_common/sanitizer_procmaps_common.cc:68 ((proc_self_maps_.len)) > ((0)) (0, 0)
ERROR: failed to execute test vectors
--
==29307==Sanitizer CHECK failed: ../../../../src/libsanitizer/sanitizer_common/sanitizer_procmaps_common.cc:68 ((proc_self_maps_.len)) > ((0)) (0, 0)
ERROR: failed to execute validation suite
==29311==Sanitizer CHECK failed: ../../../../src/libsanitizer/sanitizer_common/sanitizer_procmaps_common.cc:68 ((proc_self_maps_.len)) > ((0)) (0, 0)
ERROR: failed to execute test vectors
--
==31298==Sanitizer CHECK failed: ../../../../src/libsanitizer/sanitizer_common/sanitizer_procmaps_common.cc:68 ((proc_self_maps_.len)) > ((0)) (0, 0)
ERROR: failed to execute validation suite
==31302==Sanitizer CHECK failed: ../../../../src/libsanitizer/sanitizer_common/sanitizer_procmaps_common.cc:68 ((proc_self_maps_.len)) > ((0)) (0, 0)
ERROR: failed to execute test vectors
--
==31955==Sanitizer CHECK failed: ../../../../src/libsanitizer/sanitizer_common/sanitizer_procmaps_common.cc:68 ((proc_self_maps_.len)) > ((0)) (0, 0)
ERROR: failed to execute validation suite
==31959==Sanitizer CHECK failed: ../../../../src/libsanitizer/sanitizer_common/sanitizer_procmaps_common.cc:68 ((proc_self_maps_.len)) > ((0)) (0, 0)
ERROR: failed to execute test vectors
--
==841==Sanitizer CHECK failed: ../../../../src/libsanitizer/sanitizer_common/sanitizer_procmaps_common.cc:68 ((proc_self_maps_.len)) > ((0)) (0, 0)
ERROR: failed to execute validation suite
==845==Sanitizer CHECK failed: ../../../../src/libsanitizer/sanitizer_common/sanitizer_procmaps_common.cc:68 ((proc_self_maps_.len)) > ((0)) (0, 0)
ERROR: failed to execute test vectors
--
==2336==Sanitizer CHECK failed: ../../../../src/libsanitizer/sanitizer_common/sanitizer_procmaps_common.cc:68 ((proc_self_maps_.len)) > ((0)) (0, 0)
ERROR: failed to execute validation suite
==2340==Sanitizer CHECK failed: ../../../../src/libsanitizer/sanitizer_common/sanitizer_procmaps_common.cc:68 ((proc_self_maps_.len)) > ((0)) (0, 0)
ERROR: failed to execute test vectors
```
| ASAN checks fail under X32 | https://api.github.com/repos/weidai11/cryptopp/issues/202/comments | 1 | 2016-06-22T12:06:10Z | 2016-06-22T13:14:17Z | https://github.com/weidai11/cryptopp/issues/202 | 161,664,432 | 202 |
[
"weidai11",
"cryptopp"
] | From Ubuntu LTS:
```
$ lsb_release -a
Distributor ID: Ubuntu
Description: Ubuntu 12.04.5 LTS
Release: 12.04
Codename: precise
```
Here's the Cmake output:
```
$ cmake .
-- The C compiler identification is GNU
-- The CXX compiler identification is Intel
...
-- Check if the system is big endian - little endian
CMake Error at CMakeLists.txt:139 (include_directories):
include_directories given empty-string as include directory.
CMake Error at CMakeLists.txt:148 (include_directories):
include_directories given empty-string as include directory.
-- Looking for include files CMAKE_HAVE_PTHREAD_H
-- Looking for include files CMAKE_HAVE_PTHREAD_H - found
```
| Cmake and "include_directories given empty-string as include directory" | https://api.github.com/repos/weidai11/cryptopp/issues/199/comments | 4 | 2016-06-20T20:23:31Z | 2016-06-21T11:39:24Z | https://github.com/weidai11/cryptopp/issues/199 | 161,285,278 | 199 |
[
"weidai11",
"cryptopp"
] | From Ubuntu LTS:
```
$ lsb_release -a
Distributor ID: Ubuntu
Description: Ubuntu 12.04.5 LTS
Release: 12.04
Codename: precise
```
Here's the Cmake output:
```
$ cmake .
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check if the system is big endian
-- Searching 16 bit integer
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of unsigned short
-- Check size of unsigned short - done
-- Using unsigned short
-- Check if the system is big endian - little endian
CMake Error at CMakeLists.txt:139 (include_directories):
include_directories given empty-string as include directory.
CMake Error at CMakeLists.txt:148 (include_directories):
include_directories given empty-string as include directory.
-- Looking for include files CMAKE_HAVE_PTHREAD_H
-- Looking for include files CMAKE_HAVE_PTHREAD_H - found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
CMake Error at CMakeLists.txt:245 (include):
include could not find load file:
CMakePackageConfigHelpers
CMake Error at CMakeLists.txt:246 (write_basic_package_version_file):
Unknown CMake command "write_basic_package_version_file".
-- Configuring incomplete, errors occurred!
```
And:
```
$ cmake --version
cmake version 2.8.7
```
| Cmake and Unknown CMake command "write_basic_package_version_file" | https://api.github.com/repos/weidai11/cryptopp/issues/198/comments | 1 | 2016-06-20T19:30:29Z | 2016-06-21T11:39:24Z | https://github.com/weidai11/cryptopp/issues/198 | 161,274,946 | 198 |
[
"weidai11",
"cryptopp"
] | Running `cryptest.sh` on a MacPorts Clang compiler results in:
```
************************************
Testing: debug, c++03, Asan
ERROR: failed to make cryptest.exe
************************************
Testing: release, c++03, Asan
ERROR: failed to make cryptest.exe
************************************
Testing: debug, c++11, Asan
ERROR: failed to make cryptest.exe
************************************
Testing: release, c++11, Asan
ERROR: failed to make cryptest.exe
************************************
Testing: c++14, Asan
ERROR: failed to make cryptest.exe
************************************
```
Investigating further:
```
cryptest.sh: line 1539: asan_symbolize: command not found
ERROR: failed to make cryptest.exe
```
It appears MacPort's Clang is not providing `asan_symbolize`. I seem to recall I used to copy it out of the build tree by hand when building Clang from sources.
| MacPorts Clang and "asan_symbolize: command not found" | https://api.github.com/repos/weidai11/cryptopp/issues/197/comments | 1 | 2016-06-20T18:31:47Z | 2016-06-20T18:58:42Z | https://github.com/weidai11/cryptopp/issues/197 | 161,262,858 | 197 |
[
"weidai11",
"cryptopp"
] | The following was uncovered using Robert Nelson's ARMv8 (Aarch64) Mustang server board. It is not present under GCC.
```
$ make CXX=/usr/local/bin/clang++ CXXFLAGS="-DNDEBUG -g2 -O2 -fPIC -pipe" cpu.o
/usr/local/bin/clang++ -DNDEBUG -g2 -O2 -fPIC -pipe -c cpu.cpp
In file included from cpu.cpp:12:
In file included from ./cpu.h:48:
/usr/include/clang/3.5.0/include/xmmintrin.h:28:2: error: "SSE instruction set
not enabled"
#error "SSE instruction set not enabled"
^
1 error generated.
GNUmakefile:735: recipe for target 'cpu.o' failed
make: *** [cpu.o] Error 1
```
| ARM, Clang and "SSE instruction set not enabled" | https://api.github.com/repos/weidai11/cryptopp/issues/196/comments | 2 | 2016-06-20T15:25:33Z | 2016-06-20T15:36:15Z | https://github.com/weidai11/cryptopp/issues/196 | 161,222,924 | 196 |
[
"weidai11",
"cryptopp"
] | If there is some translation of the code to C #
a tool used all these files in Visual C ++
but I do not understand much c ++
I want to spend this tool to C #
someone who can help me carry the code to C #.
there is an implementation in C #?
please someone help me
Thank you
| as I can use this in C # | https://api.github.com/repos/weidai11/cryptopp/issues/195/comments | 1 | 2016-06-20T03:28:08Z | 2016-06-20T03:36:04Z | https://github.com/weidai11/cryptopp/issues/195 | 161,110,740 | 195 |
[
"weidai11",
"cryptopp"
] | Testing on a ARM Mustang server board reveals:
```
34 configurations tested
5 errors detected. See cryptest-result.txt for details
43630:/usr/include/clang/3.5.0/include/xmmintrin.h:28:2: error: "SSE instruction set not enabled"
43631:#error "SSE instruction set not enabled"
43636:1 error generated.
43638:make: *** [cpu.o] Error 1
43640:ERROR: failed to make cryptest.exe
43685:5 errors detected. See cryptest-result.txt for details
No warnings detected
```
And:
```
$ grep -B 4 '#error' cryptest-result.txt
/usr/local/bin/clang++ -DNDEBUG -g2 -O2 -fPIC -pipe -c seal.cpp
In file included from cpu.cpp:12:
In file included from ./cpu.h:48:
/usr/include/clang/3.5.0/include/xmmintrin.h:28:2: error: "SSE instruction set not enabled"
#error "SSE instruction set not enabled"
```
The odd thing is it only surfaces under one platform. It seems like it should have been all platforms.
| ARM and error: "SSE instruction set not enabled" | https://api.github.com/repos/weidai11/cryptopp/issues/194/comments | 2 | 2016-06-20T01:14:00Z | 2016-06-20T15:36:26Z | https://github.com/weidai11/cryptopp/issues/194 | 161,101,886 | 194 |
[
"weidai11",
"cryptopp"
] | When compiling on a 32-bit/i686 machine using GCC 5.3 with `-std=c++11` or `-std=c++14`, the library fails to compile. It appears this configuration is missing a definition for `__m128` (it does not surface with lesser GCC, 64-bit, `-std=c++03`, etc):
```
g++ -DDEBUG -g3 -O0 -std=c++14 -fPIC -march=native -pipe -D_GLIBCXX_DEBUG -c seal.cpp
In file included from /usr/lib/gcc/x86_64-linux-gnu/4.9/include/x86intrin.h:41:0,
from /usr/include/x86_64-linux-gnu/c++/4.9/bits/opt_random.h:33,
from /usr/include/c++/4.9/random:50,
from /usr/include/c++/4.9/bits/stl_algo.h:66,
from /usr/include/c++/4.9/algorithm:62,
from stdcpp.h:13,
from cryptlib.h:87,
from blake2.cpp:8:
cpu.h:65:1: error: expected unqualified-id before ‘int’
_mm_extract_epi32 (__m128i a, const int i)
^
cpu.h:65:1: error: expected ‘)’ before ‘int’
cpu.h:65:1: error: expected ‘)’ before ‘int’
cpu.h:72:1: error: expected ‘)’ before ‘__builtin_ia32_vec_set_v4si’
_mm_insert_epi32 (__m128i a, int b, const int i)
^
In file included from /usr/lib/gcc/x86_64-linux-gnu/4.9/include/x86intrin.h:43:0,
from /usr/include/x86_64-linux-gnu/c++/4.9/bits/opt_random.h:33,
from /usr/include/c++/4.9/random:50,
from /usr/include/c++/4.9/bits/stl_algo.h:66,
from /usr/include/c++/4.9/algorithm:62,
from stdcpp.h:13,
from cryptlib.h:87,
from blake2.cpp:8:
cpu.h:86:1: error: expected ‘)’ before ‘__builtin_ia32_pclmulqdq128’
_mm_clmulepi64_si128 (__m128i a, __m128i b, const int i)
...
```
| cpu.h and error: expected unqualified-id before 'int' | https://api.github.com/repos/weidai11/cryptopp/issues/193/comments | 1 | 2016-06-19T15:41:10Z | 2016-06-20T01:44:33Z | https://github.com/weidai11/cryptopp/issues/193 | 161,078,493 | 193 |
[
"weidai11",
"cryptopp"
] | I'm attempting to build the following [standard targets](http://cryptopp.com/wiki/GNUmakefile#Standard_Targets): `static`, `dynamic`, and `test`.:
```
$ cmake .
-- The C compiler identification is AppleClang 5.1.0.5030040
-- The CXX compiler identification is AppleClang 5.1.0.5030040
-- Check for working C compiler: /Applications/Xcode-5_1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode-5_1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Applications/Xcode-5_1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Check for working CXX compiler: /Applications/Xcode-5_1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Check if the system is big endian
-- Searching 16 bit integer
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of unsigned short
-- Check size of unsigned short - done
-- Using unsigned short
-- Check if the system is big endian - little endian
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - found
-- Found Threads: TRUE
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/jwalton/cryptopp
```
Then:
```
$ make -f Makefile static dynamic test
make: *** No rule to make target 'static'. Stop.
```
And:
```
$ uname -a
Darwin riemann.local 12.6.0 Darwin Kernel Version 12.6.0: Wed Mar 18 16:23:48 PDT 2015; root:xnu-2050.48.19~1/RELEASE_X86_64 x86_64
```
| Cmake and "No rule to make target 'static'. Stop" | https://api.github.com/repos/weidai11/cryptopp/issues/192/comments | 13 | 2016-06-19T05:28:02Z | 2016-06-21T11:39:24Z | https://github.com/weidai11/cryptopp/issues/192 | 161,057,426 | 192 |
[
"weidai11",
"cryptopp"
] | Running on OS X 10.9 with Xcode 6.
```
$ cmake .
-- The C compiler identification is AppleClang 6.0.0.6000057
-- The CXX compiler identification is AppleClang 6.0.0.6000057
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Check if the system is big endian
-- Searching 16 bit integer
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of unsigned short
-- Check size of unsigned short - done
-- Using unsigned short
-- Check if the system is big endian - little endian
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - found
-- Found Threads: TRUE
-- Configuring done
CMake Warning (dev):
Policy CMP0042 is not set: MACOSX_RPATH is enabled by default. Run "cmake
--help-policy CMP0042" for policy details. Use the cmake_policy command to
set the policy and suppress this warning.
MACOSX_RPATH is not specified for the following targets:
cryptopp-shared
This warning is for project developers. Use -Wno-dev to suppress it.
-- Generating done
```
And:
```
$ cmake --version
cmake version 3.5.2
```
| CMake Warning: MACOSX_RPATH is not specified for the following targets... | https://api.github.com/repos/weidai11/cryptopp/issues/191/comments | 2 | 2016-06-16T08:37:10Z | 2016-06-17T12:58:20Z | https://github.com/weidai11/cryptopp/issues/191 | 160,606,873 | 191 |
[
"weidai11",
"cryptopp"
] | MacPorts compilers should use Clang integrated assembler via `-Wa,-q`.
The GNU Assembler supplied by Apple is something around 1.38, and modern GCC cannot use it. Also see [How to use AVX/pclmulqdq on Mac OS X](http://stackoverflow.com/q/9840207/608639) on Stack Overflow.
| MacPorts GCC should use Clang integrated assembler via -Wa,-q | https://api.github.com/repos/weidai11/cryptopp/issues/190/comments | 1 | 2016-06-16T06:49:05Z | 2016-06-16T14:50:35Z | https://github.com/weidai11/cryptopp/issues/190 | 160,589,698 | 190 |
[
"weidai11",
"cryptopp"
] | Testing a compile using the MacPorts GCC compiler reveals `-DCRYPTOPP_DISABLE_ASM` is engaged:
```
$ make CXX=/opt/local/bin/x86_64-apple-darwin12-gcc-4.9.3
/opt/local/bin/x86_64-apple-darwin12-gcc-4.9.3 -DNDEBUG -g2 -O2 -fPIC -march=native
-DCRYPTOPP_DISABLE_ASM -pipe -DMACPORTS_GCC_COMPILER=1 -c cryptlib.cpp
...
```
UB previously mentioned this issue on the mailing list. I don't recall what came of it.
The fix is rather trivial. We should use `MACPORTS_COMPILER` to help evaluate the need for `-DCRYPTOPP_DISABLE_ASM`.
```
ifeq ($(GCC_COMPILER)$(MACPORTS_COMPILER)$(GAS210_OR_LATER),100)
CXXFLAGS += -DCRYPTOPP_DISABLE_ASM
else
ifeq ($(GCC_COMPILER)$(MACPORTS_COMPILER)$(GAS217_OR_LATER),100)
CXXFLAGS += -DCRYPTOPP_DISABLE_SSSE3
else
ifeq ($(GCC_COMPILER)$(MACPORTS_COMPILER)$(GAS219_OR_LATER),100)
CXXFLAGS += -DCRYPTOPP_DISABLE_AESNI
endif
```
| MacPorts GCC engages -DCRYPTOPP_DISABLE_ASM | https://api.github.com/repos/weidai11/cryptopp/issues/189/comments | 1 | 2016-06-16T03:11:12Z | 2016-06-16T11:39:09Z | https://github.com/weidai11/cryptopp/issues/189 | 160,568,536 | 189 |
[
"weidai11",
"cryptopp"
] | Sun Studio 12.4 adds [C++11 support](http://docs.oracle.com/cd/E37069_01/html/E37071/gndfg.html). Attempting to compile `integer.cpp` results in the following. The results can be reproduced with and without `-DCRYPTOPP_DISABLE_ASM`; and with and without `-KPIC`.
```
/opt/solarisstudio12.4/bin/CC -DNDEBUG -g3 -xO2 -native -m64 -KPIC -template=no%extdef -w -c integer.cpp
"integer.cpp", line 880: Error: The operand "___LKDB" cannot be assigned to.
"integer.cpp", line 1175: Error: The operand "___LLDB" cannot be assigned to.
"integer.cpp", line 1175: Error: The operand "___LMDB" cannot be assigned to.
"integer.cpp", line 1175: Error: The operand "___LNDB" cannot be assigned to.
"integer.cpp", line 1175: Error: The operand "___LODB" cannot be assigned to.
"integer.cpp", line 1175: Error: The operand "___LPDB" cannot be assigned to.
"integer.cpp", line 1175: Error: The operand "___LQDB" cannot be assigned to.
"integer.cpp", line 1175: Error: The operand "___LRDB" cannot be assigned to.
"integer.cpp", line 1175: Error: The operand "___LSDB" cannot be assigned to.
"integer.cpp", line 1180: Error: The operand "___LTDB" cannot be assigned to.
"integer.cpp", line 1180: Error: The operand "___LUDB" cannot be assigned to.
"integer.cpp", line 1180: Error: The operand "___LVDB" cannot be assigned to.
"integer.cpp", line 1180: Error: The operand "___LWDB" cannot be assigned to.
"integer.cpp", line 1180: Error: The operand "___LXDB" cannot be assigned to.
"integer.cpp", line 1180: Error: The operand "___LYDB" cannot be assigned to.
"integer.cpp", line 1180: Error: The operand "___LZDB" cannot be assigned to.
"integer.cpp", line 1180: Error: The operand "___LAEB" cannot be assigned to.
"integer.cpp", line 1180: Error: The operand "___LBEB" cannot be assigned to.
"integer.cpp", line 1180: Error: The operand "___LCEB" cannot be assigned to.
"integer.cpp", line 1180: Error: The operand "___LDEB" cannot be assigned to.
"integer.cpp", line 1180: Error: The operand "___LEEB" cannot be assigned to.
"integer.cpp", line 1180: Error: The operand "___LFEB" cannot be assigned to.
"integer.cpp", line 1180: Error: The operand "___LGEB" cannot be assigned to.
"integer.cpp", line 1180: Error: The operand "___LHEB" cannot be assigned to.
"integer.cpp", line 1180: Error: The operand "___LIEB" cannot be assigned to.
Compilation aborted, too many Error messages.
```
Line 880 is the call to `MultiplyWords` in the following:
```
static word LinearMultiply(word *C, const word *A, word B, size_t N)
{
word carry=0;
for(unsigned i=0; i<N; i++)
{
Declare2Words(p);
MultiplyWords(p, A[i], B);
Acc2WordsBy1(p, carry);
C[i] = LowWord(p);
carry = HighWord(p);
}
return carry;
}
```
`MultiplyWords` is a macro from line 166 that expands to `MultiplyWordsLoHi(p##0, p##1, a, b)`.
I'm having trouble learning more about this particular problem, so a question is open on Stack Overflow: [Gathering information on compile issue under Sun Studio](http://stackoverflow.com/q/37802148).
| Sun Studio 12.4 and Error: The operand "___LKDB" cannot be assigned to. | https://api.github.com/repos/weidai11/cryptopp/issues/188/comments | 1 | 2016-06-14T02:25:25Z | 2016-07-15T20:04:54Z | https://github.com/weidai11/cryptopp/issues/188 | 160,084,179 | 188 |
[
"weidai11",
"cryptopp"
] | Running the `cryptest.sh` on Cygwin i686 with GCC 5.3 and `-std=c++11` results in:
```
29 configurations tested
64 errors detected. See cryptest-result.txt for details
5601:socketft.cpp:144:23: error: ‘u_short’ was not declared in this scope
5604:socketft.cpp:144:31: error: expected ‘)’ before ‘port’
5607:socketft.cpp:144:36: error: expected ‘)’ before ‘;’ token
5615:socketft.cpp:186:23: error: ‘u_short’ was not declared in this scope
5618:socketft.cpp:186:31: error: expected ‘)’ before ‘port’
5621:socketft.cpp:186:36: error: expected ‘)’ before ‘;’ token
5624:make: *** [GNUmakefile:702: socketft.o] Error 1
5625:ERROR: failed to make cryptest.exe
5736:socketft.cpp:144:23: error: ‘u_short’ was not declared in this scope
5739:socketft.cpp:144:31: error: expected ‘)’ before ‘port’
5742:socketft.cpp:144:36: error: expected ‘)’ before ‘;’ token
5750:socketft.cpp:186:23: error: ‘u_short’ was not declared in this scope
5753:socketft.cpp:186:31: error: expected ‘)’ before ‘port’
5756:socketft.cpp:186:36: error: expected ‘)’ before ‘;’ token
5759:make: *** [GNUmakefile:702: socketft.o] Error 1
5760:ERROR: failed to make cryptest.exe
5867:socketft.cpp:144:23: error: ‘u_short’ was not declared in this scope
5871:socketft.cpp:186:23: error: ‘u_short’ was not declared in this scope
5874:make: *** [GNUmakefile:702: socketft.o] Error 1
5875:ERROR: failed to make cryptest.exe
5986:socketft.cpp:144:23: error: ‘u_short’ was not declared in this scope
5989:socketft.cpp:144:31: error: expected ‘)’ before ‘port’
5992:socketft.cpp:144:36: error: expected ‘)’ before ‘;’ token
6000:socketft.cpp:186:23: error: ‘u_short’ was not declared in this scope
6003:socketft.cpp:186:31: error: expected ‘)’ before ‘port’
6006:socketft.cpp:186:36: error: expected ‘)’ before ‘;’ token
6009:make: *** [GNUmakefile:702: socketft.o] Error 1
6010:ERROR: failed to make cryptest.exe
6117:socketft.cpp:144:23: error: ‘u_short’ was not declared in this scope
6121:socketft.cpp:186:23: error: ‘u_short’ was not declared in this scope
6124:make: *** [GNUmakefile:702: socketft.o] Error 1
6125:ERROR: failed to make cryptest.exe
6236:socketft.cpp:144:23: error: ‘u_short’ was not declared in this scope
6239:socketft.cpp:144:31: error: expected ‘)’ before ‘port’
6242:socketft.cpp:144:36: error: expected ‘)’ before ‘;’ token
6250:socketft.cpp:186:23: error: ‘u_short’ was not declared in this scope
6253:socketft.cpp:186:31: error: expected ‘)’ before ‘port’
6256:socketft.cpp:186:36: error: expected ‘)’ before ‘;’ token
6259:make: *** [GNUmakefile:702: socketft.o] Error 1
6260:ERROR: failed to make cryptest.exe
6525:ERROR: failed to execute validation suite
6527:ERROR: failed to execute test vectors
8050:ERROR: failed to execute validation suite
8052:ERROR: failed to execute test vectors
12190:ERROR: failed to execute validation suite
12192:ERROR: failed to execute test vectors
17152:ERROR: failed to execute validation suite
18288:ERROR: failed to execute validation suite
25184:socketft.cpp:144:23: error: ‘u_short’ was not declared in this scope
25187:socketft.cpp:144:31: error: expected ‘)’ before ‘port’
25190:socketft.cpp:144:36: error: expected ‘)’ before ‘;’ token
25198:socketft.cpp:186:23: error: ‘u_short’ was not declared in this scope
25201:socketft.cpp:186:31: error: expected ‘)’ before ‘port’
25204:socketft.cpp:186:36: error: expected ‘)’ before ‘;’ token
25207:make: *** [GNUmakefile:702: socketft.o] Error 1
25208:ERROR: failed to make cryptest.exe
25319:socketft.cpp:144:23: error: ‘u_short’ was not declared in this scope
25322:socketft.cpp:144:31: error: expected ‘)’ before ‘port’
25325:socketft.cpp:144:36: error: expected ‘)’ before ‘;’ token
25333:socketft.cpp:186:23: error: ‘u_short’ was not declared in this scope
25336:socketft.cpp:186:31: error: expected ‘)’ before ‘port’
25339:socketft.cpp:186:36: error: expected ‘)’ before ‘;’ token
25342:make: *** [GNUmakefile:702: socketft.o] Error 1
25343:ERROR: failed to make cryptest.exe
25352:64 errors detected. See cryptest-result.txt for details
```
Here's a typical finding:
```
g++ -DNDEBUG -g2 -O2 -std=c++11 -DCRYPTOPP_NO_BACKWARDS_COMPATIBILITY_562 -Wall -Wextra -Wno-unknown-pragmas -Wstrict-aliasing=3 -Wstrict-overflow
-Waggressive-loop-optimizations -Wcast-align -Wwrite-strings -Wformat=2 -Wformat-security -Wtrampolines -Wabi -Wodr -march=native -Wa,--divide -pipe -c socketft.cpp
In file included from /usr/include/cygwin/in.h:263:0,
from /usr/include/netinet/in.h:14,
from /usr/include/netdb.h:69,
from socketft.cpp:24:
socketft.cpp: In member function ‘void CryptoPP::Socket::Bind(unsigned int, const char*)’:
socketft.cpp:144:23: error: ‘u_short’ was not declared in this scope
sa.sin_port = htons((u_short)port);
^
socketft.cpp:144:31: error: expected ‘)’ before ‘port’
sa.sin_port = htons((u_short)port);
^
socketft.cpp:144:36: error: expected ‘)’ before ‘;’ token
sa.sin_port = htons((u_short)port);
^
socketft.cpp: At global scope:
socketft.cpp:125:32: warning: unused parameter ‘port’ [-Wunused-parameter]
void Socket::Bind(unsigned int port, const char *addr)
^
In file included from /usr/include/cygwin/in.h:263:0,
from /usr/include/netinet/in.h:14,
from /usr/include/netdb.h:69,
from socketft.cpp:24:
socketft.cpp: In member function ‘bool CryptoPP::Socket::Connect(const char*, unsigned int)’:
socketft.cpp:186:23: error: ‘u_short’ was not declared in this scope
sa.sin_port = htons((u_short)port);
^
socketft.cpp:186:31: error: expected ‘)’ before ‘port’
sa.sin_port = htons((u_short)port);
^
socketft.cpp:186:36: error: expected ‘)’ before ‘;’ token
sa.sin_port = htons((u_short)port);
^
socketft.cpp: At global scope:
socketft.cpp:162:53: warning: unused parameter ‘port’ [-Wunused-parameter]
bool Socket::Connect(const char *addr, unsigned int port)
```
| Cygwin i686/GCC 5.3 and error: ‘u_short’ was not declared in this scope | https://api.github.com/repos/weidai11/cryptopp/issues/187/comments | 2 | 2016-06-13T03:15:21Z | 2016-06-13T03:56:07Z | https://github.com/weidai11/cryptopp/issues/187 | 159,866,565 | 187 |
[
"weidai11",
"cryptopp"
] | As CBC_CTS_Encryption inherits CBC_Encryption and CBC_Encryption::ProcessData allows the two buffers to be the same, I think CBC_CTS_Encryption::ProcessLastBlock should allow it too.
Or if not, an assert to check that are not the same would be useful.
| CBC_CTS_Encryption::ProcessLastBlock does not work inplace | https://api.github.com/repos/weidai11/cryptopp/issues/185/comments | 12 | 2016-06-12T16:29:48Z | 2017-05-25T06:07:19Z | https://github.com/weidai11/cryptopp/issues/185 | 159,835,611 | 185 |
[
"weidai11",
"cryptopp"
] | Recently we [added some tests](https://github.com/weidai11/cryptopp/blob/master/cryptest.sh#L1911) to ensure the code compiles cleanly when the underlying processor lacks some features. The tests also serve to ensure `HasAES()`, `HasRDRAND()`, and friends work as expected and the code is properly compartmentalized. This is the "modern compiler/old hardware" combination.
Testing under a MacBook Pro with a Core2 Duo, OS X 10.9 and Xcode 5.1 produces the following.
```
cryptopp$ make -k CXXFLAGS="-DNDEBUG -g2 -O2 -march=native -maes -mrdrnd -mrdseed"
g++ -DNDEBUG -g2 -O2 -march=native -maes -mrdrnd -mrdseed -c gcm.cpp
gcm.cpp:130:25: error: use of undeclared identifier '_mm_clmulepi64_si128'
c1 = _mm_xor_si128(c1, _mm_clmulepi64_si128(c0, r, 0x10));
^
gcm.cpp:134:7: error: use of undeclared identifier '_mm_clmulepi64_si128'
c0 = _mm_clmulepi64_si128(c0, r, 0);
^
gcm.cpp:145:15: error: use of undeclared identifier '_mm_clmulepi64_si128'
__m128i c0 = _mm_clmulepi64_si128(x,h,0);
^
gcm.cpp:146:29: error: use of undeclared identifier '_mm_clmulepi64_si128'
__m128i c1 = _mm_xor_si128(_mm_clmulepi64_si128(x,h,1), _mm_clmu...
^
gcm.cpp:147:15: error: use of undeclared identifier '_mm_clmulepi64_si128'
__m128i c2 = _mm_clmulepi64_si128(x,h,0x11);
^
gcm.cpp:403:29: error: use of undeclared identifier '_mm_clmulepi64_si128'
c0 = _mm_xor_si128(c0, _mm_clmul...
^
gcm.cpp:404:29: error: use of undeclared identifier '_mm_clmulepi64_si128'
c2 = _mm_xor_si128(c2, _mm_clmul...
^
gcm.cpp:406:29: error: use of undeclared identifier '_mm_clmulepi64_si128'
c1 = _mm_xor_si128(c1, _mm_clmul...
^
gcm.cpp:411:28: error: use of undeclared identifier '_mm_clmulepi64_si128'
c0 = _mm_xor_si128(c0, _mm_clmulepi64_si...
^
gcm.cpp:412:28: error: use of undeclared identifier '_mm_clmulepi64_si128'
c2 = _mm_xor_si128(c2, _mm_clmulepi64_si...
^
gcm.cpp:414:28: error: use of undeclared identifier '_mm_clmulepi64_si128'
c1 = _mm_xor_si128(c1, _mm_clmulepi64_si...
^
gcm.cpp:420:29: error: use of undeclared identifier '_mm_clmulepi64_si128'
c0 = _mm_xor_si128(c0, _mm_clmul...
^
gcm.cpp:421:29: error: use of undeclared identifier '_mm_clmulepi64_si128'
c2 = _mm_xor_si128(c2, _mm_clmul...
^
gcm.cpp:423:29: error: use of undeclared identifier '_mm_clmulepi64_si128'
c1 = _mm_xor_si128(c1, _mm_clmul...
^
gcm.cpp:428:28: error: use of undeclared identifier '_mm_clmulepi64_si128'
c0 = _mm_xor_si128(c0, _mm_clmulepi64_si...
^
gcm.cpp:429:28: error: use of undeclared identifier '_mm_clmulepi64_si128'
c2 = _mm_xor_si128(c2, _mm_clmulepi64_si...
^
gcm.cpp:431:28: error: use of undeclared identifier '_mm_clmulepi64_si128'
c1 = _mm_xor_si128(c1, _mm_clmulepi64_si...
^
17 errors generated.
GNUmakefile:702: recipe for target 'gcm.o' failed
```
| Clang 3.5/Apple Clang 5.0 and undeclared identifier '_mm_clmulepi64_si128' | https://api.github.com/repos/weidai11/cryptopp/issues/184/comments | 2 | 2016-06-12T13:23:00Z | 2016-09-09T13:47:12Z | https://github.com/weidai11/cryptopp/issues/184 | 159,827,130 | 184 |
[
"weidai11",
"cryptopp"
] | Recently we [added some tests](https://github.com/weidai11/cryptopp/blob/master/cryptest.sh#L1911) to ensure the code compiles cleanly when the underlying processor lacks some features. The tests also serve to ensure `HasAES()`, `HasRDRAND()`, `HasRDSEED()` and friends work as expected and the code is properly compartmentalized. This is the "modern compiler/old hardware" combination.
Testing under a MacBook Pro with a Core i7-2760QM, OS X 10.8.5 and Clang 3.6 built from sources produces the following. The second generation i7 has AES but its missing `rdrand` and `rdseed`.
```
clang++ -DNDEBUG -g2 -O2 -march=native -maes -mrdrnd -mrdseed -c socketft.cpp
rdrand.cpp:367:7: error: use of undeclared identifier '_rdseed64_step'; did you
mean '_rdrand64_step'?
if (_rdseed64_step((word64*)output))
^~~~~~~~~~~~~~
_rdrand64_step
/usr/local/bin/../lib/clang/3.6.0/include/immintrin.h:114:1: note:
'_rdrand64_step' declared here
_rdrand64_step(unsigned long long *__p)
^
rdrand.cpp:388:7: error: use of undeclared identifier '_rdseed64_step'; did you
mean '_rdrand64_step'?
if (_rdseed64_step(&val))
^~~~~~~~~~~~~~
_rdrand64_step
/usr/local/bin/../lib/clang/3.6.0/include/immintrin.h:114:1: note:
'_rdrand64_step' declared here
_rdrand64_step(unsigned long long *__p)
^
2 errors generated.
```
| Clang 3.6/Apple Clang 6.3 and undeclared identifier '_rdseed64_step' | https://api.github.com/repos/weidai11/cryptopp/issues/183/comments | 1 | 2016-06-12T12:43:31Z | 2016-06-12T13:01:29Z | https://github.com/weidai11/cryptopp/issues/183 | 159,825,379 | 183 |
[
"weidai11",
"cryptopp"
] | Recently we [added some tests](https://github.com/weidai11/cryptopp/blob/master/cryptest.sh#L1911) to ensure the code compiles cleanly when the underlying processor lacks some features. The tests also serve to ensure `HasAES()`, `HasRDRAND()`, and friends work as expected and the code is properly compartmentalized. This is the "modern compiler/old hardware" combination.
Testing under a MacBook Pro with a Core2 Duo, OS X 10.9 and Xcode 5.1 produces the following.
```
$ c++ -DNDEBUG -g2 -O2 -march=native -maes -mrdrnd -mrdseed -c cpu.cpp
In file included from cpu.cpp:12:
./cpu.h:80:68: warning: unknown attribute '__artificial__' ignored
[-Wattributes]
__inline __m128i __attribute__((__gnu_inline__, __always_inline__, __art...
^
./cpu.h:86:68: warning: unknown attribute '__artificial__' ignored
[-Wattributes]
__inline __m128i __attribute__((__gnu_inline__, __always_inline__, __art...
^
./cpu.h:93:68: warning: unknown attribute '__artificial__' ignored
[-Wattributes]
__inline __m128i __attribute__((__gnu_inline__, __always_inline__, __art...
^
./cpu.h:100:68: warning: unknown attribute '__artificial__' ignored
[-Wattributes]
__inline __m128i __attribute__((__gnu_inline__, __always_inline__, __art...
^
./cpu.h:106:68: warning: unknown attribute '__artificial__' ignored
[-Wattributes]
__inline __m128i __attribute__((__gnu_inline__, __always_inline__, __art...
^
./cpu.h:112:68: warning: unknown attribute '__artificial__' ignored
[-Wattributes]
__inline __m128i __attribute__((__gnu_inline__, __always_inline__, __art...
^
./cpu.h:118:68: warning: unknown attribute '__artificial__' ignored
[-Wattributes]
__inline __m128i __attribute__((__gnu_inline__, __always_inline__, __art...
^
./cpu.h:83:7: error: invalid operand for inline asm constraint 'i'
asm ("pclmulqdq %2, %1, %0" : "+x"(a) : "xm"(b), "i"(i));
^
Stack dump:
0. Program arguments: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -cc1 -triple x86_64-apple-macosx10.9.0 -emit-obj -disable-free -disable-llvm-verifier -main-file-name cpu.cpp -mrelocation-model pic -pic-level 2 -mdisable-fp-elim -masm-verbose -munwind-tables -target-cpu penryn -target-feature +aes -target-feature +rdrnd -target-feature +rdseed -target-linker-version 241.9 -gdwarf-2 -coverage-file /Users/jwalton/Desktop/cryptopp/cpu.o -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0 -D NDEBUG -stdlib=libc++ -O2 -fdeprecated-macro -fdebug-compilation-dir /Users/jwalton/Desktop/cryptopp -ferror-limit 19 -fmessage-length 80 -stack-protector 1 -mstackrealign -fblocks -fobjc-runtime=macosx-10.9.0 -fencode-extended-block-signature -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops -vectorize-slp -o cpu.o -x c++ cpu.cpp
1. <eof> parser at end of file
2. Code generation
3. Running pass 'Function Pass Manager' on module 'cpu.cpp'.
4. Running pass 'Simple Register Coalescing' on function '@_ZN8CryptoPP20_mm_clmulepi64_si128EDv2_xS0_i'
clang: error: unable to execute command: Segmentation fault: 11
clang: error: clang frontend command failed due to signal (use -v to see invocation)
Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin13.4.0
Thread model: posix
clang: note: diagnostic msg: PLEASE submit a bug report to http://developer.apple.com/bugreporter/ and include the crash backtrace, preprocessed source, and associated run script.
clang: note: diagnostic msg:
********************
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang: note: diagnostic msg: /var/tmp/cpu-63907c.cpp
clang: note: diagnostic msg: /var/tmp/cpu-63907c.sh
clang: note: diagnostic msg:
********************
```
| Clang 3.5/Apple Clang 5.0 compiler crash | https://api.github.com/repos/weidai11/cryptopp/issues/182/comments | 1 | 2016-06-12T10:39:53Z | 2016-06-12T12:13:51Z | https://github.com/weidai11/cryptopp/issues/182 | 159,821,098 | 182 |
[
"weidai11",
"cryptopp"
] | ```
$ cmake .
-- The C compiler identification is GNU
-- The CXX compiler identification is SunPro
-- Check for working C compiler: /bin/gcc
-- Check for working C compiler: /bin/gcc -- works
-- Check for working CXX compiler: /opt/solarisstudio12.3/bin/CC
-- Check for working CXX compiler: /opt/solarisstudio12.3/bin/CC -- works
...
-- Using unsigned short
-- Check if the system is big endian - little endian
CMake Error at CMakeLists.txt:127 (target_include_directories):
Unknown CMake command "target_include_directories".
-- Configuring incomplete, errors occurred!
```
| Unknown CMake command "target_include_directories" | https://api.github.com/repos/weidai11/cryptopp/issues/181/comments | 8 | 2016-06-09T08:10:16Z | 2016-06-19T02:15:14Z | https://github.com/weidai11/cryptopp/issues/181 | 159,350,257 | 181 |
[
"weidai11",
"cryptopp"
] | We now have a SunOS 5.11 (Solaris 11.3) test box with Sun Studio 12.3 and 12.4.
We need some specialized tests for the platform.
| Add Sun Studio specific tests to cryptest.sh | https://api.github.com/repos/weidai11/cryptopp/issues/180/comments | 1 | 2016-06-09T05:08:56Z | 2016-07-15T20:05:11Z | https://github.com/weidai11/cryptopp/issues/180 | 159,329,066 | 180 |
[
"weidai11",
"cryptopp"
] | Andrew Marlow and Shengli Jiang [report on the mailing list](http://groups.google.com/forum/#!topic/cryptopp-users/egpBihTbOvM):
```
"ida.cpp", line 403: Error: random_access_iterator_tag is not defined.
"ida.cpp", line 403: Error: "," expected instead of ">".
"ida.cpp", line 407: Error: The function "RevIt" must have a prototype.
"ida.cpp", line 407: Error: The function "RevIt" must have a prototype.
"ida.cpp", line 407: Error: The function "RevIt" must have a prototype.
"ida.cpp", line 407: Error: The function "RevIt" must have a prototype.
"ida.cpp", line 408: Error: The operation "const int* != const unsigned char*" is illegal.
"ida.cpp", line 410: Error: The operation "const int* - const unsigned char*" is illegal.
"ida.cpp", line 412: Error: The operation "const unsigned char*const - const int*" is illegal.
9 Error(s) detected.
makefile.sun:42: recipe for target 'ida.o' failed
```
Performing the following does not duplicate the issue:
```
$ git checkout CRYPTOPP_5_6_2
$ gmake CXX=/opt/solarisstudio12.3/bin/CC ida.o
/opt/solarisstudio12.3/bin/CC -DNDEBUG -O -g0 -native -template=no%extdef -m64 -c ida.cpp
```
We have a test environment setup to duplicate the issue. Fix forthcoming.
| Solaris Studio 12.3 and 12.4 builds broken | https://api.github.com/repos/weidai11/cryptopp/issues/179/comments | 1 | 2016-06-07T11:50:11Z | 2016-07-15T20:05:23Z | https://github.com/weidai11/cryptopp/issues/179 | 158,903,711 | 179 |
[
"weidai11",
"cryptopp"
] | Recently we added better support for [Windows 8, Windows 10, Windows Store, and other newer Windows platforms](http://github.com/weidai11/cryptopp/issues/143). It appears Microsoft is doing something unexpected, and its causing `cryptest.exe` to fail under Windows 7/Visual Studio 2012. Running `cryptest.exe` results in: **_`The procedure entry point GetOverlappedResultEx could not be located in the dynamic link library KERNEL32.dll`**_.

Calling the newer functions, like `GetOverlappedResultEx`, is the result of better support for the newer Windows platforms and squashing the warnings generated by the Visual Studio toolchain. See, for example, the [`USE_WINDOWS8_API` macro in `winpipes.cpp`](http://github.com/weidai11/cryptopp/blob/master/winpipes.cpp). _No good deed goes unpunished_, as they say...
We don't set `WINVER` or `_WIN32_WINNT`. We don't have a `<winver.h>` or `<targetver.h>` in our [pre-converted Visual Studio 2010 solution and project files](http://www.cryptopp.com/wiki/Visual_Studio#Visual_Studio_2010). We expect users to set `WINVER` or `_WIN32_WINNT` appropriately when they have the need; otherwise, they get the default build environment. The folks contributing to [Cmake maintenance](http://github.com/weidai11/cryptopp/blob/master/CMakeLists.txt#L55) do this for their Windows UWP builds.
Its not clear to me why Microsoft is setting Windows 8 for a Windows 7 build and execution environment. We are trying to gather details on Stack Overflow at [Visual Studio setting WINVER/_WIN32_WINNT to Windows 8 on Windows 7?](http://stackoverflow.com/q/37668692)
Its not clear to me if we can easily clear this error. We **_can't**_ do something like below because Microsoft's toolchain is selecting the incorrect value, so our code will never execute:
```
#ifdef CRYPTOPP_WIN32_AVAILABLE
# ifndef _WIN32_WINNT
# define _WIN32_WINNT 0x0500
# endif
#endif
```
And if we select 0x0500, then we are wrong for Windows 8, Phone 8, Store 8, etc. If we select 0x0602 for Windows 8, Phone 8, Store 8, then we break all the down level clients like Windows Vista and Windows 7. We will also be wrong for Windows 10, Phone 10, Store 10.
We are trying to locate a value for `_WIN32_WINNT` that symbolizes "this platform". On Windows XP, "this platform" will take on the value of Windows XP and 0x0501. On Windows 7, "this platform" will take on the value of Windows 7 and 0x601. On Windows 8, "this platform" will take on the value of Windows 8 and 0x602, etc.
| Recent Windows 8 and Windows 10 support broke Windows 7/VS 2012 | https://api.github.com/repos/weidai11/cryptopp/issues/178/comments | 22 | 2016-06-07T01:32:18Z | 2016-10-09T20:23:34Z | https://github.com/weidai11/cryptopp/issues/178 | 158,810,966 | 178 |
[
"weidai11",
"cryptopp"
] | We should follow [Implementing GCM on ARMv8](http://conradoplg.cryptoland.net/files/2010/12/gcm14.pdf) by Gouvêa and López.
| Implementing GCM on ARMv8 | https://api.github.com/repos/weidai11/cryptopp/issues/177/comments | 1 | 2016-06-06T04:31:46Z | 2016-08-24T16:44:13Z | https://github.com/weidai11/cryptopp/issues/177 | 158,599,062 | 177 |
[
"weidai11",
"cryptopp"
] | cryptest.exe reports the following for an older Core2 duo processor
```
hasMMX == 1, hasISSE == 1, hasSSE2 == 1, hasSSSE3 == 0, hasSSE4 == 1, hasAESNI == 0,
hasRDRAND == 0, hasRDSEED == 0, hasCLMUL == 0, isP4 == 0, hasPadlockRNG == 0,
cacheLineSize == 64, AESNI_INTRINSICS == 1
```
The machine has SSE2, SSE3, SSSE3, and SSE4.1 (but not 4.2):
```
$ g++ -march=native -dM -E - </dev/null | grep SSE
#define __SSE4_1__ 1
#define __SSE2_MATH__ 1
#define __SSE_MATH__ 1
#define __SSE2__ 1
#define __SSSE3__ 1
#define __SSE__ 1
#define __SSE3__ 1
```
After building everything with `-g2 -O2 -march=native`, deleting `cpu.o`, and then rebuilding it with `-g3 -O0 -march=native`:
```
Breakpoint 1, CryptoPP::DetectX86Features () at cpu.cpp:223
223 if (!CpuId(0, cpuid))
(gdb) n
225 if (!CpuId(1, cpuid1))
(gdb)
228 g_hasMMX = (cpuid1[3] & (1 << 23)) != 0;
(gdb)
229 if ((cpuid1[3] & (1 << 26)) != 0)
(gdb)
230 g_hasSSE2 = TrySSE2();
(gdb)
231 g_hasSSSE3 = g_hasSSE2 && (cpuid1[2] & (1<<9));
(gdb)
232 g_hasSSE4 = g_hasSSE2 && ((cpuid1[2] & (1<<19)) && (cpuid1[2] & (1<<20)));
(gdb)
233 g_hasAESNI = g_hasSSE2 && (cpuid1[2] & (1<<25));
(gdb)
234 g_hasCLMUL = g_hasSSE2 && (cpuid1[2] & (1<<1));
(gdb)
236 if ((cpuid1[3] & (1 << 25)) != 0)
(gdb) p g_hasSSE2
$1 = true
(gdb) p g_hasSSSE3
$2 = true
(gdb) p g_hasSSE4
$3 = false
(gdb) p g_hasAESNI
$4 = false
(gdb) p g_hasCLMUL
$5 = false
```
Then set watchpoints looking for changes:
```
(gdb) watch g_hasSSSE3
Hardware watchpoint 2: g_hasSSSE3
(gdb) watch g_hasSSE4
Hardware watchpoint 3: g_hasSSE4
(gdb) c
Continuing.
...
All tests passed!
Test ended at Sat Jun 4 17:23:31 2016
Seed used was: 1465075409
[Inferior 1 (process 3539) exited normally]
```
Touching `cpu.h` and rebuilding all dependents produces the same result for optimized code.
GCC version is `gcc (Debian 4.9.2-10) 4.9.2`.
It appears the optimizer is removing necessary code again. Making the variables of interest `volatile` does not help.
| cryptest.exe reports wrong CPU features for Core2 duo | https://api.github.com/repos/weidai11/cryptopp/issues/176/comments | 2 | 2016-06-04T21:12:11Z | 2016-06-06T04:30:17Z | https://github.com/weidai11/cryptopp/issues/176 | 158,524,331 | 176 |
[
"weidai11",
"cryptopp"
] | Start of discussion in comments for commit https://github.com/weidai11/cryptopp/commit/b1a7ada564e629ed8697dc7009b1caed581975c8
cc @noloader
| Use std::call for singleton implementation | https://api.github.com/repos/weidai11/cryptopp/issues/173/comments | 4 | 2016-05-17T09:19:50Z | 2016-06-06T19:36:41Z | https://github.com/weidai11/cryptopp/issues/173 | 155,212,735 | 173 |
[
"weidai11",
"cryptopp"
] | `GetThreadTimes` is not available on Windows Phone and Windows Store. We need a performance based counter for TimerBase (or use the default low-res `clock()`).
This is part of the port to the new managed Windows platforms. Also see [Issue 143: Support for Universal Windows Platform (UWP)](http://github.com/weidai11/cryptopp/issues/143).
Also see [Native code for Windows Phone 8](http://msdn.microsoft.com/en-us/library/windows/apps/jj681687%28v=vs.105%29.aspx) on MSDN, [Supported Win32 APIs for Windows Phone 8](https://msdn.microsoft.com/en-us/library/windows/apps/jj662956%28v=vs.105%29.aspx) on MSDN, [Conditional compilation with preprocessor directives](http://msdn.microsoft.com/en-us/library/windows/apps/jj714084%28v=vs.105%29.aspx) on MSDN, [Platform defined macros for windows store app](https://social.msdn.microsoft.com/Forums/en-US/3965645c-978c-4148-b32c-1853f7fd22b3/platform-defined-macros-for-windows-store-app?forum=winappswithnativecode) on Microsoft Social and [Dual-use Coding Techniques for Games](https://blogs.msdn.microsoft.com/chuckw/2012/09/17/dual-use-coding-techniques-for-games-part-1/).
| Need performance based counter for TimerBase on Windows Phone and Windows Store | https://api.github.com/repos/weidai11/cryptopp/issues/168/comments | 7 | 2016-05-01T03:42:55Z | 2016-05-17T15:10:52Z | https://github.com/weidai11/cryptopp/issues/168 | 152,070,724 | 168 |
[
"weidai11",
"cryptopp"
] | We need to deactivate FIPS code paths for Windows Store apps. They are causing a number of issues due to missing APIs. The following is from a VS2012 x64 Cross Developer Command Prompt.
```
cl.exe /nologo /W4 /D_MBCS /Zi /TP /EHsc /MD /FI winapifamily.h /DWINAPI_FAMILY=WINAPI_FAMILY_APP /c fipstest.cpp
fipstest.cpp
C:\Program Files (x86)\Windows Kits\8.0\include\um\combaseapi.h(1205) : error C3861: 'CoCreateInstanceFromApp': identifier not found
C:\Program Files (x86)\Windows Kits\8.0\include\um\combaseapi.h(1226) : error C3861: 'CoCreateInstanceFromApp': identifier not found
fipstest.cpp(285) : error C3861: 'GetModuleFileNameW': identifier not found
fipstest.cpp(288) : error C3861: 'GetModuleHandleW': identifier not found
fipstest.cpp(293) : error C3861: 'GetModuleFileNameA': identifier not found
fipstest.cpp(302) : error C3861: 'GetModuleHandleA': identifier not found
NMAKE : warning U4010: 'fipstest.obj' : build failed; /K specified, continuing ...
```
This is part of the port to the new managed Windows platforms. Also see [Issue 143: Support for Universal Windows Platform (UWP)](http://github.com/weidai11/cryptopp/issues/143).
Also see [Native code for Windows Phone 8](http://msdn.microsoft.com/en-us/library/windows/apps/jj681687%28v=vs.105%29.aspx) on MSDN, [Supported Win32 APIs for Windows Phone 8](https://msdn.microsoft.com/en-us/library/windows/apps/jj662956%28v=vs.105%29.aspx) on MSDN, [Conditional compilation with preprocessor directives](http://msdn.microsoft.com/en-us/library/windows/apps/jj714084%28v=vs.105%29.aspx) on MSDN, [Platform defined macros for windows store app](https://social.msdn.microsoft.com/Forums/en-US/3965645c-978c-4148-b32c-1853f7fd22b3/platform-defined-macros-for-windows-store-app?forum=winappswithnativecode) on Microsoft Social and [Dual-use Coding Techniques for Games](https://blogs.msdn.microsoft.com/chuckw/2012/09/17/dual-use-coding-techniques-for-games-part-1/).
| Need to deactivate FIPS code paths for Windows Store apps | https://api.github.com/repos/weidai11/cryptopp/issues/167/comments | 4 | 2016-04-29T07:01:35Z | 2016-05-17T15:11:04Z | https://github.com/weidai11/cryptopp/issues/167 | 151,805,271 | 167 |
[
"weidai11",
"cryptopp"
] | According to [Modifying WINVER and _WIN32_WINNT](https://msdn.microsoft.com/en-us/library/6sehtctf%28v=vs.140%29.aspx) on MSDN and Visual Studio 2015 (and Visual Studio 2013):
> Visual C++ no longer supports targeting Windows 95, Windows 98, Windows ME, Windows NT or Windows 2000. If your WINVER or _WIN32_WINNT macros are assigned to one of these versions of Windows, you must modify the macros.
And [Modifying WINVER and _WIN32_WINNT](https://msdn.microsoft.com/en-us/library/6sehtctf%28v=vs.140%29.aspx) on MSDN and Visual Studio 2010:
> Visual C++ no longer supports targeting Windows 95, Windows 98, Windows ME, or Windows NT. If your WINVER or _WIN32_WINNT macros are assigned to one of these versions of Windows, you must modify the macros.
It looks like we are using Windows NT and Windows 2000 related version information:
```
$ grep _WIN32_WINNT *
fipstest.cpp:#define _WIN32_WINNT 0x0400
osrng.cpp:#ifndef _WIN32_WINNT
osrng.cpp:#define _WIN32_WINNT 0x0400
trap.h:# pragma push_macro("_WIN32_WINNT")
trap.h:# define _WIN32_WINNT 0x0400
trap.h:# pragma pop_macro("_WIN32_WINNT")
```
| Windows NT and Windows 2000 version info for WINVER and _WIN32_WINNT | https://api.github.com/repos/weidai11/cryptopp/issues/166/comments | 3 | 2016-04-28T00:21:49Z | 2016-09-10T17:31:51Z | https://github.com/weidai11/cryptopp/issues/166 | 151,521,815 | 166 |
[
"weidai11",
"cryptopp"
] | We need a `NO_SOCKET` macro to remove sockets only without resorting to `NO_OS_DEPENDENCE`.
This is part of the port to the new managed Windows platforms. Also see [Issue 143: Support for Universal Windows Platform (UWP)](http://github.com/weidai11/cryptopp/issues/143).
Also see [Native code for Windows Phone 8](http://msdn.microsoft.com/en-us/library/windows/apps/jj681687%28v=vs.105%29.aspx) on MSDN, [Supported Win32 APIs for Windows Phone 8](https://msdn.microsoft.com/en-us/library/windows/apps/jj662956%28v=vs.105%29.aspx) on MSDN, [Conditional compilation with preprocessor directives](http://msdn.microsoft.com/en-us/library/windows/apps/jj714084%28v=vs.105%29.aspx) on MSDN, [Platform defined macros for windows store app](https://social.msdn.microsoft.com/Forums/en-US/3965645c-978c-4148-b32c-1853f7fd22b3/platform-defined-macros-for-windows-store-app?forum=winappswithnativecode) on Microsoft Social and [Dual-use Coding Techniques for Games](https://blogs.msdn.microsoft.com/chuckw/2012/09/17/dual-use-coding-techniques-for-games-part-1/).
| Need NO_SOCKET macro to remove sockets only for Windows | https://api.github.com/repos/weidai11/cryptopp/issues/165/comments | 3 | 2016-04-26T18:49:21Z | 2016-05-17T15:11:13Z | https://github.com/weidai11/cryptopp/issues/165 | 151,211,039 | 165 |
[
"weidai11",
"cryptopp"
] | `BCryptGenRandom` is needed to provide a generator for Windows Store Apps (its also available for Windows Vista and above on the desktop). Docs are available at [BCryptGenRandom function](http://msdn.microsoft.com/en-us/library/windows/desktop/aa375458%28v=vs.85%29.aspx).
This is part of the port to the new managed Windows platforms. Also see [Issue 143: Support for Universal Windows Platform (UWP)](http://github.com/weidai11/cryptopp/issues/143).
Also see [Native code for Windows Phone 8](http://msdn.microsoft.com/en-us/library/windows/apps/jj681687%28v=vs.105%29.aspx) on MSDN, [Supported Win32 APIs for Windows Phone 8](https://msdn.microsoft.com/en-us/library/windows/apps/jj662956%28v=vs.105%29.aspx) on MSDN, [Conditional compilation with preprocessor directives](http://msdn.microsoft.com/en-us/library/windows/apps/jj714084%28v=vs.105%29.aspx) on MSDN, [Platform defined macros for windows store app](https://social.msdn.microsoft.com/Forums/en-US/3965645c-978c-4148-b32c-1853f7fd22b3/platform-defined-macros-for-windows-store-app?forum=winappswithnativecode) on Microsoft Social and [Dual-use Coding Techniques for Games](https://blogs.msdn.microsoft.com/chuckw/2012/09/17/dual-use-coding-techniques-for-games-part-1/).
| Need NonblockingRng based on BCryptGenRandom for Windows | https://api.github.com/repos/weidai11/cryptopp/issues/164/comments | 18 | 2016-04-26T18:42:06Z | 2016-05-17T15:13:23Z | https://github.com/weidai11/cryptopp/issues/164 | 151,209,414 | 164 |
[
"weidai11",
"cryptopp"
] | Step:
1. Open cryptest.sln
2. Switch 4 projects option from MT to MD
3. Build
Get: Error LNK2005 __crt_debugger_hook already defined in MSVCRT.lib
| Build break using MD mode under VS2015 with Update2 | https://api.github.com/repos/weidai11/cryptopp/issues/163/comments | 3 | 2016-04-26T05:34:04Z | 2016-06-28T12:23:11Z | https://github.com/weidai11/cryptopp/issues/163 | 151,045,400 | 163 |
[
"weidai11",
"cryptopp"
] | Below, we are testing for Windows Phone under ARM Developer Prompt _without_ `NO_OS_DEPENDENCE`.
```
cl /nologo /D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE=1 /EHsc /c crc.cpp blake2.cpp
crc.cpp
crc.cpp(287) : error C3861: 'HasSSE4': identifier not found
crc.cpp(290) : error C3861: '_mm_crc32_u8': identifier not found
crc.cpp(293) : error C3861: '_mm_crc32_u32': identifier not found
crc.cpp(296) : error C3861: '_mm_crc32_u8': identifier not found
blake2.cpp
blake2.cpp(171) : error C3861: 'HasSSE4': identifier not found
blake2.cpp(186) : error C3861: 'HasSSE4': identifier not found
blake2.cpp(1871) : error C2065: '__m128i' : undeclared identifier
blake2.cpp(1871) : error C2146: syntax error : missing ';' before identifier 'ro
w1'
blake2.cpp(1871) : error C2065: 'row1' : undeclared identifier
blake2.cpp(1871) : error C2065: 'row2' : undeclared identifier
blake2.cpp(1871) : error C2065: 'row3' : undeclared identifier
blake2.cpp(1871) : error C2065: 'row4' : undeclared identifier
blake2.cpp(1872) : error C2065: '__m128i' : undeclared identifier
blake2.cpp(1872) : error C2146: syntax error : missing ';' before identifier 'bu
f1'
blake2.cpp(1872) : error C2065: 'buf1' : undeclared identifier
blake2.cpp(1872) : error C2065: 'buf2' : undeclared identifier
blake2.cpp(1872) : error C2065: 'buf3' : undeclared identifier
blake2.cpp(1872) : error C2065: 'buf4' : undeclared identifier
blake2.cpp(1874) : error C2065: '__m128i' : undeclared identifier
blake2.cpp(1874) : error C2146: syntax error : missing ';' before identifier 't0
'
blake2.cpp(1874) : error C2065: 't0' : undeclared identifier
blake2.cpp(1874) : error C2065: 't1' : undeclared identifier
blake2.cpp(1874) : error C2065: 't2' : undeclared identifier
blake2.cpp(1875) : error C2065: '__m128i' : undeclared identifier
blake2.cpp(1875) : error C2146: syntax error : missing ';' before identifier 'ff
0'
blake2.cpp(1875) : error C2065: 'ff0' : undeclared identifier
blake2.cpp(1875) : error C2065: 'ff1' : undeclared identifier
blake2.cpp(1877) : error C4430: missing type specifier - int assumed. Note: C++
does not support default-int
blake2.cpp(1877) : error C2146: syntax error : missing ';' before identifier 'r8
'
blake2.cpp(1877) : error C2065: 'r8' : undeclared identifier
blake2.cpp(1877) : error C3861: '_mm_set_epi8': identifier not found
blake2.cpp(1878) : error C4430: missing type specifier - int assumed. Note: C++
does not support default-int
blake2.cpp(1878) : error C2146: syntax error : missing ';' before identifier 'r1
6'
blake2.cpp(1878) : error C2086: 'const int __m128i' : redefinition
blake2.cpp(1877) : see declaration of '__m128i'
blake2.cpp(1878) : error C2065: 'r16' : undeclared identifier
blake2.cpp(1878) : error C3861: '_mm_set_epi8': identifier not found
blake2.cpp(1880) : error C4430: missing type specifier - int assumed. Note: C++
does not support default-int
blake2.cpp(1880) : error C2146: syntax error : missing ';' before identifier 'm0
'
blake2.cpp(1880) : error C2086: 'const int __m128i' : redefinition
blake2.cpp(1877) : see declaration of '__m128i'
blake2.cpp(1880) : error C2065: 'm0' : undeclared identifier
blake2.cpp(1880) : error C2146: syntax error : missing ')' before identifier '__
m128i'
blake2.cpp(1880) : error C2059: syntax error : ')'
blake2.cpp(1881) : error C4430: missing type specifier - int assumed. Note: C++
does not support default-int
blake2.cpp(1881) : error C2146: syntax error : missing ';' before identifier 'm1
'
blake2.cpp(1881) : error C2086: 'const int __m128i' : redefinition
blake2.cpp(1877) : see declaration of '__m128i'
blake2.cpp(1881) : error C2065: 'm1' : undeclared identifier
blake2.cpp(1881) : error C2146: syntax error : missing ')' before identifier '__
m128i'
blake2.cpp(1881) : error C2059: syntax error : ')'
blake2.cpp(1882) : error C4430: missing type specifier - int assumed. Note: C++
does not support default-int
blake2.cpp(1882) : error C2146: syntax error : missing ';' before identifier 'm2
'
blake2.cpp(1882) : error C2086: 'const int __m128i' : redefinition
blake2.cpp(1877) : see declaration of '__m128i'
blake2.cpp(1882) : error C2065: 'm2' : undeclared identifier
blake2.cpp(1882) : error C2146: syntax error : missing ')' before identifier '__
m128i'
blake2.cpp(1882) : error C2059: syntax error : ')'
blake2.cpp(1883) : error C4430: missing type specifier - int assumed. Note: C++
does not support default-int
blake2.cpp(1883) : error C2146: syntax error : missing ';' before identifier 'm3
'
blake2.cpp(1883) : error C2086: 'const int __m128i' : redefinition
blake2.cpp(1877) : see declaration of '__m128i'
blake2.cpp(1883) : error C2065: 'm3' : undeclared identifier
blake2.cpp(1883) : error C2146: syntax error : missing ')' before identifier '__
m128i'
blake2.cpp(1883) : error C2059: syntax error : ')'
blake2.cpp(1885) : error C2065: 'row1' : undeclared identifier
blake2.cpp(1885) : error C2065: 'ff0' : undeclared identifier
blake2.cpp(1885) : error C4430: missing type specifier - int assumed. Note: C++
does not support default-int
blake2.cpp(1885) : error C2146: syntax error : missing ')' before identifier '__
m128i'
blake2.cpp(1885) : error C2059: syntax error : ')'
blake2.cpp(1886) : error C2065: 'row2' : undeclared identifier
blake2.cpp(1886) : error C2065: 'ff1' : undeclared identifier
blake2.cpp(1886) : error C4430: missing type specifier - int assumed. Note: C++
does not support default-int
blake2.cpp(1886) : error C2146: syntax error : missing ')' before identifier '__
m128i'
blake2.cpp(1886) : error C2059: syntax error : ')'
blake2.cpp(1887) : error C2065: 'row3' : undeclared identifier
blake2.cpp(1880) : error C3861: '_mm_loadu_si128': identifier not found
blake2.cpp(1881) : error C3861: '_mm_loadu_si128': identifier not found
blake2.cpp(1882) : error C3861: '_mm_loadu_si128': identifier not found
blake2.cpp(1883) : error C3861: '_mm_loadu_si128': identifier not found
blake2.cpp(1885) : error C3861: '_mm_loadu_si128': identifier not found
blake2.cpp(1886) : error C3861: '_mm_loadu_si128': identifier not found
blake2.cpp(1887) : error C3861: '_mm_setr_epi32': identifier not found
blake2.cpp(1888) : error C2065: 'row4' : undeclared identifier
blake2.cpp(1888) : error C4430: missing type specifier - int assumed. Note: C++
does not support default-int
blake2.cpp(1888) : error C2146: syntax error : missing ')' before identifier '__
m128i'
blake2.cpp(1888) : error C2059: syntax error : ')'
blake2.cpp(1889) : error C2065: 'buf1' : undeclared identifier
blake2.cpp(1889) : error C2065: 'm0' : undeclared identifier
blake2.cpp(1889) : error C2065: 'm1' : undeclared identifier
blake2.cpp(1888) : error C3861: '_mm_xor_si128': identifier not found
blake2.cpp(1888) : error C3861: '_mm_setr_epi32': identifier not found
blake2.cpp(1888) : error C3861: '_mm_loadu_si128': identifier not found
blake2.cpp(1889) : error C3861: '_mm_castps_si128': identifier not found
blake2.cpp(1889) : error C3861: '_mm_shuffle_ps': identifier not found
blake2.cpp(1889) : error C3861: '_mm_castsi128_ps': identifier not found
blake2.cpp(1889) : error C3861: '_MM_SHUFFLE': identifier not found
blake2.cpp(1891) : error C2065: 'row1' : undeclared identifier
blake2.cpp(1891) : error C2065: 'buf1' : undeclared identifier
blake2.cpp(1891) : error C2065: 'row2' : undeclared identifier
blake2.cpp(1891) : error C3861: '_mm_add_epi32': identifier not found
blake2.cpp(1892) : error C2065: 'row4' : undeclared identifier
blake2.cpp(1892) : error C2065: 'row1' : undeclared identifier
blake2.cpp(1892) : error C3861: '_mm_xor_si128': identifier not found
blake2.cpp(1893) : error C2065: 'row4' : undeclared identifier
blake2.cpp(1893) : error C2065: 'r16' : undeclared identifier
blake2.cpp(1893) : error C3861: '_mm_shuffle_epi8': identifier not found
blake2.cpp(1894) : error C2065: 'row3' : undeclared identifier
blake2.cpp(1894) : error C2065: 'row4' : undeclared identifier
blake2.cpp(1894) : error C3861: '_mm_add_epi32': identifier not found
blake2.cpp(1895) : error C2065: 'row2' : undeclared identifier
blake2.cpp(1895) : error C2065: 'row3' : undeclared identifier
blake2.cpp(1895) : error C3861: '_mm_xor_si128': identifier not found
blake2.cpp(1896) : error C2065: 'row2' : undeclared identifier
blake2.cpp(1896) : error C3861: '_mm_xor_si128': identifier not found
blake2.cpp(1896) : error C3861: '_mm_srli_epi32': identifier not found
blake2.cpp(1896) : error C3861: '_mm_slli_epi32': identifier not found
blake2.cpp(1898) : error C2065: 'buf2' : undeclared identifier
blake2.cpp(1898) : error C2065: 'm0' : undeclared identifier
blake2.cpp(1898) : fatal error C1003: error count exceeds 100; stopping compilat
ion
Generating Code...
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 11.0
\VC\BIN\x86_ARM\cl.EXE"' : return code '0x2'
Stop.
```
| Compile issues for crc.cpp and blake2.cpp under ARM Developer Prompt | https://api.github.com/repos/weidai11/cryptopp/issues/162/comments | 1 | 2016-04-25T20:33:11Z | 2016-04-25T20:40:14Z | https://github.com/weidai11/cryptopp/issues/162 | 150,972,857 | 162 |
[
"weidai11",
"cryptopp"
] | From a private email:
> ... we are securing iSCSI over TCP links in a high security environment... we use Crypto++... and it would be nice if Crypto++ provided CRC-32C...
This is an easy cut-in since Wei already provided us with CRC32. Also, using Intel's intrinsics, we can achieve a throughput of about 3.5 GB/s (about 0.6 cpb). That's about a 9x improvement over a C/C++ implementation that achieves about 400 MB/s (about 5.4 cpb). Benchmarks were taken on a Core-i5 5300 running at 2.3 GHz.
| Provide iSCSI CRC-32C | https://api.github.com/repos/weidai11/cryptopp/issues/160/comments | 1 | 2016-04-24T16:39:53Z | 2016-04-24T17:28:31Z | https://github.com/weidai11/cryptopp/issues/160 | 150,679,185 | 160 |
[
"weidai11",
"cryptopp"
] | On Linux, OS X and Unix we have a "test script from hell": [cryptest.sh](http://github.com/weidai11/cryptopp/blob/master/cryptest.sh). The script tests the library under various configuration options on a number of different platforms. Its value comes from detecting problems before code is checked in, and detecting problems before users experience issues in the field.
We need a test script for Windows that builds the various Visual Studio configurations under a Developer Command Prompt using Visual Studio 2010 and above with `msbuild`. That will allow us to **_easily**_ test changes like [Issue 143: Support for Universal Windows Platform (UWP)](https://github.com/weidai11/cryptopp/issues/143). The script could be named `cryptest.cmd`. It can run as a batch/command file, as a [command-based script host](https://technet.microsoft.com/en-us/library/bb490887.aspx), or as a PowerShell script.
If you are interested in this, then don't loose sight of the goal: we want something that we (1) "Open Developer Command Prompt" and then (2) torture tests library under various configurations.
| Need cryptest.cmd for Windows testing | https://api.github.com/repos/weidai11/cryptopp/issues/159/comments | 25 | 2016-04-24T08:07:26Z | 2018-01-12T22:22:33Z | https://github.com/weidai11/cryptopp/issues/159 | 150,638,621 | 159 |
[
"weidai11",
"cryptopp"
] | I have implemented SHA-3 digest in my hex editor (https://github.com/AndrewWPhillips/HexEdit) and test vectors return the correct results according to Crypto++/TestVectors/sha3.txt. However, these results differ from others I have seen (eg http://www.di-mgt.com.au/sha_testvectors.html) and even the result for the empty test vector on the wikipedia page (https://en.wikipedia.org/wiki/SHA-3). Am I missing something?
Also is SHA-3 to be added to the DLL? Surely if SHA-1 is FIPS 140-2 compliant then SHA-3 should be!
| SHA3 test vector results | https://api.github.com/repos/weidai11/cryptopp/issues/158/comments | 11 | 2016-04-22T08:21:09Z | 2016-09-10T22:08:41Z | https://github.com/weidai11/cryptopp/issues/158 | 150,303,440 | 158 |
[
"weidai11",
"cryptopp"
] | I'm trying to compile solution produced by CMake and have several issues with `config.h` and looks like with `.asm` implementations.
Do you support configuring through CMake for VS, or it is outdated?
| CMake configure for VS 2015 x64 creates non-buildable solution | https://api.github.com/repos/weidai11/cryptopp/issues/155/comments | 1 | 2016-04-07T08:14:24Z | 2016-04-07T10:54:40Z | https://github.com/weidai11/cryptopp/issues/155 | 146,542,458 | 155 |
[
"weidai11",
"cryptopp"
] | László Böszörményi of Debian reports a failed build under the m68k processor. Inspecting the [build log reveals](http://buildd.debian.org/status/fetch.php?pkg=libcrypto%2B%2B&arch=m68k&ver=5.6.3-4&stamp=1459687264):
```
config.h:29:3: error: #error "IS_LITTLE_ENDIAN is set, but __BYTE_ORDER__ does not equal __ORDER_LITTLE_ENDIAN__"
# error "IS_LITTLE_ENDIAN is set, but __BYTE_ORDER__ does not equal __ORDER_LITTLE_ENDIAN__"
```
The `#error` is by design and it was added after Debian broke us on S/390.
| Failed build on Debian and m68k processor | https://api.github.com/repos/weidai11/cryptopp/issues/153/comments | 1 | 2016-04-06T05:29:38Z | 2016-04-06T05:54:33Z | https://github.com/weidai11/cryptopp/issues/153 | 146,190,806 | 153 |
[
"weidai11",
"cryptopp"
] | The Crypto++ FIPS certificates have been moved to the [Historical Validation List](http://csrc.nist.gov/groups/STM/cmvp/documents/140-1/140val-historical.htm):
> After 2015, the use of the RNGs specified in FIPS 186-2, [ANSI X9.31] and the 1998 version of [ANSI X9.62] are disallowed. Therefore, all the RNG implementations that were previously validated are non-compliant, and any algorithms reliant on the output of these RNGs are also non-compliant. Modules that include an RNG as a FIPS Approved algorithm have been moved to this list. The modules on this list are not to be used for procurement by federal agencies. Please see CMVP Notice dated 11-24-2015 for more details. This does not mean that the overall FIPS-140 certificate has been revoked, rather it indicates that the certificate and the documentation posted with it do not accurately reflect how the module can be used in FIPS mode. Agencies may make a risk determination on whether to continue using the modules on this list based on their own assessment of where and when the RNG is used by the module.
>
> Vendors who would like to update their modules and have them returned to the Validated FIPS 140-1 and FIPS 140-2 Cryptographic Modules list will need to contact an accredited lab to prepare a submission package for CMVP."_
As far as I know, Crypto++ does not have vendors willing to do this.
Given the current situation, I suggest that the Crypto++ project reduce complexity and remove FIPS 140-2 support from the library.
| Crypto++ FIPS certificates moved to Historical Validation List | https://api.github.com/repos/weidai11/cryptopp/issues/149/comments | 6 | 2016-03-15T05:04:43Z | 2016-10-31T12:52:45Z | https://github.com/weidai11/cryptopp/issues/149 | 140,874,489 | 149 |
[
"weidai11",
"cryptopp"
] | New failure for Cygwin x86_64... Reported at:
- Cygwin: [Cygwin x86_64 can no longer compile a program with std=c++03](https://sourceware.org/bugzilla/show_bug.cgi?id=19817)
- GCC: [Cygwin 2.4.1 x86_64/GCC 5.3.0 can no longer compile a program with std=c++03](https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70217)
It came after the recent updates from about March 2016:
```
Testing: debug, c++03
g++ -DDEBUG -g2 -O2 -std=c++03 -Wno-deprecated-declarations -march=native -pipe -c cryptlib.cpp
In file included from /usr/lib/gcc/x86_64-pc-cygwin/5.3.0/include/c++/bits/stl_algo.h:59:0,
from /usr/lib/gcc/x86_64-pc-cygwin/5.3.0/include/c++/algorithm:62,
from stdcpp.h:13,
from cryptlib.h:87,
from cryptlib.cpp:18:
/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/include/c++/cstdlib:214:11: error: ‘::lldiv_t’ has not been declared
using ::lldiv_t;
^
/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/include/c++/cstdlib:220:11: error: ‘::_Exit’ has not been declared
using ::_Exit;
^
/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/include/c++/cstdlib:224:11: error: ‘::llabs’ has not been declared
using ::llabs;
^
/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/include/c++/cstdlib:226:10: error: ‘lldiv_t’ does not name a type
inline lldiv_t
^
/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/include/c++/cstdlib:230:11: error: ‘::lldiv’ has not been declared
using ::lldiv;
^
/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/include/c++/cstdlib:241:11: error: ‘::atoll’ has not been declared
using ::atoll;
^
/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/include/c++/cstdlib:242:11: error: ‘::strtoll’ has not been declared
using ::strtoll;
^
/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/include/c++/cstdlib:243:11: error: ‘::strtoull’ has not been declared
using ::strtoull;
^
/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/include/c++/cstdlib:245:11: error: ‘::strtof’ has not been declared
using ::strtof;
^
/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/include/c++/cstdlib:246:11: error: ‘::strtold’ has not been declared
using ::strtold;
^
/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/include/c++/cstdlib:254:22: error: ‘__gnu_cxx::lldiv_t’ has not been declared
using ::__gnu_cxx::lldiv_t;
^
/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/include/c++/cstdlib:256:22: error: ‘__gnu_cxx::_Exit’ has not been declared
using ::__gnu_cxx::_Exit;
^
/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/include/c++/cstdlib:258:22: error: ‘__gnu_cxx::llabs’ has not been declared
using ::__gnu_cxx::llabs;
^
/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/include/c++/cstdlib:259:22: error: ‘__gnu_cxx::div’ has not been declared
using ::__gnu_cxx::div;
^
/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/include/c++/cstdlib:260:22: error: ‘__gnu_cxx::lldiv’ has not been declared
using ::__gnu_cxx::lldiv;
^
/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/include/c++/cstdlib:262:22: error: ‘__gnu_cxx::atoll’ has not been declared
using ::__gnu_cxx::atoll;
^
/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/include/c++/cstdlib:263:22: error: ‘__gnu_cxx::strtof’ has not been declared
using ::__gnu_cxx::strtof;
^
/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/include/c++/cstdlib:264:22: error: ‘__gnu_cxx::strtoll’ has not been declared
using ::__gnu_cxx::strtoll;
^
/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/include/c++/cstdlib:265:22: error: ‘__gnu_cxx::strtoull’ has not been declared
using ::__gnu_cxx::strtoull;
^
/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/include/c++/cstdlib:266:22: error: ‘__gnu_cxx::strtold’ has not been declared
using ::__gnu_cxx::strtold;
^
GNUmakefile:662: recipe for target 'cryptlib.o' failed
make: *** [cryptlib.o] Error 1
ERROR: failed to make cryptest.exe
************************************
Testing: release, c++03
g++ -DNDEBUG -g2 -O2 -std=c++03 -Wno-deprecated-declarations -march=native -pipe -c cryptlib.cpp
In file included from /usr/lib/gcc/x86_64-pc-cygwin/5.3.0/include/c++/bits/stl_algo.h:59:0,
from /usr/lib/gcc/x86_64-pc-cygwin/5.3.0/include/c++/algorithm:62,
from stdcpp.h:13,
from cryptlib.h:87,
from cryptlib.cpp:18:
/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/include/c++/cstdlib:214:11: error: ‘::lldiv_t’ has not been declared
using ::lldiv_t;
^
/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/include/c++/cstdlib:220:11: error: ‘::_Exit’ has not been declared
using ::_Exit;
^
/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/include/c++/cstdlib:224:11: error: ‘::llabs’ has not been declared
using ::llabs;
^
/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/include/c++/cstdlib:226:10: error: ‘lldiv_t’ does not name a type
inline lldiv_t
^
/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/include/c++/cstdlib:230:11: error: ‘::lldiv’ has not been declared
using ::lldiv;
^
/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/include/c++/cstdlib:241:11: error: ‘::atoll’ has not been declared
using ::atoll;
^
/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/include/c++/cstdlib:242:11: error: ‘::strtoll’ has not been declared
using ::strtoll;
^
/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/include/c++/cstdlib:243:11: error: ‘::strtoull’ has not been declared
using ::strtoull;
^
/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/include/c++/cstdlib:245:11: error: ‘::strtof’ has not been declared
using ::strtof;
^
/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/include/c++/cstdlib:246:11: error: ‘::strtold’ has not been declared
using ::strtold;
^
/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/include/c++/cstdlib:254:22: error: ‘__gnu_cxx::lldiv_t’ has not been declared
using ::__gnu_cxx::lldiv_t;
^
/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/include/c++/cstdlib:256:22: error: ‘__gnu_cxx::_Exit’ has not been declared
using ::__gnu_cxx::_Exit;
^
/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/include/c++/cstdlib:258:22: error: ‘__gnu_cxx::llabs’ has not been declared
using ::__gnu_cxx::llabs;
^
/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/include/c++/cstdlib:259:22: error: ‘__gnu_cxx::div’ has not been declared
using ::__gnu_cxx::div;
^
/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/include/c++/cstdlib:260:22: error: ‘__gnu_cxx::lldiv’ has not been declared
using ::__gnu_cxx::lldiv;
^
/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/include/c++/cstdlib:262:22: error: ‘__gnu_cxx::atoll’ has not been declared
using ::__gnu_cxx::atoll;
^
/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/include/c++/cstdlib:263:22: error: ‘__gnu_cxx::strtof’ has not been declared
using ::__gnu_cxx::strtof;
^
/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/include/c++/cstdlib:264:22: error: ‘__gnu_cxx::strtoll’ has not been declared
using ::__gnu_cxx::strtoll;
^
/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/include/c++/cstdlib:265:22: error: ‘__gnu_cxx::strtoull’ has not been declared
using ::__gnu_cxx::strtoull;
^
/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/include/c++/cstdlib:266:22: error: ‘__gnu_cxx::strtold’ has not been declared
using ::__gnu_cxx::strtold;
^
GNUmakefile:662: recipe for target 'cryptlib.o' failed
make: *** [cryptlib.o] Error 1
ERROR: failed to make cryptest.exe
```
| Failed compile for Cygwin-x64 when using std=c++03 | https://api.github.com/repos/weidai11/cryptopp/issues/148/comments | 0 | 2016-03-13T08:36:19Z | 2016-04-06T15:32:14Z | https://github.com/weidai11/cryptopp/issues/148 | 140,464,751 | 148 |
[
"weidai11",
"cryptopp"
] | I found the problem when I compiled the cryptopp on Windows using llvm toolchain.
During compilation there is few warnings, but finally I was able to compile the library successfully. Unfortunately the program crashes. In my case during constructing md5 class.
The problem is with CRYPTOPP_NO_VTABLE usage in IteratedHashWithStaticTransform class.
The function Init() in IteratedHashWithStaticTransform() is virtual (Defined as virtual in IteratedHashBase class).
I reported it as bug in LLVM: https://llvm.org/bugs/show_bug.cgi?id=26905
But it is probably bug in the library.
| Building Crypto++ with Clang on Windows results in a crash when constructing MD5 class | https://api.github.com/repos/weidai11/cryptopp/issues/147/comments | 41 | 2016-03-11T15:59:10Z | 2023-09-05T13:58:04Z | https://github.com/weidai11/cryptopp/issues/147 | 140,221,137 | 147 |
[
"weidai11",
"cryptopp"
] | For both `Rijndael::Enc::ProcessAndXorBlock` and `Rijndael::Dec::ProcessAndXorBlock` there is some code to avoid timing attacks:
``` C
word32 u = 0;
#ifdef CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS
for (i=0; i<2048; i+=cacheLineSize)
#else
for (i=0; i<1024; i+=cacheLineSize)
#endif
u &= *(const word32 *)(((const byte *)Te)+i);
u &= Te[255];
s0 |= u; s1 |= u; s2 |= u; s3 |= u;
```
As far as I understand it, the goal is to do at least one read per cache line in order to preload `Te` into the cache. However when looking at the x86 binary (obtained in the [Debian package](https://packages.debian.org/jessie/libcrypto++9)), I noticed that if the loop structure remains, the memory reads have been optimized away:
``` nasm
.text:00280499 mov edx, ds:(_ZN8CryptoPP15g_cacheLineSizeE_ptr - 3A4000h)[ebx]
.text:0028049F mov ecx, [edx]
.text:002804A1 xor edx, edx
.text:002804A3 nop
.text:002804A4 lea esi, [esi+0]
.text:002804A8
.text:002804A8 loc_2804A8: ; CODE XREF: CryptoPP::Rijndael::Enc::ProcessAndXorBlock(uchar const*,uchar const*,uchar *)+D0j
.text:002804A8 add edx, ecx
.text:002804AA cmp edx, 7FFh
.text:002804B0 jbe short loc_2804A8
```
This counter measure seems to be removed by the compiler. Hence, the binary may be vulnerable to timing attacks.
| Timing Attack Counter Measure AES | https://api.github.com/repos/weidai11/cryptopp/issues/146/comments | 13 | 2016-03-11T11:00:05Z | 2017-09-17T00:40:31Z | https://github.com/weidai11/cryptopp/issues/146 | 140,155,196 | 146 |
[
"weidai11",
"cryptopp"
] | Our AEAD interface `AuthenticatedSymmetricCipherBase` (defined in `authenc.h`) doesn't support AEAD modes of operation that aren't online, i.e. offline ciphers.
For those of you, how don't know what "online" and "offline" mean in this context:
> A cipher is colled online if the encryption of the i-th input block M_i depends only on the blocks M_1,...,M_{i-1} and only constant size-state is used from the processing of one block to the next. We call an AEAD scheme online if its encryption algorithm is an online cipher and its decryption algorithm is its inverse operation. Schemes that are not online are called offline.
Now most modern ciphers are online (yay!), but there's one particularly interesting class of ciphers that are proven to be _always_ offline: _fully nonce misuse resistant authenticated encryption schemes_. If you use one of those schemes and re-use the nonce, all an attacker can tell is whether you encrypted the same message whereas with other modes the attacker can either recover keys, partial keys (the authentication key in GCM) or at least deduce information about the plaintext (the xor of the plaintexts).
Now the only place in our API where encrypted data can be given out is `ProcessData()` which also takes the input data. This works fine with online ciphers but fails with offline ciphers, as they tend to rely on the _complete_ plaintext before encryption can be started.
An example:
We can't add [GCM-SIV](https://tools.ietf.org/html/draft-gueron-gcmsiv-01) to our library because of this. GCM-SIV literally is "fully two-pass" (not "two-pass" like CCM and EAX), so you first input the AAD and the data (it performs a variation of GHASH on it), it will calculate the counter for CTR from that and then you can start to actually encrypt and output data.
The design problem:
`AuthenticatedSymmetricCipherBase` inherits from `AuthenticatedSymmetricCipher` (defined in `cryptlib.h`) which would support offline schemes if the data is supplied in one chunk via `EncryptAndAuthenticate()`. However, `AuthenticatedSymmetricCipher` also inherits from `MessageAuthenticationCode` and from `StreamTransformation` and it is the latter that brings us into trouble because it introduces the `ProcessData()` function to which `EncryptAndAuthenticate()` defaults.
The solution proposals:
1. Don't do anything and just continue life without offline AEAD schemes.
2. Add a new (independent) class in `cryptlib.h`: `AuthenticatedOfflineSymmetricCipher` that features methods to deal with two-pass schemes
3. Add a new (inherited) class in `cryptlib.h`: `AuthenticatedOfflineSymmetricCipher` that features methods to deal with two-pass schemes and inherits from `AuthenticatedSymmetricCipher`
4. Patch the existing `AuthenticatedSymmetricCipher` to add methods to deal with offline ciphers
(4) sounds like the best choice to me that would inflict the least amount of work.
Whenever I wrote "add methods to deal with it" I actually meant the following: Add a method `bool IsOnline() const` that returns true if the scheme is online, add a method `void InputPlaintext(const byte* Plaintext, const size_t Size)` (similar to `Update()`) to feed the plaintext into the scheme, add a method `void RunOfflineTransformations(bool DeferIfPossible = true)` which will do the offline operations in one run (which is maximally efficient but only done if `DeferIfPossible=false`) and which will signalise that the plaintext has been fully inputted. Finally we'd add `size_t OutputCiphertext(byte* Ciphertext, const size_t size)` which will either output the buffered encryptions (created from `RunOfflineTransformations(false)`) or will do the encryptions on-the-fly for the amount of ciphertext requested, the function will return the number of written bytes (i.e. if the return value is smaller than the requested value, then the tag can be requested).
The default behavior would be for `IsOnline()` to return `true`, for `ProcessData()` to throw if `IsOnline()==false` or work as before if `IsOnline==true`, for `InputPlaintext()` to just save the plaintext into a buffer (if `IsOnline()==true`), for `OutputCiphertext()` to just output the buffer or run the on-line encryption (if `IsOnline()==true`) and for `RunOfflineTransformations()` to do nothing if `true` is passed (besides updating state maybe?) and to run the online encryption if `false` is passed. Any cases I left unspecified here would just throw something like `not implemented`. Additionally the following (similarly named) states should be added accordingly: `State_ReceivingPlaintext`, `State_GivingCiphertext`
Impact of the changes:
- Changes to `AuthenticatedSymmetricCipher` (or adding a new class)
- Changes to `AuthenticatedSymmetricCipherBase` (or adding a new class)
- Changes to `AuthenticatedEncryptionFilter` to support `IsOnline()==false`
- Changes to `AuthenticatedDecryptionFilter` to support `IsOnline()==false`
| AEAD interface doesn't support offline AEAD algorithms | https://api.github.com/repos/weidai11/cryptopp/issues/145/comments | 4 | 2016-03-10T13:21:51Z | 2019-02-09T23:38:31Z | https://github.com/weidai11/cryptopp/issues/145 | 139,883,405 | 145 |
[
"weidai11",
"cryptopp"
] | When performing a package update. Is this a package mirror issue?
| crypto++ and crypto++-562 are in conflict | https://api.github.com/repos/weidai11/cryptopp/issues/144/comments | 4 | 2016-03-08T20:30:34Z | 2016-03-11T07:01:26Z | https://github.com/weidai11/cryptopp/issues/144 | 139,385,743 | 144 |
[
"weidai11",
"cryptopp"
] | Are there any plans to update current codebase to be able to compile as a UWP library?
I have tried to compile Cryptopp source code as UWP static library but it failed. I can get it to compile with NO_OS_DEPENDENCE macro defined but then you lose for an example a OS based random number generator.
| Support for Universal Windows Platform (UWP) | https://api.github.com/repos/weidai11/cryptopp/issues/143/comments | 38 | 2016-03-07T18:21:07Z | 2018-05-02T01:04:26Z | https://github.com/weidai11/cryptopp/issues/143 | 139,052,330 | 143 |
[
"weidai11",
"cryptopp"
] | In file validat1.cpp, line 890 the following code needs to be changed
from:
`#if NO_OS_DEPENDENCE`
to:
`#ifdef NO_OS_DEPENDENCE`
The reason is that in `config.h` when `NO_OS_DEPENDENCE` is defined, it is not set to anything, so during compilation of `validat1.cpp`, the preprocessor does not have a value to use.
| File validat1.cpp compilation issue with NO_OS_DEPENDENCE defined | https://api.github.com/repos/weidai11/cryptopp/issues/141/comments | 3 | 2016-03-01T18:57:48Z | 2016-03-04T16:35:29Z | https://github.com/weidai11/cryptopp/issues/141 | 137,656,466 | 141 |
[
"weidai11",
"cryptopp"
] | Hi, I get an error while trying to compile cryptopp (tag CRYPTOPP_5_6_3)
```
rdrand.cpp: In function ‘int CryptoPP::ALL_RSI_GenerateBlock(byte*, size_t, unsigned int)’:
rdrand.cpp:360:37: error: ‘_rdseed64_step’ was not declared in this scope
if (_rdseed64_step((word64*)output))
^
rdrand.cpp:378:26: error: ‘_rdseed64_step’ was not declared in this scope
if (_rdseed64_step(&val))
^
make: *** [rdrand.o] Error 1
```
```
$ g++ --version
g++ (Ubuntu 4.8.4-2ubuntu1~14.04.1) 4.8.4
$ uname -a
Linux 4.2.0-25-generic #30~14.04.1-Ubuntu SMP Mon Jan 18 16:25:56 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
```
I have found the same bug here https://www.spinics.net/lists/gcchelp/msg44760.html
The fix, that worked for me:
```
$ git diff --no-ext-diff
diff --git a/rdrand.h b/rdrand.h
index fc2b77b..8c9a95a 100644
--- a/rdrand.h
+++ b/rdrand.h
@@ -8,6 +8,7 @@
#ifndef CRYPTOPP_RDRAND_H
#define CRYPTOPP_RDRAND_H
+#include <x86intrin.h>
#include "cryptlib.h"
// This file (and friends) provides both RDRAND and RDSEED, but its somewhat
```
| Compile error: ‘_rdseed64_step’ was not declared in this scope | https://api.github.com/repos/weidai11/cryptopp/issues/140/comments | 2 | 2016-02-26T15:48:14Z | 2016-02-29T10:13:10Z | https://github.com/weidai11/cryptopp/issues/140 | 136,732,295 | 140 |
[
"weidai11",
"cryptopp"
] | I haven't found this in issue list. Two years ago [Intel announced new assembler instructions, that could assist computing SHA-1 and SHA-256](https://software.intel.com/en-us/articles/intel-sha-extensions). There are not much Skylake CPU's on the market, but all new Intel processors will support these instructions as well. Is there any way to support such hardware acceleration? (I am not an assembler guy, so I can't make a PR)
| Support for CPU instructions for hardware-accelerated SHA | https://api.github.com/repos/weidai11/cryptopp/issues/139/comments | 10 | 2016-02-21T04:24:54Z | 2018-05-19T08:46:06Z | https://github.com/weidai11/cryptopp/issues/139 | 135,158,088 | 139 |
[
"weidai11",
"cryptopp"
] | This issue was reported on the mailing list at [Trying to do CMAC on VS2013 and found this error. "Assertion failed: (input && length) || !(input || length), file cmac.cpp, line 60"](https://groups.google.com/d/msg/cryptopp-users/TeO-6YPuvBg/Z6rxT6K5EQAJ). The following program causes an assert to fire:
```
SecByteBlock key(AES::DEFAULT_KEYLENGTH);
prng.GenerateBlock(key, key.size());
string plain = "CMAC Test";
string mac, encoded;
...
CMAC< AES > cmac(key.data(), key.size());
StringSource ss2(plain, true,
new HashFilter(cmac,
new StringSink(mac)
) // HashFilter
); // StringSource
```
| Assert when running CMAC example on the wiki | https://api.github.com/repos/weidai11/cryptopp/issues/138/comments | 1 | 2016-02-21T03:44:35Z | 2016-02-21T03:49:41Z | https://github.com/weidai11/cryptopp/issues/138 | 135,155,204 | 138 |
[
"weidai11",
"cryptopp"
] | Testing under Cygwin x64, version 2.4.1:
```
wait.h:193.2: error: 'fd_set' does not name a type
```
GCC is 5.3.0.
| 'fd_set does not name a type' under Cygwin x64 | https://api.github.com/repos/weidai11/cryptopp/issues/137/comments | 3 | 2016-02-15T05:01:01Z | 2016-06-13T04:29:42Z | https://github.com/weidai11/cryptopp/issues/137 | 133,623,619 | 137 |
[
"weidai11",
"cryptopp"
] | Change `${CMAKE_SOURCE_DIR}` to `${CMAKE_CURRENT_SOURCE_DIR}`.
| Change Cmake path variable to current dir | https://api.github.com/repos/weidai11/cryptopp/issues/135/comments | 1 | 2016-02-10T20:58:46Z | 2016-06-22T13:12:29Z | https://github.com/weidai11/cryptopp/issues/135 | 132,816,007 | 135 |
[
"weidai11",
"cryptopp"
] | This is not a bug of crypto++ but rather a configuration issue in the files setenv-embedded.sh and GNUmakefile-cross. There is an `ARM_EMBEDDED_SYSROOT` setting which should not be used when cross-compiling on Linux (e.g. on desktop Ubuntu) for BeagleBone Black.
The issue is described at [Linking error when compiling crypto++ for armhf](http://stackoverflow.com/questions/31698241/linking-error-when-compiling-crypto-for-armhf), and I posted an answer on that webpage.
My solution was simply to remove the `--sysroot` option from line 68 in the file GNUmakefile-cross. My solution is not ideal, of course. It is just a shortcut.
| setenv-embedded.sh and GNUmakefile-cross | https://api.github.com/repos/weidai11/cryptopp/issues/134/comments | 2 | 2016-02-10T00:16:32Z | 2016-02-12T04:48:58Z | https://github.com/weidai11/cryptopp/issues/134 | 132,574,900 | 134 |
[
"weidai11",
"cryptopp"
] | Any plans for installing a .pc along with cryptopp?
Right now I see the following:
- distributions like Debian install their own, including maintaining an autoconf buildsystem to do that.
- master contains a cmake buildsystem, that installs a .cmake, which helps packages using cmake find cryptopp, but doesn't help any others
| Provide & install a pkg-config file | https://api.github.com/repos/weidai11/cryptopp/issues/133/comments | 8 | 2016-02-07T14:24:04Z | 2018-05-04T00:17:24Z | https://github.com/weidai11/cryptopp/issues/133 | 131,971,723 | 133 |
[
"weidai11",
"cryptopp"
] | The cleanup of `CRYPTOPP_GENERATE_X64_MASM` (see commits d55d7fe90a80e3cd3202b5963e0d613e2df0824d and 58ed2fcd370523ed101715f57b0926d7dd8ac622) revealed `Rijndael::Enc::AdvancedProcessBlocks` experiences a hang with `AliasedWithTable`. The issue is present on Linux, OS X and Windows with SSE2 ASM using aligned data. It can be duplicated with `#define CRYPTOPP_NO_UNALIGNED_DATA_ACCESS` and `#define CRYPTOPP_DISABLE_SSSE3`.
From `rijndael.cpp` (near [line 1205](https://www.cryptopp.com/docs/ref/rijndael_8cpp_source.html#l01207)):
```
1230 const byte* zeros = (byte *)(Te+256);
1231 byte *space;
1232
1233 do {
1234 // https://msdn.microsoft.com/en-us/library/5471dc8s.aspx
1235 #if (CRYPTOPP_MSC_VERSION >= 1400)
1236 space = (byte *)_malloca(255+sizeof(Locals));
1237 space += (256-(size_t)space%256)%256;
1238 #else
1239 space = (byte *)alloca(255+sizeof(Locals));
1240 space += (256-(size_t)space%256)%256;
1241 #endif
1242 }
1243 while (AliasedWithTable(space, space+sizeof(Locals)));
```
These gyrations appear to align the pointer on a 0x100 boundary:
```
1239 space = (byte *)alloca(255+sizeof(Locals));
1240 space += (256-(size_t)space%256)%256;
```
When misbehaving the function `AliasedWithTable` never returns false (near [line 1015](http://www.cryptopp.com/docs/ref/rijndael_8cpp_source.html#l01013)):
```
1016 static inline bool AliasedWithTable(const byte *begin, const byte *end)
1017 {
1018 size_t s0 = size_t(begin)%4096, s1 = size_t(end)%4096;
1019 size_t t0 = size_t(Te)%4096, t1 = (size_t(Te)+sizeof(Te))%4096;
1020 if (t1 > t0)
1021 return (s0 >= t0 && s0 < t1) || (s1 > t0 && s1 <= t1);
1022 else
1023 return (s0 < t1 || s1 <= t1) || (s0 >= t0 || s1 > t0);
1024 }
```
A test against the Crypto++ 5.6.2 shows the issue is present there, also. To duplicate under 5.6.2, uncomment `CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS` in `config.h` and add the code from [Commit c8de423a](http://github.com/weidai11/cryptopp/commit/c8de423ab5a1eda7c6b5bd36aa323f1996486547).
---
Here's a quick trace with some instrumentation to dump the variables. Its using `CRYPTOPP_NO_UNALIGNED_DATA_ACCESS`.
```
space: 0x7fff5f526f40, space: 0x7fff5f527000, locals: 312
s0: 0, s1: 138
t0: 3b0, t1: 3b0
space: 0x7fff5f526d00, space: 0x7fff5f526d00, locals: 312
s0: d00, s1: e38
t0: 3b0, t1: 3b0
space: 0x7fff5f526ac0, space: 0x7fff5f526b00, locals: 312
s0: b00, s1: c38
t0: 3b0, t1: 3b0
space: 0x7fff5f526880, space: 0x7fff5f526900, locals: 312
s0: 900, s1: a38
t0: 3b0, t1: 3b0
space: 0x7fff5f526640, space: 0x7fff5f526700, locals: 312
s0: 700, s1: 838
t0: 3b0, t1: 3b0
space: 0x7fff5f526400, space: 0x7fff5f526400, locals: 312
s0: 400, s1: 538
t0: 3b0, t1: 3b0
space: 0x7fff5f5261c0, space: 0x7fff5f526200, locals: 312
s0: 200, s1: 338
t0: 3b0, t1: 3b0
space: 0x7fff5f525f80, space: 0x7fff5f526000, locals: 312
s0: 0, s1: 138
t0: 3b0, t1: 3b0
space: 0x7fff5f525d40, space: 0x7fff5f525e00, locals: 312
s0: e00, s1: f38
t0: 3b0, t1: 3b0
space: 0x7fff5f525b00, space: 0x7fff5f525b00, locals: 312
s0: b00, s1: c38
t0: 3b0, t1: 3b0
...
space: 0x7fff5ed2b1c0, space: 0x7fff5ed2b200, locals: 312
s0: 200, s1: 338
t0: 3b0, t1: 3b0
space: 0x7fff5ed2af80, space: 0x7fff5ed2b000, locals: 312
s0: 0, s1: 138
t0: 3b0, t1: 3b0
space: 0x7fff5ed2ad40, space: 0x7fff5ed2ae00, locals: 312
s0: e00, s1: f38
t0: 3b0, t1: 3b0
space: 0x7fff5ed2ab00, space: 0x7fff5ed2ab00, locals: 312
s0: b00, s1: c38
t0: 3b0, t1: 3b0
Segmentation fault: 11
```
| Hang in Rijndael's Enc::AdvancedProcessBlocks and AliasedWithTable | https://api.github.com/repos/weidai11/cryptopp/issues/132/comments | 2 | 2016-02-06T01:27:49Z | 2016-09-10T17:33:36Z | https://github.com/weidai11/cryptopp/issues/132 | 131,803,425 | 132 |
[
"weidai11",
"cryptopp"
] | Hi, simple program that attempts to calculate SHA-3 hash compiles and links without any warnings but then crashes. Here's the code:
```
byte* digest; //resulting hash
SHA3 hash = SHA3(512);
try
{
hash.CalculateDigest( digest, (const byte*) message.c_str(), (size_t)message.length() );
}
catch (const exception &ex)
{ cerr << "CalcDigest: " << ex.what() << endl;}
```
Gdg shows the following:
```
Program received signal SIGSEGV, Segmentation fault.
0x000000000049d61b in CryptoPP::SHA3::TruncatedFinal (this=0x7fffffffd8b0,
hash=0x0, size=512) at sha3.cpp:284
```
As it designed now method CalculateDigest returns void which makes it difficult to understand the problem. Using try catch does NOT help. It might be a good idea to use return error codes instead of void. This is already second submission of this but. First one was simply removed by someone without answering the question.
| SHA-3 CalculateDigest results in Segmentation fault | https://api.github.com/repos/weidai11/cryptopp/issues/130/comments | 11 | 2016-02-01T09:39:18Z | 2016-02-03T00:56:42Z | https://github.com/weidai11/cryptopp/issues/130 | 130,310,200 | 130 |
[
"weidai11",
"cryptopp"
] | Do you plan to add nuget packages for msvc builds?
| Nuget packages | https://api.github.com/repos/weidai11/cryptopp/issues/129/comments | 2 | 2016-01-30T08:25:31Z | 2016-01-30T19:21:12Z | https://github.com/weidai11/cryptopp/issues/129 | 129,956,579 | 129 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.