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"
] | From [Problem building Crypto++ with C++Builder XE5 - EMBARCADERO - RAD Studio 12.0](https://groups.google.com/forum/#!topic/cryptopp-users/QGJNGD-2Pgs):
> ```
> nbtheory.cpp(1026,90): error E2268: E2268 Call to undefined function 'log'
> nbtheory.cpp(1033,90): error E2268: E2268 Call to undefined function 'log'
>
> [bcc32 Fatal Error] adhoc.cpp(1): F1009 Unable to open input file 'adhoc.cpp'
>
> [TLIB Warning] Warning: library was too large for page size, rebuilt with page size 1024
> ```
>
> But I got a lot of errors when I build the .exe
>
> ```
> [bcc32 Error] bench1.cpp(64): E2268 Call to undefined function 'log'
> [bcc32 Error] bench1.cpp(100): E2268 Call to undefined function 'log'
> [bcc32 Warning] bench1.cpp(407): W8012 Comparing signed and unsigned values
> [bcc32 Error] factory.h(104): E2040 Declaration terminated incorrectly
> [bcc32 Error] factory.h(105): E2451 Undefined symbol 's_registry'
> [bcc32 Error] factory.h(105): E2357 Reference initialized with 'undefined', needs lvalue of type 'ObjectFactoryRegistry<RandomNumberGenerator,0>'
> [bcc32 Error] factory.h(104): E2040 Declaration terminated incorrectly
> [bcc32 Error] factory.h(105): E2451 Undefined symbol 's_registry'
> [bcc32 Error] factory.h(105): E2357 Reference initialized with 'undefined', needs lvalue of type 'ObjectFactoryRegistry<NIST_DRBG,0>'
> [bcc32 Error] factory.h(104): E2040 Declaration terminated incorrectly
> [bcc32 Error] factory.h(105): E2451 Undefined symbol 's_registry'
> [bcc32 Error] factory.h(105): E2357 Reference initialized with 'undefined', needs lvalue of type 'ObjectFactoryRegistry<HashTransformation,0>'
> [bcc32 Error] factory.h(104): E2040 Declaration terminated incorrectly
> [bcc32 Error] factory.h(105): E2451 Undefined symbol 's_registry'
> [bcc32 Error] factory.h(105): E2357 Reference initialized with 'undefined', needs lvalue of type 'ObjectFactoryRegistry<AuthenticatedSymmetricCipher,0>'
> [bcc32 Error] factory.h(104): E2040 Declaration terminated incorrectly
> [bcc32 Error] factory.h(105): E2451 Undefined symbol 's_registry'
> [bcc32 Error] factory.h(105): E2357 Reference initialized with 'undefined', needs lvalue of type 'ObjectFactoryRegistry<MessageAuthenticationCode,0>'
> [bcc32 Error] factory.h(104): E2040 Declaration terminated incorrectly
> [bcc32 Error] factory.h(105): E2451 Undefined symbol 's_registry'
> [bcc32 Error] factory.h(105): E2357 Reference initialized with 'undefined', needs lvalue of type ObjectFactoryRegistry<SymmetricCipher,0>'
> ``` | Borland and "E2268 Call to undefined function log" | https://api.github.com/repos/weidai11/cryptopp/issues/520/comments | 2 | 2017-10-12T17:27:45Z | 2017-12-30T16:30:48Z | https://github.com/weidai11/cryptopp/issues/520 | 265,023,553 | 520 |
[
"weidai11",
"cryptopp"
] | Google is displaying a "Banned Content" for our group at http://groups.google.com/forum/#!forum/cryptopp-users. We don't know why it was banned or how to fix it. Google did not tell us what was wrong or the offending content; and they did not tell us how to fix it. The group's messages in my Inbox are not offensive by any stretch of the imagination.
We have been through Google's Help Pages, followed some articles and then submitted feedback in the "No, this did not help" box. We also tried to contact Google though their Contacts page. But I doubt that's going to be enough to fix the problem. Google is using those endless-labyrinth-of-webpages-that-lead-to-nowhere to avoid us talking to someone or getting real help from the company.
I've opened a question on the Web Apps stack exchange at [How to view list of offensive items in Banned Google Group?](https://webapps.stackexchange.com/q/110690/72479) It attempts to gather more information about what is going on and how to fix it since Google is not providing information or a contact to learn more.
If anyone has a contact at Google so we can actually talk to someone or really report the problem, then please email me at ***noloader, gmail*** account.
| Google Group is down | https://api.github.com/repos/weidai11/cryptopp/issues/519/comments | 2 | 2017-10-11T21:45:29Z | 2017-10-12T17:24:30Z | https://github.com/weidai11/cryptopp/issues/519 | 264,746,439 | 519 |
[
"weidai11",
"cryptopp"
] | This issue is a follow up to #113 - Add support for EC-GDSA and EC-KCDSA - specifically about the support of EC-KCDSA after the implementation of EC-GDSA. | Add support for EC Korean Certificate DSA (EC-KCDSA) | https://api.github.com/repos/weidai11/cryptopp/issues/518/comments | 0 | 2017-10-07T21:45:46Z | 2017-10-07T22:01:25Z | https://github.com/weidai11/cryptopp/issues/518 | 263,674,319 | 518 |
[
"weidai11",
"cryptopp"
] | See [Is SHA3 supported with RSASSA signature?](http://groups.google.com/forum/#!topic/cryptopp-users/os_HzBmPDNs) on the mailing list.
Also see:
* NIST's [Secure Hash Algorithms Registered Objects](https://csrc.nist.gov/projects/computer-security-objects-register/algorithm-registration#Hash)
* NIST's [RSA PKCS #1 v1.5 Signature with SHA-3 family](https://csrc.nist.gov/projects/computer-security-objects-register/algorithm-registration)
* [RFC 4055, Additional Algorithms and Identifiers for RSA Cryptography...](https://www.rfc-editor.org/rfc/rfc4055.txt)
* [SHA3 algorithm ids](https://www.ietf.org/mail-archive/web/openpgp/current/msg08259.html) (OpenPGP mailing list)
* [The use of Secure Hash Algorithm 3 in OpenPGP](https://www.ietf.org/archive/id/draft-jivsov-openpgp-sha3-01.txt)
The last provides the full hash prefix for SHA3-256, SHA3-384 and SHA-512. OpenPGP declined to provide SHA3-224. | Add SHA3 OIDs for signature schemes | https://api.github.com/repos/weidai11/cryptopp/issues/517/comments | 1 | 2017-10-04T13:33:49Z | 2017-10-05T04:07:09Z | https://github.com/weidai11/cryptopp/issues/517 | 262,789,182 | 517 |
[
"weidai11",
"cryptopp"
] | I am getting this error:
CMakeFiles/Athena.dir/Startup/main.cpp.o: In function `CryptoPP::ClonableImpl<CryptoPP::BlockCipherFinal<(CryptoPP::CipherDir)0, CryptoPP::Rijndael::Enc>, CryptoPP::Rijndael::Enc>::ClonableImpl()':
/home/dev/workspace/Athena/lib/cryptopp/simple.h:26: undefined reference to `CryptoPP::Rijndael::Enc::Enc()'
collect2: error: ld returned 1 exit status
CMakeFiles/Athena.dir/build.make:434: recipe for target 'Athena'
when I try to link CryptoPP to my programm.
This is my CMakeLists.txt:
cmake_minimum_required(VERSION 3.8)
project(Athena)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread -fpermissive -Wno-deprecated -Wno-int-to-pointer-cast -Wno-deprecated-declarations")
include_directories(lib/SQLiteCpp/include)
add_subdirectory(lib/SQLiteCpp)
include_directories(lib/cryptopp)
add_subdirectory(lib/cryptopp)
include_directories(lib/json/src)
add_subdirectory(lib/json)
set(SOURCE_FILES
Startup/main.cpp)
add_executable(Athena ${SOURCE_FILES})
target_link_libraries(Athena SQLiteCpp sqlite3 pthread dl cryptopp)
Here are my includes:
```cpp
#include "modes.h" // For CTR_Mode
#include "filters.h" //For StringSource
#include "aes.h" // For AES
```
I already tried linking cryptopp by find_package, by find_library and I even tried writing a script to download and make cryptopp manually. I am really out of ideas and I´m also pretty sure that it´s not my code (I pasted in an example from the cryptopp wiki). | CMake throws exception because of undefined reference in CryptoPP | https://api.github.com/repos/weidai11/cryptopp/issues/516/comments | 2 | 2017-10-04T11:02:22Z | 2017-10-04T12:12:33Z | https://github.com/weidai11/cryptopp/issues/516 | 262,747,025 | 516 |
[
"weidai11",
"cryptopp"
] | This is a change control item. We will use it to track the addition of OCB mode. | Add OCB mode | https://api.github.com/repos/weidai11/cryptopp/issues/515/comments | 3 | 2017-09-29T07:44:11Z | 2021-08-27T23:05:25Z | https://github.com/weidai11/cryptopp/issues/515 | 261,557,492 | 515 |
[
"weidai11",
"cryptopp"
] | in distclean it have the rm -rf $(DOCUMENT...) it will delete other application data but it have no permission so it will show a lot of message. is it normal? | mac GNUmakefile-cross distclean is some unknown action | https://api.github.com/repos/weidai11/cryptopp/issues/514/comments | 1 | 2017-09-25T14:47:39Z | 2017-09-26T05:08:30Z | https://github.com/weidai11/cryptopp/issues/514 | 260,304,215 | 514 |
[
"weidai11",
"cryptopp"
] | This is a change control item. We will use it to track Power8 hashing using PPC built-ins.
Power8 header support: [1057f893631c](http://github.com/weidai11/cryptopp/commit/1057f893631c)
Add SHA to header: [8b2bf5ed88c3](http://github.com/weidai11/cryptopp/commit/8b2bf5ed88c3) | Add Power8 SHA Hashing | https://api.github.com/repos/weidai11/cryptopp/issues/513/comments | 1 | 2017-09-22T11:49:20Z | 2018-03-11T16:46:18Z | https://github.com/weidai11/cryptopp/issues/513 | 259,789,982 | 513 |
[
"weidai11",
"cryptopp"
] | Although the compiler is set to clang, the normal generated cryptlib.lib file, but wrote a simple test procedures:
~~~
#include <iostream>
#include <cryptopp/hex.h>
#include <cryptopp/filters.h>
#include <cryptopp/files.h>
#pragma link "cryptlib.lib"
using namespace std;
using namespace CryptoPP;
int main(int argc, char* argv[])
{
StringSource("abcdefg", true, new HexEncoder(new FileSink(cout)));
cin.get();
return 0;
}
~~~
After compiling the link, the following error occurs after running the program:

When I do not have cryptlib.lib, but directly include hex.cpp filters.cpp ... and other necessary source files, the test program is running normally.
It seems that BCB in the clang mode to compile the cryptlib.lib is a problem.
Since the clang mode is not normal, then re-return to the traditional model of non-clang try again, extract bds10.zip, with bcb2010 compiler, originally thought that will be compiled through the normal, but before and in bcb xe10 compiled below the error reported same.
So the source code has been modified, with patch:
~~~
config.h | 2 +-
randpool.cpp | 3 +--
rng.cpp | 2 +-
sha3.h | 2 +-
4 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/config.h b/config.h
index 6e0f2fb..bf82948 100644
--- a/config.h
+++ b/config.h
@@ -658,7 +658,7 @@ NAMESPACE_END
#endif
// How to declare class constants
-#if defined(CRYPTOPP_DOXYGEN_PROCESSING)
+#if defined(CRYPTOPP_DOXYGEN_PROCESSING) || defined(__BORLANDC__) && !defined(__clang__)
# define CRYPTOPP_CONSTANT(x) static const int x;
#else
# define CRYPTOPP_CONSTANT(x) enum {x};
diff --git a/randpool.cpp b/randpool.cpp
index 974760b..707d05f 100644
--- a/randpool.cpp
+++ b/randpool.cpp
@@ -18,8 +18,7 @@
#include "mdc.h"
#include "modes.h"
-#include <ctime>
-
+#include <time.h>
NAMESPACE_BEGIN(CryptoPP)
RandomPool::RandomPool()
diff --git a/rng.cpp b/rng.cpp
index c176397..81661c2 100644
--- a/rng.cpp
+++ b/rng.cpp
@@ -5,7 +5,7 @@
#include "rng.h"
#include "fips140.h"
-#include <ctime>
+#include <time.h>
#include <cmath>
NAMESPACE_BEGIN(CryptoPP)
diff --git a/sha3.h b/sha3.h
index 86dfeed..5aae9b4 100644
--- a/sha3.h
+++ b/sha3.h
@@ -67,7 +67,7 @@ public:
static std::string StaticAlgorithmName() { return "SHA3-" + IntToString(DIGESTSIZE * 8); }
unsigned int BlockSize() const { return BLOCKSIZE; }
private:
- CRYPTOPP_COMPILE_ASSERT(BLOCKSIZE < 200); // ensure there was no underflow in the math
+ CRYPTOPP_COMPILE_ASSERT(BLOCKSIZE <= 200); // ensure there was no underflow in the math
CRYPTOPP_COMPILE_ASSERT(BLOCKSIZE > (int)T_DigestSize); // this is a general expectation by HMAC
};
~~~
And then in bcb2010 and bcb xe10 can be compiled in the normal, and compile and run the test program is also normal.
In bcb2010 need to change ctime to time.h, in bcb xe10 do not need to change
The previous error report is mainly caused by the following two lines
~~~
#if defined(CRYPTOPP_DOXYGEN_PROCESSING)
CRYPTOPP_COMPILE_ASSERT(BLOCKSIZE < 200);
~~~
Changed to
~~~
#if defined(CRYPTOPP_DOXYGEN_PROCESSING) || defined(__BORLANDC__) && !defined(__clang__)
CRYPTOPP_COMPILE_ASSERT(BLOCKSIZE <= 200);
~~~
Before the error reports are gone.
Please look at < change to <= is it possible?
| borland | https://api.github.com/repos/weidai11/cryptopp/issues/512/comments | 4 | 2017-09-20T18:30:24Z | 2017-10-11T03:38:37Z | https://github.com/weidai11/cryptopp/issues/512 | 259,259,174 | 512 |
[
"weidai11",
"cryptopp"
] | As suggested in https://github.com/monero-project/kovri/issues/699, though I'm unsure of the scope (any/all SIGILL probing?). | Create CRYPTOPP_NO_CPU_FEATURE_PROBES to disable SIGILL probes | https://api.github.com/repos/weidai11/cryptopp/issues/511/comments | 5 | 2017-09-19T22:51:30Z | 2017-09-20T18:41:16Z | https://github.com/weidai11/cryptopp/issues/511 | 258,988,322 | 511 |
[
"weidai11",
"cryptopp"
] | In v5.6.5 I'm getting the warning that ECIES struct has been deprecated. Is there any replacement? | ECIES is deprecated | https://api.github.com/repos/weidai11/cryptopp/issues/510/comments | 3 | 2017-09-19T08:15:41Z | 2017-09-19T14:03:02Z | https://github.com/weidai11/cryptopp/issues/510 | 258,733,320 | 510 |
[
"weidai11",
"cryptopp"
] | ```
$ source ./setenv-android.sh armeabi llvm
ANDROID_NDK_ROOT: /home/mbabienco/android-ndk-r15c/
AOSP_TOOLCHAIN_PATH: /home/mbabienco/android-ndk-r15c//toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin
AOSP_ABI: armeabi
AOSP_API: android-21
AOSP_SYSROOT: /home/[username]/android-ndk-r15c//platforms/android-21/arch-arm
AOSP_FLAGS: -march=armv5te -mtune=xscale -mthumb -msoft-float -funwind-tables -fexceptions -frtti
AOSP_STL_INC: /home/[username]/android-ndk-r15c//sources/cxx-stl/llvm-libc++/include
AOSP_STL_LIB: /home/[username]/android-ndk-r15c//sources/cxx-stl/llvm-libc++/libs/armeabi/libc++_shared.so
CPU FEATURES: cpu-features.h and cpu-features.c are present
*******************************************************************************
You are using LLVM's runtime and STL library. LLVM could cause problems
if the resulting binary is used in other environments, like a QT project.
Also see http://code.google.com/p/android/issues/detail?id=216331
*******************************************************************************
*******************************************************************************
It looks the the environment is set correctly. Your next step is build
the library with 'make -f GNUmakefile-cross'. You can create a versioned
shared object using 'HAS_SOLIB_VERSION=1 make -f GNUmakefile-cross'
*******************************************************************************
$ make -f GNUmakefile-cross
arm-linux-androideabi-g++ -DNDEBUG -g2 -O3 -fPIC -pipe -march=armv5te -mtune=xscale -mthumb -msoft-float -funwind-tables -fexceptions -frtti -DANDROID --sysroot=/home/[username]/android-ndk-r15c//platforms/android-21/arch-arm -Wa,--noexecstack -I/home/[username]/android-ndk-r15c//sources/cxx-stl/llvm-libc++/include -c aria-simd.cpp
In file included from aria-simd.cpp:14:0:
/home/[username]/android-ndk-r15c/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/include/arm_neon.h:31:2: error: #error You must enable NEON instructions (e.g. -mfloat-abi=softfp -mfpu=neon) to use arm_neon.h
#error You must enable NEON instructions (e.g. -mfloat-abi=softfp -mfpu=neon) to use arm_neon.h
^
aria-simd.cpp:44:34: error: 'uint32x4_t' does not name a type
inline void ARIA_GSRK_NEON(const uint32x4_t X, const uint32x4_t Y, byte RK[16])
^
aria-simd.cpp:44:54: error: 'uint32x4_t' does not name a type
inline void ARIA_GSRK_NEON(const uint32x4_t X, const uint32x4_t Y, byte RK[16])
^
aria-simd.cpp: In function 'void CryptoPP::ARIA_GSRK_NEON(int, int, CryptoPP::byte*)':
aria-simd.cpp:52:34: error: there are no arguments to 'vextq_u32' that depend on a template parameter, so a declaration of 'vextq_u32' must be available [-fpermissive]
vshrq_n_u32(vextq_u32(Y, Y, Q1), R),
^
aria-simd.cpp:52:34: note: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)
aria-simd.cpp:53:34: error: there are no arguments to 'vextq_u32' that depend on a template parameter, so a declaration of 'vextq_u32' must be available [-fpermissive]
vshlq_n_u32(vextq_u32(Y, Y, Q2), 32-R))));
^
aria-simd.cpp: In function 'void CryptoPP::ARIA_UncheckedSetKey_Schedule_NEON(CryptoPP::byte*, CryptoPP::word32*, unsigned int)':
aria-simd.cpp:58:8: error: 'uint32x4_t' does not name a type
const uint32x4_t w0 = vld1q_u32((const uint32_t*)(ws+ 0));
^
aria-simd.cpp:59:8: error: 'uint32x4_t' does not name a type
const uint32x4_t w1 = vld1q_u32((const uint32_t*)(ws+ 8));
^
aria-simd.cpp:60:8: error: 'uint32x4_t' does not name a type
const uint32x4_t w2 = vld1q_u32((const uint32_t*)(ws+12));
^
aria-simd.cpp:61:8: error: 'uint32x4_t' does not name a type
const uint32x4_t w3 = vld1q_u32((const uint32_t*)(ws+16));
^
aria-simd.cpp:63:21: error: 'w0' was not declared in this scope
ARIA_GSRK_NEON<19>(w0, w1, rk + 0);
^
aria-simd.cpp:63:25: error: 'w1' was not declared in this scope
ARIA_GSRK_NEON<19>(w0, w1, rk + 0);
^
aria-simd.cpp:64:25: error: 'w2' was not declared in this scope
ARIA_GSRK_NEON<19>(w1, w2, rk + 16);
^
aria-simd.cpp:65:25: error: 'w3' was not declared in this scope
ARIA_GSRK_NEON<19>(w2, w3, rk + 32);
^
aria-simd.cpp: In function 'void CryptoPP::ARIA_ProcessAndXorBlock_Xor_NEON(const byte*, CryptoPP::byte*)':
aria-simd.cpp:93:56: error: 'vld1q_u32' was not declared in this scope
vld1q_u32(reinterpret_cast<const uint32_t*>(outBlock)),
^
aria-simd.cpp:94:57: error: 'veorq_u32' was not declared in this scope
vld1q_u32(reinterpret_cast<const uint32_t*>(xorBlock))));
^
aria-simd.cpp:94:58: error: 'vst1q_u32' was not declared in this scope
vld1q_u32(reinterpret_cast<const uint32_t*>(xorBlock))));
^
GNUmakefile-cross:355: recipe for target 'aria-simd.o' failed
make: *** [aria-simd.o] Error 1
```
Note that this also happens with armeabi-v7a. | GNUmakefile-cross: armeabi errors | https://api.github.com/repos/weidai11/cryptopp/issues/509/comments | 4 | 2017-09-17T18:59:49Z | 2017-09-29T13:52:24Z | https://github.com/weidai11/cryptopp/issues/509 | 258,325,035 | 509 |
[
"weidai11",
"cryptopp"
] | ```
$ source ./setenv-android.sh x86 llvm
ANDROID_NDK_ROOT: /home/[username]/android-ndk-r15c/
AOSP_TOOLCHAIN_PATH: /home/[username]/android-ndk-r15c//toolchains/x86-4.9/prebuilt/linux-x86_64/bin
AOSP_ABI: x86
AOSP_API: android-21
AOSP_SYSROOT: /home/[username]/android-ndk-r15c//platforms/android-21/arch-x86
AOSP_FLAGS: -mtune=intel -mssse3 -mfpmath=sse -funwind-tables -fexceptions -frtti
AOSP_STL_INC: /home/[username]/android-ndk-r15c//sources/cxx-stl/llvm-libc++/include
AOSP_STL_LIB: /home/[username]/android-ndk-r15c//sources/cxx-stl/llvm-libc++/libs/x86/libc++_shared.so
CPU FEATURES: cpu-features.h and cpu-features.c are present
*******************************************************************************
You are using LLVM's runtime and STL library. LLVM could cause problems
if the resulting binary is used in other environments, like a QT project.
Also see http://code.google.com/p/android/issues/detail?id=216331
*******************************************************************************
*******************************************************************************
It looks the the environment is set correctly. Your next step is build
the library with 'make -f GNUmakefile-cross'. You can create a versioned
shared object using 'HAS_SOLIB_VERSION=1 make -f GNUmakefile-cross'
*******************************************************************************
...
i686-linux-android-g++ -DNDEBUG -g2 -O3 -fPIC -pipe -mtune=intel -mssse3 -mfpmath=sse -funwind-tables -fexceptions -frtti -DANDROID --sysroot=/home/[username]/android-ndk-r15c//platforms/android-21/arch-x86 -Wa,--noexecstack -I/home/[username]/android-ndk-r15c//sources/cxx-stl/llvm-libc++/include -c blake2-simd.cpp
In file included from /home/[username]/android-ndk-r15c/toolchains/x86-4.9/prebuilt/linux-x86_64/lib/gcc/i686-linux-android/4.9.x/include/nmmintrin.h:31:0,
from blake2-simd.cpp:16:
/home/[username]/android-ndk-r15c/toolchains/x86-4.9/prebuilt/linux-x86_64/lib/gcc/i686-linux-android/4.9.x/include/smmintrin.h: In function 'void CryptoPP::BLAKE2_Compress32_SSE4(const byte*, CryptoPP::BLAKE2_State<unsigned int, false>&)':
/home/[username]/android-ndk-r15c/toolchains/x86-4.9/prebuilt/linux-x86_64/lib/gcc/i686-linux-android/4.9.x/include/smmintrin.h:166:1: error: inlining failed in call to always_inline '__m128i _mm_blend_epi16(__m128i, __m128i, int)': target specific option mismatch
_mm_blend_epi16 (__m128i __X, __m128i __Y, const int __M)
^
blake2-simd.cpp:134:37: error: called from here
t0 = _mm_blend_epi16(m1, m2, 0x0C);
^
In file included from /home/[username]/android-ndk-r15c/toolchains/x86-4.9/prebuilt/linux-x86_64/lib/gcc/i686-linux-android/4.9.x/include/nmmintrin.h:31:0,
from blake2-simd.cpp:16:
/home/[username]/android-ndk-r15c/toolchains/x86-4.9/prebuilt/linux-x86_64/lib/gcc/i686-linux-android/4.9.x/include/smmintrin.h:166:1: error: inlining failed in call to always_inline '__m128i _mm_blend_epi16(__m128i, __m128i, int)': target specific option mismatch
_mm_blend_epi16 (__m128i __X, __m128i __Y, const int __M)
^
blake2-simd.cpp:136:37: error: called from here
t2 = _mm_blend_epi16(t0, t1, 0xF0);
^
In file included from /home/[username]/android-ndk-r15c/toolchains/x86-4.9/prebuilt/linux-x86_64/lib/gcc/i686-linux-android/4.9.x/include/nmmintrin.h:31:0,
from blake2-simd.cpp:16:
/home/[username]/android-ndk-r15c/toolchains/x86-4.9/prebuilt/linux-x86_64/lib/gcc/i686-linux-android/4.9.x/include/smmintrin.h:166:1: error: inlining failed in call to always_inline '__m128i _mm_blend_epi16(__m128i, __m128i, int)': target specific option mismatch
_mm_blend_epi16 (__m128i __X, __m128i __Y, const int __M)
^
blake2-simd.cpp:147:35: error: called from here
t1 = _mm_blend_epi16(m1,m3,0xC0);
...
In file included from /home/[username]/android-ndk-r15c/toolchains/x86-4.9/prebuilt/linux-x86_64/lib/gcc/i686-linux-android/4.9.x/include/nmmintrin.h:31:0,
from blake2-simd.cpp:16:
/home/[username]/android-ndk-r15c/toolchains/x86-4.9/prebuilt/linux-x86_64/lib/gcc/i686-linux-android/4.9.x/include/smmintrin.h:166:1: error: inlining failed in call to always_inline '__m128i _mm_blend_epi16(__m128i, __m128i, int)': target specific option mismatch
```
The errors go on for a couple hundred lines. [Pastebin here.](https://pastebin.com/p3piEh3Z) I get similar errors using `ndk-build`, but oddly enough, on a different file -- crc-simd.cpp, which says:
```
always_inline function '_mm_crc32_u8' requires target feature 'sse4.1', but would be inlined into function 'CRC32C_Update_SSE42' that is compiled without support for 'sse4.1'
```
Edit: On x86_64, a similar error, again on a different file:
```
/home/[username]/android-ndk-r15c/toolchains/x86_64-4.9/prebuilt/linux-x86_64/lib/gcc/x86_64-linux-android/4.9.x/include/wmmintrin.h:116:1: error: inlining failed in call to always_inline '__m128i _mm_clmulepi64_si128(__m128i, __m128i, int)': target specific option mismatch
_mm_clmulepi64_si128 (__m128i __X, __m128i __Y, const int __I)
^
gcm-simd.cpp:499:61: error: called from here
c1 = _mm_xor_si128(c1, _mm_clmulepi64_si128(c0, r, 0x10));
^
In file included from gcm-simd.cpp:35:0:
/home/[username]/android-ndk-r15c/toolchains/x86_64-4.9/prebuilt/linux-x86_64/lib/gcc/x86_64-linux-android/4.9.x/include/wmmintrin.h:116:1: error: inlining failed in call to always_inline '__m128i _mm_clmulepi64_si128(__m128i, __m128i, int)': target specific option mismatch
_mm_clmulepi64_si128 (__m128i __X, __m128i __Y, const int __I)
^
gcm-simd.cpp:503:40: error: called from here
c0 = _mm_clmulepi64_si128(c0, r, 0);
^
GNUmakefile-cross:371: recipe for target 'gcm-simd.o' failed
``` | GNUmakefile-cross on x86: compile errors | https://api.github.com/repos/weidai11/cryptopp/issues/508/comments | 1 | 2017-09-17T18:46:37Z | 2017-09-17T19:35:11Z | https://github.com/weidai11/cryptopp/issues/508 | 258,323,936 | 508 |
[
"weidai11",
"cryptopp"
] | This is a change control item. It tracks removal of CMake from the GitHub sources.
CMake is no longer supported by the project. CMake is still available on the wiki at [CMake](https://www.cryptopp.com/wiki/CMake). It is now maintained by the community.
The reasons for the removal can be found at [CMake Removal](https://www.cryptopp.com/wiki/CMake#CMake_Removal) on the CMake wiki page. | Remove CMake from library sources | https://api.github.com/repos/weidai11/cryptopp/issues/506/comments | 2 | 2017-09-17T01:05:48Z | 2017-09-18T23:48:10Z | https://github.com/weidai11/cryptopp/issues/506 | 258,269,795 | 506 |
[
"weidai11",
"cryptopp"
] | ```
[root@localhost Crytppp]# make
[ 1%] Building CXX object CMakeFiles/cryptopp-object.dir/cryptlib.cpp.o
In file included from /root/Desktop/cryptopp-CRYPTOPP_5_6_5/cryptlib.cpp:19:
/root/Desktop/cryptopp-CRYPTOPP_5_6_5/misc.h: In function ‘unsigned int CryptoPP::TrailingZeros(CryptoPP::word32)’:
/root/Desktop/cryptopp-CRYPTOPP_5_6_5/misc.h:680: error: ‘_tzcnt_u32’ was not declared in this scope
/root/Desktop/cryptopp-CRYPTOPP_5_6_5/misc.h: In function ‘unsigned int CryptoPP::TrailingZeros(CryptoPP::word64)’:
/root/Desktop/cryptopp-CRYPTOPP_5_6_5/misc.h:711: error: ‘_tzcnt_u64’ was not declared in this scope
/root/Desktop/cryptopp-CRYPTOPP_5_6_5/misc.h: In function ‘bool CryptoPP::IsPowerOf2(const T&) [with T = unsigned int]’:
/root/Desktop/cryptopp-CRYPTOPP_5_6_5/misc.h:821: error: ‘_blsr_u32’ was not declared in this scope
/root/Desktop/cryptopp-CRYPTOPP_5_6_5/misc.h: In function ‘bool CryptoPP::IsPowerOf2(const T&) [with T = long unsigned int]’:
/root/Desktop/cryptopp-CRYPTOPP_5_6_5/misc.h:828: error: ‘_blsr_u64’ was not declared in this scope
make[2]: *** [CMakeFiles/cryptopp-object.dir/cryptlib.cpp.o] Error 1
make[1]: *** [CMakeFiles/cryptopp-object.dir/all] Error 2
make: *** [all] Error 2
[root@localhost Crytppp]#
``` | Cmake Compile Error | https://api.github.com/repos/weidai11/cryptopp/issues/505/comments | 2 | 2017-09-16T07:12:30Z | 2017-09-16T22:38:09Z | https://github.com/weidai11/cryptopp/issues/505 | 258,214,526 | 505 |
[
"weidai11",
"cryptopp"
] | Compile Error | https://api.github.com/repos/weidai11/cryptopp/issues/504/comments | 0 | 2017-09-16T07:10:23Z | 2017-09-16T07:10:35Z | https://github.com/weidai11/cryptopp/issues/504 | 258,214,427 | 504 | |
[
"weidai11",
"cryptopp"
] | At `-O3` it looks like IBM's XL C/C++ is not generating the code we expect. We are hanging after RC6, which is the TEA benchmark.
```
# GCC112
$ ./cryptest.exe b2 2 3.2
...
<TR><TH>RC5 (r=16)<TD>59<TD>52.0<TD>1.212<TD>3877
!! Hang Here !!
```
And:
```
# GCC119
$ ./cryptest.exe b2 2 4.1
...
<TR><TH>RC5 (r=16)<TD>59<TD>52.0<TD>1.212<TD>3877
!! Hang Here !!
```
Below, `Rijndael_Enc_AdvancedProcessBlocks_POWER8` is the AES/OFB random number generator. Don't get distracted by it. The issue lies in `TEA::Enc`. `while (sum != m_limit)` is the loop control for `TEA::Enc::ProcessAndXorBlock`.
```
<TR><TH>IDEA/CTR (128-bit key)<TD>56<TD>51.0<TD>0.335<TD>1005
<TR><TH>RC5 (r=16)<TD>59<TD>48.7<TD>1.192<TD>3577
^C
Program received signal SIGINT, Interrupt.
0x000000001075a7e8 in CryptoPP::TEA::Enc::ProcessAndXorBlock (
this=0x3fffffffc250, inBlock=0x4400 <Address 0x4400 out of bounds>,
xorBlock=0x107b4c18 <CryptoPP::Rijndael_Enc_AdvancedProcessBlocks_POWER8(unsigned int const*, unsigned long, unsigned char const*, unsigned char const*, unsigned char*, unsigned long, unsigned int)+88> "",
outBlock=0x1 <Address 0x1 out of bounds>, this=0x3fffffffc250,
inBlock=0x4400 <Address 0x4400 out of bounds>,
xorBlock=0x107b4c18 <CryptoPP::Rijndael_Enc_AdvancedProcessBlocks_POWER8(unsigned int const*, unsigned long, unsigned char const*, unsigned char const*, unsigned char*, unsigned long, unsigned int)+88> "",
outBlock=0x1 <Address 0x1 out of bounds>, this=0x3fffffffc250,
inBlock=0x4400 <Address 0x4400 out of bounds>,
xorBlock=0x107b4c18 <CryptoPP::Rijndael_Enc_AdvancedProcessBlocks_POWER8(unsigned int const*, unsigned long, unsigned char const*, unsigned char const*, unsigned char*, unsigned long, unsigned int)+88> "",
outBlock=0x1 <Address 0x1 out of bounds>) at ./secblock.h:534
534 {return m_ptr;}
Missing separate debuginfos, use: debuginfo-install glibc-2.17-157.el7_3.1.ppc64le libgcc-4.8.5-11.el7.ppc64le libstdc++-4.8.5-11.el7.ppc64le
(gdb) n
26 while (sum != m_limit)
(gdb)
534 {return m_ptr;}
(gdb)
26 while (sum != m_limit)
(gdb)
534 {return m_ptr;}
(gdb)
26 while (sum != m_limit)
(gdb)
534 {return m_ptr;}
...
``` | XLC and TEA hang during benchmarks at -O3 | https://api.github.com/repos/weidai11/cryptopp/issues/503/comments | 3 | 2017-09-16T07:06:41Z | 2017-09-19T06:39:29Z | https://github.com/weidai11/cryptopp/issues/503 | 258,214,265 | 503 |
[
"weidai11",
"cryptopp"
] | GCC112, which is PPC64 little endian, is failing its self tests for SHA384 and SHA512. GCC119, which is AIX big endian, is fine. Crypto++ 5.6.2 is also fine, so this looks like an error we introduced.
XLC version on GCC112:
```
$ xlC -qversion
IBM XL C/C++ for Linux, V13.1.5 (5725-C73, 5765-J08)
Version: 13.01.0005.0001
```
XLC version on GCC119:
```
$ xlc -qversion
IBM XL C/C++ for AIX, V13.1.3 (5725-C72, 5765-J07)
Version: 13.01.0003.0000
```
Here are the results.
```
$ CXX=xlC make -j 64
...
$ ./cryptest.exe tv sha
Using seed: 1505509596
Testing MessageDigest algorithm SHA-1.
...
Testing MessageDigest algorithm SHA-224.
...
Testing MessageDigest algorithm SHA-256.
...
Testing MessageDigest algorithm SHA-384.
AlgorithmType: MessageDigest
Digest: cb00753f45a35e8bb5a03d699ac65007272c32ab0eded1631a8b605a43ff5bed8086072ba1e7cc2358baeca134c825a7
Message: "abc"
Name: SHA-384
Test: Verify
Test failed.
Skipping to next test.
AlgorithmType: MessageDigest
Digest: 09330c33f71147e83d192fc782cd1b4753111b173b3b05d22fa08086e3b0f712fcc7c71a557e2db966c3e9fa91746039
Message: "abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmnhijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu"
Name: SHA-384
Test: Verify
Test failed.
Skipping to next test.
AlgorithmType: MessageDigest
Digest: 9d0e1809716474cb086e834e310a4a1ced149e9c00f248527972cec5704c2a5b07b8b3dc38ecc4ebae97ddd87f3d8985
Message: r15625 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
Name: SHA-384
Test: Verify
Test failed.
Skipping to next test.
Testing MessageDigest algorithm SHA-512.
AlgorithmType: MessageDigest
Digest: ddaf35a193617abacc417349ae20413112e6fa4e89a97ea20a9eeee64b55d39a2192992a274fc1a836ba3c23a3feebbd454d4423643ce80e2a9ac94fa54ca49f
Message: "abc"
Name: SHA-512
Test: Verify
Test failed.
Skipping to next test.
AlgorithmType: MessageDigest
Digest: 8e959b75dae313da8cf4f72814fc143f8f7779c6eb9f7fa17299aeadb6889018501d289e4900f7e4331b99dec4b5433ac7d329eeb6dd26545e96e55b874be909
Message: "abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmnhijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu"
Name: SHA-512
Test: Verify
Test failed.
Skipping to next test.
AlgorithmType: MessageDigest
Digest: e718483d0ce769644e2e42c7bc15b4638e1f98b13b2044285632a803afa973ebde0ff244877ea60a4cb0432ce577c31beb009c5c2c49aa2e4eadb217ad8cc09b
Message: r15625 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
Name: SHA-512
Test: Verify
Test failed.
Skipping to next test.
Tests complete. Total tests = 15. Failed tests = 6.
```
| XLC and SHA512 failed self tests | https://api.github.com/repos/weidai11/cryptopp/issues/502/comments | 1 | 2017-09-15T21:23:15Z | 2017-09-19T06:39:38Z | https://github.com/weidai11/cryptopp/issues/502 | 258,168,640 | 502 |
[
"weidai11",
"cryptopp"
] | Sorry, I write these you may seem very difficult, because I use the Chinese, in the use of Google translated into English.
In __BORLANDC__, if there is __asm in the function, it looks like everything is normal when it is compiled in debug mode. However, when compiled in the release mode, the function parameters and local variable positioning are completely wrong because of optimization.
So join __declspec (naked)
And completely by their own control and determine the location of parameters and local variables. as follows:
---------------------
#ifdef __BORLANDC__
__declspec( naked ) bool CpuId(word32 func, word32 subfunc, word32 output[4])
{
__asm
{
push ebp
mov ebp, esp
push ebx
push edi
mov eax,[ebp + 8] //func
mov ecx,[ebp + 12] //subfunc
cpuid
mov edi, [ebp + 16] //output
mov [edi], eax
mov [edi+4], ebx
mov [edi+8], ecx
mov [edi+12], edx
pop edi
pop ebx
pop ebp
mov eax, 1
ret
}
}
#else
#endif | CpuId | https://api.github.com/repos/weidai11/cryptopp/issues/501/comments | 1 | 2017-09-15T12:16:05Z | 2017-09-15T22:43:25Z | https://github.com/weidai11/cryptopp/issues/501 | 258,020,174 | 501 |
[
"weidai11",
"cryptopp"
] | In `__BORLANDC__`, if there is `__asm` in the function, it looks like everything is normal when it is compiled in debug mode. However, when compiled in the release mode, the function parameters and local variable positioning are completely wrong because of optimization.
So add `__declspec (naked)` and completely by their own control and determine the location of parameters and local variables. as follows:
```
#ifdef __BORLANDC__
__declspec( naked ) bool CpuId(word32 func, word32 subfunc, word32 output[4])
{
__asm
{
push ebp
mov ebp, esp
push ebx
push edi
mov eax,[ebp + 8] //func
mov ecx,[ebp + 12] //subfunc
cpuid
mov edi, [ebp + 16] //output
mov [edi], eax
mov [edi+4], ebx
mov [edi+8], ecx
mov [edi+12], edx
pop edi
pop ebx
pop ebp
mov eax, 1
ret
}
}
#else
#endif
``` | CpuId | https://api.github.com/repos/weidai11/cryptopp/issues/500/comments | 6 | 2017-09-15T12:13:19Z | 2017-09-16T22:07:17Z | https://github.com/weidai11/cryptopp/issues/500 | 258,019,436 | 500 |
[
"weidai11",
"cryptopp"
] | Well, this is one of the more bizarre errors I've seen from GCC. Its GCC 6.1.0 on AIX 7.2.0.0, which is provided by GCC119 on the compile farm.
```
$ gmake -j 64
...
g++ -DNDEBUG -g2 -O3 -fPIC -pthread -pipe -c bench1.cpp
g++ -DNDEBUG -g2 -O3 -fPIC -pthread -pipe -c bench2.cpp
...
In file included from bench2.cpp:9:0:
gfpcrypt.h: In function 'CryptoPP::DL_PrivateKey_GFP<GP>::~DL_PrivateKey_GFP() [with GP = CryptoPP::DL_GroupParameters_DSA]':
gfpcrypt.h:519:13: error: CryptoPP::DL_PrivateKey_GFP<GP>::~DL_PrivateKey_GFP() [with GP = CryptoPP::DL_GroupParameters_DSA] causes a section type conflict with void CryptoPP::AllocatorWithCleanup<T, T_Align16>::deallocate(void*, CryptoPP::AllocatorWithCleanup<T, T_Align16>::size_type) [with T = unsigned char; bool T_Align16 = true]
virtual ~DL_PrivateKey_GFP() {}
^
In file included from integer.h:20:0,
from validate.h:8,
from bench2.cpp:6:
secblock.h:217:7: note: 'void CryptoPP::AllocatorWithCleanup<T, T_Align16>::deallocate(void*, CryptoPP::AllocatorWithCleanup<T, T_Align16>::size_type) [with T = unsigned char; bool T_Align16 = true]' was declared here
void deallocate(void *ptr, size_type size)
^~~~~~~~~~
GNUmakefile:1026: recipe for target 'bench2.o' failed
``` | AIX and DL_PrivateKey_GFP<GP>::~DL_PrivateKey_GFP() causes a section type conflict | https://api.github.com/repos/weidai11/cryptopp/issues/499/comments | 1 | 2017-09-14T21:38:27Z | 2017-09-19T06:52:40Z | https://github.com/weidai11/cryptopp/issues/499 | 257,864,612 | 499 |
[
"weidai11",
"cryptopp"
] | Project works in "rad studio xe10" can not be compiled | rad studio xe10 | https://api.github.com/repos/weidai11/cryptopp/issues/498/comments | 14 | 2017-09-14T18:57:11Z | 2017-09-17T18:48:50Z | https://github.com/weidai11/cryptopp/issues/498 | 257,821,893 | 498 |
[
"weidai11",
"cryptopp"
] | This is a change control item. Power8 encryption using PPC built-ins was added in several steps:
* Single block encryption: http://github.com/weidai11/cryptopp/commit/7fb34e9b0894
* Single block decryption: http://github.com/weidai11/cryptopp/commit/b090e5f69fe7
* Multiple blocks, 4x: http://github.com/weidai11/cryptopp/commit/6899d3f8bb06
* Multiple blocks, 6x: http://github.com/weidai11/cryptopp/commit/58890ff05396
* Refactor LoadT(), StoreT(), ReverseT(): http://github.com/weidai11/cryptopp/commit/2c18fe8af8b4e7
* Add common Power8 header: http://github.com/weidai11/cryptopp/commit/1057f893631c
The numbers for AES are shown below. GCC112 is a little-endian machine, while GCC119 is a big-endian machine.
A related issue was [Improve under-aligned buffers for AltiVec and Power8](https://github.com/weidai11/cryptopp/issues/487). We did not clear all instances of under-aligned buffers. Rather, we cleaned-up an alignment issue when it was inexpensive and profitable. I.e., it was not too much work and it improved performance. | Add Power8 AES Encryption | https://api.github.com/repos/weidai11/cryptopp/issues/497/comments | 1 | 2017-09-14T00:22:45Z | 2017-09-22T12:15:05Z | https://github.com/weidai11/cryptopp/issues/497 | 257,559,046 | 497 |
[
"weidai11",
"cryptopp"
] | I use Visual Studio 2005 to compile `cryptlib.lib`. There have two errors:
```
.\integer.cpp(2986) : error C2039: 'make_checked_array_iterator' : is not a member of 'stdext'
.\integer.cpp(2986) : error C3861: 'make_checked_array_iterator': identifier not found
```
My environment is:
* Windows 7
* cryptopp 5.6.5
* Microsoft Visual Studio 2005 8.0.50727.42 (RTM.050727-4200)
How can i fix it? | Visual Studio 2005 compile error | https://api.github.com/repos/weidai11/cryptopp/issues/496/comments | 5 | 2017-09-13T03:32:44Z | 2023-11-23T07:48:57Z | https://github.com/weidai11/cryptopp/issues/496 | 257,247,537 | 496 |
[
"weidai11",
"cryptopp"
] | ```
[root@localhost Cryptopp]# make
[ 0%] Building CXX object CMakeFiles/cryptopp-object.dir/cryptlib.cpp.o
/tmp/ccS7ThcX.s: Assembler messages:
/tmp/ccS7ThcX.s:1248: Error: no such instruction: `shrx %ecx,%ebp,%edx'
/tmp/ccS7ThcX.s:1270: Error: no such instruction: `shlx %ebx,%r13d,%r13d'
make[2]: *** [CMakeFiles/cryptopp-object.dir/cryptlib.cpp.o] Error 1
make[1]: *** [CMakeFiles/cryptopp-object.dir/all] Error 2
make: *** [all] Error 2
[root@localhost Cryptopp]#
```
| Linux Cmake error | https://api.github.com/repos/weidai11/cryptopp/issues/495/comments | 3 | 2017-09-12T09:21:40Z | 2017-09-16T22:38:16Z | https://github.com/weidai11/cryptopp/issues/495 | 256,974,898 | 495 |
[
"weidai11",
"cryptopp"
] | I make cryptopp 5.6.5 on CentOS 6.6 x64, but always show error below:
```
g++ -DNDEBUG -g2 -O2 -fPIC -march=native -pipe -c cryptlib.cpp
In file included from cryptlib.cpp:19:
misc.h: In function ‘unsigned int CryptoPP::TrailingZeros(CryptoPP::word32)’:
misc.h:680: error: ‘_tzcnt_u32’ was not declared in this scope
misc.h: In function ‘unsigned int CryptoPP::TrailingZeros(CryptoPP::word64)’:
misc.h:711: error: ‘_tzcnt_u64’ was not declared in this scope
misc.h: In function ‘bool CryptoPP::IsPowerOf2(const T&) [with T = unsigned int]’:
misc.h:821: error: ‘_blsr_u32’ was not declared in this scope
misc.h: In function ‘bool CryptoPP::IsPowerOf2(const T&) [with T = long unsigned int]’:
misc.h:828: error: ‘_blsr_u64’ was not declared in this scope
make: *** [cryptlib.o] Error 1
```
Can anyone tell me how to resolve it ? thanks . | CentOS 6.6 x64 make error | https://api.github.com/repos/weidai11/cryptopp/issues/494/comments | 6 | 2017-09-12T08:56:20Z | 2017-09-13T02:36:29Z | https://github.com/weidai11/cryptopp/issues/494 | 256,967,426 | 494 |
[
"weidai11",
"cryptopp"
] | Looking for the ability to cross-compile crypto++ using the given CMakeLists.txt file, but it doesn't seem to set all of the same options and provide all of the same features as the setenv-android.sh + GNUMakefile-cross options does.
Expanding the CMake build system to include options like target STL and android version would be nice.
If there's a better way to accomplish this than what I'm suggesting, please let me know. | Android CMake Cross-compilation | https://api.github.com/repos/weidai11/cryptopp/issues/493/comments | 6 | 2017-09-09T19:54:47Z | 2017-09-16T22:37:36Z | https://github.com/weidai11/cryptopp/issues/493 | 256,461,957 | 493 |
[
"weidai11",
"cryptopp"
] | Trying to compile the latest source (as of b6f79af) for Android with NDK r15c doesn't seem to work when following the directions [on the wiki page](https://www.cryptopp.com/wiki/Android_(Command_Line)).
Environment (incorporates fix from #490):
```
export ANDROID_NDK_ROOT=/home/[username]/android-ndk-r15c
export AOSP_API=android-21
// edit AOSP_STL_INC in setenv-android.sh to be AOSP_STL_INC="$ANDROID_NDK_ROOT/sources/cxx-stl/llvm-libc++/include" for llvm
./setenv-android.sh arm64-v8a llvm
```
Compile attempt on WIndows Ubuntu subsystem command line:
```
make -f GNUmakefile-cross clean
$ make -f GNUmakefile-cross
g++ -DNDEBUG -g2 -O3 -fPIC -pipe -c cryptlib.cpp
g++ -DNDEBUG -g2 -O3 -fPIC -pipe -c cpu.cpp
g++ -DNDEBUG -g2 -O3 -fPIC -pipe -c integer.cpp
g++ -DNDEBUG -g2 -O3 -fPIC -pipe -c 3way.cpp
g++ -DNDEBUG -g2 -O3 -fPIC -pipe -c adler32.cpp
g++ -DNDEBUG -g2 -O3 -fPIC -pipe -c algebra.cpp
g++ -DNDEBUG -g2 -O3 -fPIC -pipe -c algparam.cpp
g++ -DNDEBUG -g2 -O3 -fPIC -pipe -c arc4.cpp
g++ -DNDEBUG -g2 -O3 -fPIC -pipe -c aria-simd.cpp
In file included from aria-simd.cpp:18:0:
/usr/lib/gcc/x86_64-linux-gnu/5/include/tmmintrin.h: In function ‘void CryptoPP::ARIA_ProcessAndXorBlock_Xor_SSSE3(const byte*, CryptoPP::byte*, const byte*, CryptoPP::word32*)’:
/usr/lib/gcc/x86_64-linux-gnu/5/include/tmmintrin.h:136:1: error: inlining failed in call to always_inline ‘__m128i _mm_shuffle_epi8(__m128i, __m128i)’: target specific option mismatch
_mm_shuffle_epi8 (__m128i __X, __m128i __Y)
^
aria-simd.cpp:127:18: error: called from here
_mm_storeu_si128(reinterpret_cast<__m128i*>(outBlock),
^
In file included from aria-simd.cpp:18:0:
/usr/lib/gcc/x86_64-linux-gnu/5/include/tmmintrin.h:136:1: error: inlining failed in call to always_inline ‘__m128i _mm_shuffle_epi8(__m128i, __m128i)’: target specific option mismatch
_mm_shuffle_epi8 (__m128i __X, __m128i __Y)
^
aria-simd.cpp:127:18: error: called from here
_mm_storeu_si128(reinterpret_cast<__m128i*>(outBlock),
^
In file included from aria-simd.cpp:18:0:
/usr/lib/gcc/x86_64-linux-gnu/5/include/tmmintrin.h:136:1: error: inlining failed in call to always_inline ‘__m128i _mm_shuffle_epi8(__m128i, __m128i)’: target specific option mismatch
_mm_shuffle_epi8 (__m128i __X, __m128i __Y)
^
aria-simd.cpp:127:18: error: called from here
_mm_storeu_si128(reinterpret_cast<__m128i*>(outBlock),
^
GNUmakefile-cross:327: recipe for target 'aria-simd.o' failed
make: *** [aria-simd.o] Error 1
```
This appears to have something to do with the SSSE3 code? Adding `-mssse3` to `CXXFLAGS` in `GNUmakefile-cross` did not appear to help (see [here](https://stackoverflow.com/q/35772562/3938401) and [here](https://stackoverflow.com/q/10686638/3938401)). | Android compiling doesn't seem to work with NDK r15c | https://api.github.com/repos/weidai11/cryptopp/issues/491/comments | 17 | 2017-09-08T17:16:19Z | 2017-09-17T18:35:34Z | https://github.com/weidai11/cryptopp/issues/491 | 256,318,337 | 491 |
[
"weidai11",
"cryptopp"
] | For llvm with NDK r15c, the path needs to change from
```
AOSP_STL_INC="$ANDROID_NDK_ROOT/sources/cxx-stl/llvm-libc++/libcxx/include"
```
to
```
AOSP_STL_INC="$ANDROID_NDK_ROOT/sources/cxx-stl/llvm-libc++/include"
```
I haven't opened a pull request for this since at this instant I'm not sure what version of the NDK you are meaning to support. | setenv-android.sh -> Wrong path for llvm AOSP_STL_INC | https://api.github.com/repos/weidai11/cryptopp/issues/490/comments | 4 | 2017-09-08T15:57:45Z | 2017-09-09T01:28:24Z | https://github.com/weidai11/cryptopp/issues/490 | 256,298,769 | 490 |
[
"weidai11",
"cryptopp"
] | cryptopp gives an error if it installed with macports or brew on a mac 10.12.5.
The error says Undefined symbols for architecture x86_64. There is also a deprecation hint regarding libstdc++
How can I rebuild the source in order to let it use libc++ instead of libstdc++?
```
err: clang: warning: libstdc++ is deprecated; move to libc++ with a minimum deployment target of OS X 10.9 [-Wdeprecated]
Undefined symbols for architecture x86_64:
"CryptoPP::HashFilter::HashFilter(CryptoPP::HashTransformation&, CryptoPP::BufferedTransformation*, bool, int, std::string const&, std::string const&)", referenced from:
_main in test.cpp.1.o
...
ld: symbol(s) not found for architecture x86_64
``` | cryptopp Undefined symbols for architecture x86_64 | https://api.github.com/repos/weidai11/cryptopp/issues/488/comments | 3 | 2017-09-04T19:33:23Z | 2017-09-09T17:42:34Z | https://github.com/weidai11/cryptopp/issues/488 | 255,106,715 | 488 |
[
"weidai11",
"cryptopp"
] | Intel and ARM processors are tolerant of under-aligned buffers when using crypto instructions. AltiVec and Power8 are less tolerant, and they simply ignore the three low-order bits to ensure an address is aligned. The AltiVec and Power8 have caused a fair number of wild writes on the stack and in the heap.
We cannot enable the [AltiVec and Power8 in-core crypto](http://www.ibm.com/developerworks/library/se-power8-in-core-cryptography/index.html) until the addresses are properly aligned for the CPUs.
This ticket will track changes related to buffer alignments for messages that are handled on AltiVec and Power8 data paths. | Improve under-aligned buffers for AltiVec and Power8 | https://api.github.com/repos/weidai11/cryptopp/issues/487/comments | 1 | 2017-09-04T14:53:50Z | 2017-09-19T06:40:51Z | https://github.com/weidai11/cryptopp/issues/487 | 255,064,342 | 487 |
[
"weidai11",
"cryptopp"
] | Windows CMake fails when compiler path has a space. For example:
```
execute_process(COMMAND sh -c "${CMAKE_CXX_COMPILER} -V 2>&1"
```
and similar fail because it expands to (for example):
```
sh -c c:\Program Files\vc.exe -V 2>&1
c:\Program is not a valid path.
```
Wrapping the ${compiler} with \" resolves this issue. | Windows CMake failure when compiler path has a space | https://api.github.com/repos/weidai11/cryptopp/issues/486/comments | 5 | 2017-09-01T12:06:01Z | 2022-11-08T21:01:55Z | https://github.com/weidai11/cryptopp/issues/486 | 254,621,107 | 486 |
[
"weidai11",
"cryptopp"
] | We are catching a compile failure using GCC 6 on AIX:
```
g++ -DNDEBUG -g2 -O3 -std=c++03 -fPIC -pthread -pipe -c adhoc.cpp
...
In file included from /opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/6.1.0/include/c++/vector:64:0,
from stdcpp.h:16,
from cryptlib.h:97,
from seckey.h:10,
from rijndael.h:12,
from aes.h:12,
from dll.h:17,
from test.cpp:9:
/opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/6.1.0/include/c++/bits/stl_vector.h: In function 'void std::_Vector_base<_Tp, _Alloc>::_M_deallocate(std::_Vector_base<_Tp, _Alloc>::pointer, std::size_t) [with _Tp = CryptoPP::HuffmanDecoder::CodeInfo; _Alloc = CryptoPP::AllocatorWithCleanup<CryptoPP::HuffmanDecoder::CodeInfo>]':
/opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/6.1.0/include/c++/bits/stl_vector.h:174:7: error: void std::_Vector_base<_Tp, _Alloc>::_M_deallocate(std::_Vector_base<_Tp, _Alloc>::pointer, std::size_t) [with _Tp = CryptoPP::HuffmanDecoder::CodeInfo; _Alloc = CryptoPP::AllocatorWithCleanup<CryptoPP::HuffmanDecoder::CodeInfo>] causes a section type conflict with void CryptoPP::AllocatorWithCleanup<T, T_Align16>::deallocate(void*, CryptoPP::AllocatorWithCleanup<T, T_Align16>::size_type, CryptoPP::AllocatorWithCleanup<T, T_Align16>::size_type) [with T = CryptoPP::HuffmanEncoder::Code; bool T_Align16 = false]
_M_deallocate(pointer __p, size_t __n)
^~~~~~~~~~~~~
In file included from rijndael.h:13:0,
from aes.h:12,
from dll.h:17,
from test.cpp:9:
secblock.h:239:7: note: 'void CryptoPP::AllocatorWithCleanup<T, T_Align16>::deallocate(void*, CryptoPP::AllocatorWithCleanup<T, T_Align16>::size_type, CryptoPP::AllocatorWithCleanup<T, T_Align16>::size_type) [with T = CryptoPP::HuffmanEncoder::Code; bool T_Align16 = false]' was declared here
void deallocate(void *ptr, size_type size, size_type mark)
^~~~~~~~~~
GNUmakefile:960: recipe for target 'test.o' failed
```
It appears to be complaining about the overloaded name `deallocate`. | GCC 6 compile failure with -std=c++03 on AIX | https://api.github.com/repos/weidai11/cryptopp/issues/485/comments | 1 | 2017-08-31T15:03:41Z | 2017-09-19T06:41:19Z | https://github.com/weidai11/cryptopp/issues/485 | 254,366,582 | 485 |
[
"weidai11",
"cryptopp"
] | [cryptest-result_armv7l-rev4.txt](https://github.com/weidai11/cryptopp/files/1262534/cryptest-result_armv7l-rev4.txt)
```
processor : 0
model name : ARMv7 Processor rev 4 (v7l)
BogoMIPS : 50.52
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xc07
CPU revision : 4
```
```
Testing: ARM NEON code generation
g++ -DNDEBUG -g2 -O2 -fPIC -pipe -march=armv7-a -mfloat-abi=hard -mfpu=neon -c aria-simd.cpp
ERROR: failed to generate expected vector load instructions
ERROR: failed to generate expected vector store instructions
```
Referencing #480. Possibly related to https://github.com/monero-project/kovri/issues/699? | cryptest: armv7l: failed to generate expected vector load/store instructions | https://api.github.com/repos/weidai11/cryptopp/issues/481/comments | 13 | 2017-08-30T05:59:09Z | 2017-09-06T00:46:59Z | https://github.com/weidai11/cryptopp/issues/481 | 253,886,606 | 481 |
[
"weidai11",
"cryptopp"
] | On two of our machines:
[cryptest-result_armv7l-rev2.txt](https://github.com/weidai11/cryptopp/files/1262507/cryptest-result_armv7l-rev2.txt)
```
processor : 0
model name : ARMv7 Processor rev 2 (v7l)
BogoMIPS : 50.00
Features : half thumb fastmult vfp edsp thumbee vfpv3 tls idiva idivt vfpd32 lpae
CPU implementer : 0x56
CPU architecture: 7
CPU variant : 0x2
CPU part : 0x584
CPU revision : 2
```
[cryptest-result_armv7l-rev4.txt](https://github.com/weidai11/cryptopp/files/1262508/cryptest-result_armv7l-rev4.txt)
```
processor : 0
model name : ARMv7 Processor rev 4 (v7l)
BogoMIPS : 50.52
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xc07
CPU revision : 4
```
Possibly related to https://github.com/monero-project/kovri/issues/699? | cryptest: armv7l: undefined references for NEON, PMULL, and DetectArmFeatures | https://api.github.com/repos/weidai11/cryptopp/issues/480/comments | 3 | 2017-08-30T05:55:28Z | 2017-08-31T15:32:00Z | https://github.com/weidai11/cryptopp/issues/480 | 253,886,066 | 480 |
[
"weidai11",
"cryptopp"
] | I have a suggestion, I think it could be very nice to ease interop with the [windows API](https://msdn.microsoft.com/fr-fr/library/windows/desktop/bb931357(v=vs.85).aspx).
This API has a [windows blob key structure](https://msdn.microsoft.com/fr-fr/library/windows/desktop/aa375601(v=vs.85).aspx), that I believe could be used to instantiate cryptopp keys. Conversely, I think it could be nice to be able to export keys as windows blob.
This will also ease interop with the c# world as it is based on this API.
I do not know enough cryptopp and cryptography to do it myself, it is just a suggestion.
In any cases, thanks A LOT for maintaining and developing this libray.
A pseudo example of what I'm thinking for the [public](https://msdn.microsoft.com/fr-fr/library/windows/desktop/aa375601(v=vs.85).aspx#pub_BLOB) blob key (blob encoded as a 64bit string but we could let the raw blob) for RSA digital signature :
```
CryptoPP::RSA::PublicKey LoadPublicWindowsBlob(string public_key_blob_64_bit_encoded )
{
//1024 rsa with 512 rsa
byte decoded_Blob[148] ;
size_t size_pubkey = Base64Decode(public_key_blob_64_bit_encoded, decoded_Blob, 148);
byte modulus[128];
byte modulusreversed[128];
byte pubexp[4] ;
pubexp[0] = decoded_Blob[19];
pubexp[1] = decoded_Blob[18];
pubexp[2] = decoded_Blob[17];
pubexp[3] = decoded_Blob[16];
for (int i = 0; i < 128; i++)
modulus[i] = decoded_Blob[20 + i];
for (int i = 0; i < 128; i++)
modulusreversed[i] = modulus[128 - 1 - i];
CryptoPP::Integer pub(pubexp,4);
CryptoPP::Integer mod(modulusreversed,128);
CryptoPP::InvertibleRSAFunction params;
params.SetModulus(mod);
params.SetPublicExponent(pub);
CryptoPP::RSA::PublicKey publicKey2(params);
return publicKey2;
}
```
--------------------------------------------
Edit :
based on this structure :
```
PUBLICKEYSTRUC publickeystruc;
RSAPUBKEY rsapubkey;
BYTE modulus[rsapubkey.bitlen/8];
```
with :
```
typedef struct _PUBLICKEYSTRUC {
BYTE bType;
BYTE bVersion;
WORD reserved;
ALG_ID aiKeyAlg; (unsigned int)
} BLOBHEADER, PUBLICKEYSTRUC;
typedef struct _RSAPUBKEY {
DWORD magic;
DWORD bitlen;
DWORD pubexp;
} RSAPUBKEY;
```
see :
- [PUBLICKEYSTRUC](https://msdn.microsoft.com/fr-fr/library/windows/desktop/aa387453(v=vs.85).aspx)
- [RSAPUBKEY](https://msdn.microsoft.com/fr-fr/library/windows/desktop/aa387685(v=vs.85).aspx)
| Suggestion : Could you ease interop with the windows API ? | https://api.github.com/repos/weidai11/cryptopp/issues/479/comments | 5 | 2017-08-29T21:23:30Z | 2017-09-18T04:45:35Z | https://github.com/weidai11/cryptopp/issues/479 | 253,809,164 | 479 |
[
"weidai11",
"cryptopp"
] | 😡 I specifically said here https://github.com/weidai11/cryptopp/pull/471#issuecomment-325076354 that `egrep` does not work (i.e.., now we're back to inline build errors) but `egrep` was then reintroduced in https://github.com/weidai11/cryptopp/commit/19cabcf15df5ea63cd7b0ceb03f2c1eac30f0e92#diff-af3b638bc2a3e6c650974192a53c7291R105.
Can you please change `egrep` to `grep -E` or drop `egrep` all-together? | Avoid egrep when possible, remove egrep from DumpMachine | https://api.github.com/repos/weidai11/cryptopp/issues/476/comments | 8 | 2017-08-28T21:06:14Z | 2017-11-14T02:28:11Z | https://github.com/weidai11/cryptopp/issues/476 | 253,456,939 | 476 |
[
"weidai11",
"cryptopp"
] | In the master branch of this project (current commit as of writing this), in VS2010 secblock.h fails to compile on line 530:
```
enum : size_type {ELEMS_MAX = A::ELEMS_MAX};
```
The error is:
```
1>c:\cryptopp\secblock.h(530): warning C4480: nonstandard extension used: specifying underlying type for enum ''
1> c:\cryptopp\secblock.h(857) : see reference to class template instantiation 'CryptoPP::SecBlock<T,A>' being compiled
1>c:\cryptopp\secblock.h(530): error C3168: 'A::size_type' : illegal underlying type for enum
```
The reason is that VS2010 only has partial support for strongly typed enums. See: [https://msdn.microsoft.com/en-us/library/hh567368%28v=vs.110%29.aspx?f=255&MSPPError=-2147217396](https://msdn.microsoft.com/en-us/library/hh567368%28v=vs.110%29.aspx?f=255&MSPPError=-2147217396)
The solution is to modify the #ifdef to skip it if you're using VS2010:
```
#if defined(CRYPTOPP_DOXYGEN_PROCESSING)
static const size_type ELEMS_MAX = ...;
#elif defined(CRYPTOPP_CXX11) && (!defined(_MSC_VER) || (defined(_MSC_VER) && (_MSC_VER >= 1700)))
enum : size_type {ELEMS_MAX = A::ELEMS_MAX};
#else
static const size_type ELEMS_MAX = SIZE_MAX/sizeof(T);
#endif
```
| secblock.h fails to compile in VS2010 (because it doesn't support strongly typed enums) | https://api.github.com/repos/weidai11/cryptopp/issues/475/comments | 6 | 2017-08-28T13:21:59Z | 2017-08-31T18:05:58Z | https://github.com/weidai11/cryptopp/issues/475 | 253,327,345 | 475 |
[
"weidai11",
"cryptopp"
] | Solaris 11.3, Sun Studio 12.4 (SunCC 0x5130). Round keys are not SSE aligned, but its not clear why at the moment.
```
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1 (LWP 1)]
0x08e0dac6 in CryptoPP::ARIA_ProcessAndXorBlock_Xor_SSSE3 (xorBlock=0x0,
outBlock=0x900d6d0 "<o\304\300S\210\254\327\321\006\035m>\322\327\263\020", rk=0x9018ab8 "\247\201L=8a#\332\365\247\332/\243\345\206H", t=0x9018b68)
at /export/home/jwalton/cryptopp/aria-simd.cpp:129
129 _mm_shuffle_epi8(_mm_load_si128((const __m128i*)(rk)), MASK)));
```
| Solaris and crash in ARIA_ProcessAndXorBlock_Xor_SSSE3 | https://api.github.com/repos/weidai11/cryptopp/issues/473/comments | 2 | 2017-08-27T19:50:51Z | 2017-08-28T10:21:00Z | https://github.com/weidai11/cryptopp/issues/473 | 253,185,298 | 473 |
[
"weidai11",
"cryptopp"
] | Our `CMakeFile.txt` contains the following for SunCC code paths. SunCC uses `-xarch=XXX` rather than GCC style `-mXXX`.
CHECK_CXX_COMPILER_FLAG("-xarch=sha" CRYPTOPP_IA32_SHA)
When we run CMake under Sun's compiler it results in:
```
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test CRYPTOPP_IA32_SSSE3
-- Performing Test CRYPTOPP_IA32_SSSE3 - Success
-- Performing Test CRYPTOPP_IA32_SSE4
-- Performing Test CRYPTOPP_IA32_SSE4 - Success
-- Performing Test CRYPTOPP_IA32_CLMUL
-- Performing Test CRYPTOPP_IA32_CLMUL - Success
-- Performing Test CRYPTOPP_IA32_AES
-- Performing Test CRYPTOPP_IA32_AES - Success
-- Performing Test CRYPTOPP_IA32_SHA
-- Performing Test CRYPTOPP_IA32_SHA - Success
...
```
However, when we compile it results in:
```
$ make sha-simd.o shacal2-simd.o VERBOSE=1
make -f CMakeFiles/cryptopp-object.dir/build.make CMakeFiles/cryptopp-object.dir/sha-simd.cpp.o
Building CXX object CMakeFiles/cryptopp-object.dir/sha-simd.cpp.o
/opt/solarisstudio12.4/bin/CC -m32 -template=no%extdef -g -xO2 -DNDEBUG -xarch=sha -o CMakeFiles/cryptopp-object.dir/sha-simd.cpp.o -c /export/home/test/sha-simd.cpp
CC: Warning: illegal use of -xarch option, illegal value ignored: sha
make -f CMakeFiles/cryptopp-object.dir/build.make CMakeFiles/cryptopp-object.dir/shacal2-simd.cpp.o
Building CXX object CMakeFiles/cryptopp-object.dir/shacal2-simd.cpp.o
/opt/solarisstudio12.4/bin/CC -m32 -template=no%extdef -g -xO2 -DNDEBUG -xarch=sha -o CMakeFiles/cryptopp-object.dir/shacal2-simd.cpp.o -c /export/home/test/shacal2-simd.cpp
CC: Warning: illegal use of -xarch option, illegal value ignored: sha
``` | CHECK_CXX_COMPILER_FLAG misdetects SunCC compiler features | https://api.github.com/repos/weidai11/cryptopp/issues/472/comments | 2 | 2017-08-26T21:16:44Z | 2017-09-16T22:38:43Z | https://github.com/weidai11/cryptopp/issues/472 | 253,123,379 | 472 |
[
"weidai11",
"cryptopp"
] | Hi @noloader,
I'm not sure if this question was supposed to go the mailing list, and I don't mean to make extra work for you, but I've noticed a trend where rebased (or appear-to-be rebased) commits (and merge commits) are not GPG-signed. "Normal" commits appear to be signed since #290.
Will you consider signing rebased and merge commits? | [Request] GPG-sign rebased and merge commits | https://api.github.com/repos/weidai11/cryptopp/issues/470/comments | 6 | 2017-08-24T21:51:34Z | 2017-08-25T00:27:02Z | https://github.com/weidai11/cryptopp/issues/470 | 252,741,792 | 470 |
[
"weidai11",
"cryptopp"
] | [Without `-march=native`](https://github.com/weidai11/cryptopp/files/1247921/OpenBSD_cryptopp_without-native.txt). | amd64: OpenBSD/Clang 3.8.0 without -march=native: error: needs target feature pclmul | https://api.github.com/repos/weidai11/cryptopp/issues/468/comments | 3 | 2017-08-24T06:28:39Z | 2017-08-24T11:27:24Z | https://github.com/weidai11/cryptopp/issues/468 | 252,499,920 | 468 |
[
"weidai11",
"cryptopp"
] | [With `-march=native`](https://github.com/weidai11/cryptopp/files/1247912/OpenBSD_cryptopp_with-native.txt). | amd64: OpenBSD/Clang 3.8.0 with -march=native: error: needs target feature sha | https://api.github.com/repos/weidai11/cryptopp/issues/467/comments | 3 | 2017-08-24T06:24:45Z | 2017-08-24T11:27:39Z | https://github.com/weidai11/cryptopp/issues/467 | 252,499,223 | 467 |
[
"weidai11",
"cryptopp"
] | When building https://github.com/weidai11/cryptopp/commit/b3cacd8287e103e68f81b21a507fad2efd5f10ec *with* `-march=native` on Win32/64:
- [Win32: gcc 6.2.0](https://build.getmonero.org/builders/kovri-all-win32/builds/537/steps/compile/logs/stdio)
- [Win64: gcc 7.2.0](https://build.getmonero.org/builders/kovri-all-win64/builds/507/steps/compile/logs/stdio) | Win32/64: error: inlining failed in call with (and without) -march=native | https://api.github.com/repos/weidai11/cryptopp/issues/466/comments | 30 | 2017-08-24T05:06:41Z | 2017-09-16T22:38:58Z | https://github.com/weidai11/cryptopp/issues/466 | 252,488,194 | 466 |
[
"weidai11",
"cryptopp"
] | [New Instructions Supporting Large Integer Arithmetic on Intel Architecture Processors](https://www-ssl.intel.com/content/dam/www/public/us/en/documents/white-papers/ia-large-integer-arithmetic-paper.pdf). The instructions have been available for a few years now, and compilers that know how to handle them produce fast and elegant code.
For example, here is 3 chained add-carries using `adcx`:
```
# 3 ADCX
movq (%rsi), %rdx
adcq %rdx, (%rdi)
movq 8(%rsi), %rcx
adcq %rcx, 8(%rdi)
movq 16(%rsi), %r8
adcq %r8, 16(%rdi)
```
And here's the existing code, which uses multiple `mov`, `add` and `adc`:
```
# 1 ADD/ADC
mov (%rdx,%r9,8),%r8
add $0xff,%al
adc (%rcx,%r9,8),%r8
setb %al
add $0x1,%r9
mov %r8,(%rsi)
```
As of this writing, Intel is the only major compiler that knows what to do with `_addcarryx_u64`. GCC still produces the old code for `_addcarryx_u64`. And Clang [crashes on the intrinsic](https://bugs.llvm.org/show_bug.cgi?id=34249).
We may find out the benefits are not that impressive. We need to watch the benchmarks closely. | Utilize Intel MULX, ADCX and ADOX in Integer class | https://api.github.com/repos/weidai11/cryptopp/issues/463/comments | 3 | 2017-08-21T01:54:00Z | 2017-11-13T18:54:25Z | https://github.com/weidai11/cryptopp/issues/463 | 251,531,569 | 463 |
[
"weidai11",
"cryptopp"
] | I'm an idiot. | StreamTransformationFilter: invalid PKCS #7 block padding found error after upgrading to 5.6.5 | https://api.github.com/repos/weidai11/cryptopp/issues/460/comments | 4 | 2017-08-08T17:32:59Z | 2017-08-09T11:06:58Z | https://github.com/weidai11/cryptopp/issues/460 | 248,790,181 | 460 |
[
"weidai11",
"cryptopp"
] | There's a Cryptographic File System package [cryfs](https://github.com/cryfs/cryfs) here on Github. It uses (depends on) Crypto++.
Now after the `byte` change it cannot compile any more:
```
[ 15%] Building CXX object src/cpp-utils/CMakeFiles/cpp-utils.dir/crypto/symmetric/ciphers.cpp.o
In file included from /Users/ur20980/src/cryfs/src/cpp-utils/crypto/symmetric/ciphers.cpp:1:
In file included from /Users/ur20980/src/cryfs/src/cpp-utils/crypto/symmetric/ciphers.h:10:
In file included from /Users/ur20980/src/cryfs/src/cpp-utils/crypto/symmetric/GCM_Cipher.h:7:
In file included from /Users/ur20980/src/cryfs/src/cpp-utils/crypto/symmetric/../../random/Random.h:6:
/Users/ur20980/src/cryfs/src/cpp-utils/crypto/symmetric/../../random/OSRandomGenerator.h:23:49: error: use of
undeclared identifier 'byte'; did you mean 'bytes'?
CryptoPP::OS_GenerateRandomBlock(true, (byte*)target, bytes);
^~~~
bytes
/Users/ur20980/src/cryfs/src/cpp-utils/crypto/symmetric/../../random/OSRandomGenerator.h:22:62: note:
'bytes' declared here
inline void OSRandomGenerator::_get(void *target, size_t bytes) {
^
/Users/ur20980/src/cryfs/src/cpp-utils/crypto/symmetric/../../random/OSRandomGenerator.h:23:54: error:
expected expression
CryptoPP::OS_GenerateRandomBlock(true, (byte*)target, bytes);
^
/Users/ur20980/src/cryfs/src/cpp-utils/crypto/symmetric/../../random/OSRandomGenerator.h:22:47: warning:
unused parameter 'target' [-Wunused-parameter]
inline void OSRandomGenerator::_get(void *target, size_t bytes) {
^
In file included from /Users/ur20980/src/cryfs/src/cpp-utils/crypto/symmetric/ciphers.cpp:1:
In file included from /Users/ur20980/src/cryfs/src/cpp-utils/crypto/symmetric/ciphers.h:10:
/Users/ur20980/src/cryfs/src/cpp-utils/crypto/symmetric/GCM_Cipher.h:30:31: error: unknown type name 'byte';
did you mean 'CryptoPP::byte'?
static Data encrypt(const byte *plaintext, unsigned int plaintextSize, const EncryptionKey &encKey);
^~~~
CryptoPP::byte
/opt/local/include/cryptopp/config.h:204:23: note: 'CryptoPP::byte' declared here
typedef unsigned char byte;
^
In file included from /Users/ur20980/src/cryfs/src/cpp-utils/crypto/symmetric/ciphers.cpp:1:
In file included from /Users/ur20980/src/cryfs/src/cpp-utils/crypto/symmetric/ciphers.h:10:
/Users/ur20980/src/cryfs/src/cpp-utils/crypto/symmetric/GCM_Cipher.h:31:48: error: unknown type name 'byte';
did you mean 'CryptoPP::byte'?
static boost::optional<Data> decrypt(const byte *ciphertext, unsigned int ciphertextSize, const E...
^~~~
CryptoPP::byte
/opt/local/include/cryptopp/config.h:204:23: note: 'CryptoPP::byte' declared here
typedef unsigned char byte;
^
In file included from /Users/ur20980/src/cryfs/src/cpp-utils/crypto/symmetric/ciphers.cpp:1:
In file included from /Users/ur20980/src/cryfs/src/cpp-utils/crypto/symmetric/ciphers.h:10:
/Users/ur20980/src/cryfs/src/cpp-utils/crypto/symmetric/GCM_Cipher.h:39:54: error: unknown type name 'byte';
did you mean 'CryptoPP::byte'?
Data GCM_Cipher<BlockCipher, KeySize>::encrypt(const byte *plaintext, unsigned int plaintextSize, con...
^~~~
CryptoPP::byte
/opt/local/include/cryptopp/config.h:204:23: note: 'CryptoPP::byte' declared here
typedef unsigned char byte;
^
In file included from /Users/ur20980/src/cryfs/src/cpp-utils/crypto/symmetric/ciphers.cpp:1:
In file included from /Users/ur20980/src/cryfs/src/cpp-utils/crypto/symmetric/ciphers.h:10:
/Users/ur20980/src/cryfs/src/cpp-utils/crypto/symmetric/GCM_Cipher.h:48:34: error: use of undeclared
identifier 'byte'
new CryptoPP::ArraySink((byte*)ciphertext.data() + IV_SIZE, ciphertext.size() - IV_SIZE),
^
/Users/ur20980/src/cryfs/src/cpp-utils/crypto/symmetric/GCM_Cipher.h:48:39: error: expected expression
new CryptoPP::ArraySink((byte*)ciphertext.data() + IV_SIZE, ciphertext.size() - IV_SIZE),
^
/Users/ur20980/src/cryfs/src/cpp-utils/crypto/symmetric/GCM_Cipher.h:56:71: error: unknown type name 'byte';
did you mean 'CryptoPP::byte'?
boost::optional<Data> GCM_Cipher<BlockCipher, KeySize>::decrypt(const byte *ciphertext, unsigned int ...
^~~~
CryptoPP::byte
/opt/local/include/cryptopp/config.h:204:23: note: 'CryptoPP::byte' declared here
typedef unsigned char byte;
^
In file included from /Users/ur20980/src/cryfs/src/cpp-utils/crypto/symmetric/ciphers.cpp:1:
In file included from /Users/ur20980/src/cryfs/src/cpp-utils/crypto/symmetric/ciphers.h:10:
/Users/ur20980/src/cryfs/src/cpp-utils/crypto/symmetric/GCM_Cipher.h:61:11: error: unknown type name 'byte';
did you mean 'CryptoPP::byte'?
const byte *ciphertextIV = ciphertext;
^~~~
CryptoPP::byte
/opt/local/include/cryptopp/config.h:204:23: note: 'CryptoPP::byte' declared here
typedef unsigned char byte;
^
In file included from /Users/ur20980/src/cryfs/src/cpp-utils/crypto/symmetric/ciphers.cpp:1:
In file included from /Users/ur20980/src/cryfs/src/cpp-utils/crypto/symmetric/ciphers.h:10:
/Users/ur20980/src/cryfs/src/cpp-utils/crypto/symmetric/GCM_Cipher.h:62:11: error: unknown type name 'byte';
did you mean 'CryptoPP::byte'?
const byte *ciphertextData = ciphertext + IV_SIZE;
^~~~
CryptoPP::byte
/opt/local/include/cryptopp/config.h:204:23: note: 'CryptoPP::byte' declared here
typedef unsigned char byte;
^
In file included from /Users/ur20980/src/cryfs/src/cpp-utils/crypto/symmetric/ciphers.cpp:1:
In file included from /Users/ur20980/src/cryfs/src/cpp-utils/crypto/symmetric/ciphers.h:10:
/Users/ur20980/src/cryfs/src/cpp-utils/crypto/symmetric/GCM_Cipher.h:64:30: error: use of undeclared
identifier 'byte'
decryption.SetKeyWithIV((byte*)encKey.data(), encKey.BINARY_LENGTH, ciphertextIV, IV_SIZE);
^
/Users/ur20980/src/cryfs/src/cpp-utils/crypto/symmetric/GCM_Cipher.h:64:35: error: expected expression
decryption.SetKeyWithIV((byte*)encKey.data(), encKey.BINARY_LENGTH, ciphertextIV, IV_SIZE);
^
/Users/ur20980/src/cryfs/src/cpp-utils/crypto/symmetric/GCM_Cipher.h:68:32: error: use of undeclared
identifier 'byte'
CryptoPP::ArraySource((byte*)ciphertextData, ciphertextSize - IV_SIZE, true,
^
/Users/ur20980/src/cryfs/src/cpp-utils/crypto/symmetric/GCM_Cipher.h:68:37: error: expected expression
CryptoPP::ArraySource((byte*)ciphertextData, ciphertextSize - IV_SIZE, true,
^
/Users/ur20980/src/cryfs/src/cpp-utils/crypto/symmetric/GCM_Cipher.h:70:36: error: use of undeclared
identifier 'byte'
new CryptoPP::ArraySink((byte*)plaintext.data(), plaintext.size()),
^
/Users/ur20980/src/cryfs/src/cpp-utils/crypto/symmetric/GCM_Cipher.h:70:41: error: expected expression
new CryptoPP::ArraySink((byte*)plaintext.data(), plaintext.size()),
^
In file included from /Users/ur20980/src/cryfs/src/cpp-utils/crypto/symmetric/ciphers.cpp:1:
In file included from /Users/ur20980/src/cryfs/src/cpp-utils/crypto/symmetric/ciphers.h:11:
/Users/ur20980/src/cryfs/src/cpp-utils/crypto/symmetric/CFB_Cipher.h:31:29: error: unknown type name 'byte';
did you mean 'CryptoPP::byte'?
static Data encrypt(const byte *plaintext, unsigned int plaintextSize, const EncryptionKey &encKey);
^~~~
CryptoPP::byte
/opt/local/include/cryptopp/config.h:204:23: note: 'CryptoPP::byte' declared here
typedef unsigned char byte;
^
In file included from /Users/ur20980/src/cryfs/src/cpp-utils/crypto/symmetric/ciphers.cpp:1:
In file included from /Users/ur20980/src/cryfs/src/cpp-utils/crypto/symmetric/ciphers.h:11:
/Users/ur20980/src/cryfs/src/cpp-utils/crypto/symmetric/CFB_Cipher.h:32:46: error: unknown type name 'byte';
did you mean 'CryptoPP::byte'?
static boost::optional<Data> decrypt(const byte *ciphertext, unsigned int ciphertextSize, const Enc...
^~~~
CryptoPP::byte
/opt/local/include/cryptopp/config.h:204:23: note: 'CryptoPP::byte' declared here
typedef unsigned char byte;
^
In file included from /Users/ur20980/src/cryfs/src/cpp-utils/crypto/symmetric/ciphers.cpp:1:
In file included from /Users/ur20980/src/cryfs/src/cpp-utils/crypto/symmetric/ciphers.h:11:
/Users/ur20980/src/cryfs/src/cpp-utils/crypto/symmetric/CFB_Cipher.h:39:54: error: unknown type name 'byte';
did you mean 'CryptoPP::byte'?
Data CFB_Cipher<BlockCipher, KeySize>::encrypt(const byte *plaintext, unsigned int plaintextSize, con...
^~~~
CryptoPP::byte
/opt/local/include/cryptopp/config.h:204:23: note: 'CryptoPP::byte' declared here
typedef unsigned char byte;
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
1 warning and 20 errors generated.
``` | Moving to CryptoPP::byte broke at least one package | https://api.github.com/repos/weidai11/cryptopp/issues/459/comments | 8 | 2017-08-07T19:08:52Z | 2018-08-03T17:55:31Z | https://github.com/weidai11/cryptopp/issues/459 | 248,503,236 | 459 |
[
"weidai11",
"cryptopp"
] | CriticalBlue provided patches which added ARMv8 support to mbedTLS. See [PR 432, AARCH64 and Cryptography Extension Support](https://github.com/ARMmbed/mbedtls/pull/432), Thanks to @barryor, @sbutcher-arm, @johannesschneiders for their work.
CriticalBlue 's patch gave us something we could observe to cut-in ARMv8 for Crypto++. We had a partial implementation, but we were having problems in the key schedule. We got to spend some time with mbedTLS under the debugger, and it allowed us to pinpoint the problems with Crypto++ and ARMv8 AES.
The speed results are very good. Below are the numbers on a 1.2 GHz LeMaker HiKey, which is an IoT gadget. Server boards, like Mustang and Opterons, are about twice as fast (2.4 to 2.6 cpb).
* C++, AES/ECB - 25.8 cpb
* C++, AES/CTR - 26.7 cpb
* ARMv8, AES/ECB - 5.2 cpb
* ARMv8 AES/CTR - 5.8 cpb
This ticket will track the cut-in of ARMv8 AES. It is being tested now on a testing fork. Also see the following commits on the fork.
* [Fix ARMv8 AES Encryption](https://github.com/noloader/cryptopp/commit/701ec3aa1f45a7543a327560f0c2bbfbc3029098)
* [Fix ARMv8 AES Decryption](https://github.com/noloader/cryptopp/commit/14590423249de5a8548b418de47cdc557fa4208c)
* [Update self tests for ARMv8a AES](https://github.com/noloader/cryptopp/commit/d402099e81953cea)
* [Unroll ARMv8 AES encryption and decryption loops](https://github.com/noloader/cryptopp/commit/6478d6db87a7e96c) | Add AES for ARMv8 | https://api.github.com/repos/weidai11/cryptopp/issues/458/comments | 1 | 2017-08-07T04:01:32Z | 2017-08-11T11:35:20Z | https://github.com/weidai11/cryptopp/issues/458 | 248,302,151 | 458 |
[
"weidai11",
"cryptopp"
] | I use `FileSource` and `AuthenticatedEncryptionFilter` to open a file and encrypt his content with AES in EAX mode. The encrypted file is successfully created,but when i want to remove the original file, `std::remove ()` returns -1, which means that an error occurred.
Here is the code :
```
FileSink file(file_path_encrypted.c_str());
FileSource write_ciphertext(file_path_original.c_str(), true
new AuthenticatedEncryptionFilter(encryptor, new Redirector(file)));
const int delete_file = std::remove("file_path_original); // returns -1
```
I think that it's because the file may be still "in use" by `FileSource`, and i can't figure out how to close the file. With a classic `std::ifstream`, it would be `file.close()`, but i don't know how to do it with Crypto++.
I'm using Crypto++ 5.6.5 with Visual Studio 2017 on windows 7 SP1 | FileSource doesn't close the file after completing pipeliling | https://api.github.com/repos/weidai11/cryptopp/issues/457/comments | 1 | 2017-08-05T17:42:01Z | 2017-08-05T23:46:54Z | https://github.com/weidai11/cryptopp/issues/457 | 248,198,512 | 457 |
[
"weidai11",
"cryptopp"
] | Below are from self tests that exercise `SHA::Transform` (`SHA` is `SHA1`, `SHA256`, etc), which is a static member function. Testing shows the SSE2 implementation cannot handle unaligned data. Testing on an old 32-bit VIA C7-D (SSE, SSE2, SSE3 only) reveals the following. It looks like the pointer in ECX is unaligned. It makes sense since we put the byte array on the stack.
```
passed: SHA1::Transform, message 2
passed: SHA1::Transform, message 3
Program received signal SIGSEGV, Segmentation fault.
0x0829a62d in CryptoPP::X86_SHA256_HashBlocks (state=0xb7c1a2e5,
data=0xb7db9000, len=0xb7db9d60) at sha.cpp:881
881 );
...
(gdb) disass
...
0x0829a621 <+49>: test $0x1,%edi
0x0829a627 <+55>: jne 0x829a638 <CryptoPP::X86_SHA256_HashBlocks(CryptoPP::word32*, CryptoPP::word32 const*, size_t)+72>
0x0829a629 <+57>: decl 0x64(%esp)
=> 0x0829a62d <+61>: movdqa (%ecx),%xmm0
0x0829a631 <+65>: movdqa 0x10(%ecx),%xmm1
...
(gdb) p $ecx
$3 = 0xbfffd87c
```
The `movdqa` is "move double quad word aligned". We can side step it by aligning our buffers in `validat3.cpp` and documenting the requirement. We can also switch to `movdqu`, which is the unaligned version of the instruction.
SHA512 also suffers unaligned access when using `paddq`. Its a tougher problem because there is no unaligned version.
Now, the devious thing about this is, `GetOptimalAlignment()` is a member function. There is no static version, so a caller cannot query the alignment requirement. | Static SHA::Transform SEGFAULT's on unaligned data | https://api.github.com/repos/weidai11/cryptopp/issues/456/comments | 1 | 2017-08-05T03:48:16Z | 2017-08-05T23:29:17Z | https://github.com/weidai11/cryptopp/issues/456 | 248,155,533 | 456 |
[
"weidai11",
"cryptopp"
] | Below are from self tests that exercise `SHA::Transform` (`SHA` is `SHA1`, `SHA256`, etc), which is a static member function. The code path for `SHA::Transform` is a little different than the code path when using an SHA object with `Update` and `Final`.
`HASH::InitState` and `HASH::Transform` are unique to hashes which derive from `IteratedHashWithStaticTransform`. Most hash classes simply derive from `IteratedHash`. The reason for the static `HASH::Transform` is, some classes like SEAL and MDC, call the transform function directly. The static functions allow the other classes to use, say, a user supplied key as state instead of the traditional SHA initialization values.
The self tests are fine on non-SHA-accelerated processors. However, due to the slightly different code paths, when ARM or Intel SHA is available, the code misses a required endian conversion. And again, calling `Update` and `Final` on a SHA object is fine because the conversions are present.
```
SHA static transform suite running...
passed: SHA1::Transform, message 1
passed: SHA1::Transform, message 2
FAILED: SHA1::Transform, message 3
passed: SHA256::Transform, message 1
passed: SHA256::Transform, message 2
FAILED: SHA256::Transform, message 3
passed: SHA512::Transform, message 1
passed: SHA512::Transform, message 2
passed: SHA512::Transform, message 3
```
The reason only Message 3 fails can be seen in the sample messages. A string of zero's (Message 1) and a string of 1's (Message 2) don't have endianness problems *per se*. However, the bytes in Message 3 does suffer endianness.
```
const byte SM1[MAX_PARAM] = {0};
const byte SM2[MAX_PARAM] = {
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
};
const byte SM3[MAX_PARAM] = {
0x00,0x04,0x08,0x0C,0x10,0x14,0x18,0x1C,0x20,0x24,0x28,0x2C,0x30,0x34,0x38,0x3C,
0x40,0x44,0x48,0x4C,0x50,0x54,0x58,0x5C,0x60,0x64,0x68,0x6C,0x70,0x74,0x78,0x7C,
0x80,0x84,0x88,0x8C,0x90,0x94,0x98,0x9C,0xA0,0xA4,0xA8,0xAC,0xB0,0xB4,0xB8,0xBC,
0xC0,0xC4,0xC8,0xCC,0xD0,0xD4,0xD8,0xDC,0xE0,0xE4,0xE8,0xEC,0xF0,0xF4,0xF8,0xFC
};
```
| Static SHA::Transform fails on Intel SHA cpu's | https://api.github.com/repos/weidai11/cryptopp/issues/455/comments | 1 | 2017-08-05T02:13:22Z | 2017-08-14T04:12:27Z | https://github.com/weidai11/cryptopp/issues/455 | 248,151,348 | 455 |
[
"weidai11",
"cryptopp"
] | The makefile uses `-O2` as the default optimization level.
The source code can support `-O3` as the optimization level. In fact, we support `-O5`, `-Os` and `-Ofast`. We regularly test them in [cryptest.sh](https://github.com/weidai11/cryptopp/blob/master/cryptest.sh).
At `-O3`, GCC and other compilers will vectorize, meaning they will use SIMD units, like SSE and NEON, more frequently. When the compiler takes an opportunity it is often a non-trivial speedup.
Also see [Switch from -O2 to -O3 as optimization default?](https://groups.google.com/d/msg/cryptopp-users/AEiGyjq15tw/GBAyDA6fBgAJ) on the mailing list. | Switch from -O2 to -O3 in the makefile | https://api.github.com/repos/weidai11/cryptopp/issues/454/comments | 1 | 2017-08-04T22:31:09Z | 2017-08-30T12:33:55Z | https://github.com/weidai11/cryptopp/issues/454 | 248,131,974 | 454 |
[
"weidai11",
"cryptopp"
] | I'm receiving this error. I'm using a custom makefile for building CryptoPP. The symbol referened is `CryptoPP::Rijndael::Enc::Enc()`. I found it here:
```
#if CRYPTOPP_BOOL_X64 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X86
struct Locals
{
word32 subkeys[4*12], workspace[8];
const byte *inBlocks, *inXorBlocks, *outXorBlocks;
byte *outBlocks;
size_t inIncrement, inXorIncrement, outXorIncrement, outIncrement;
size_t regSpill, lengthAndCounterFlag, keysBegin;
};
const size_t s_aliasPageSize = 4096;
const size_t s_aliasBlockSize = 256;
const size_t s_sizeToAllocate = s_aliasPageSize + s_aliasBlockSize + sizeof(Locals);
Rijndael::Enc::Enc() : m_aliasBlock(s_sizeToAllocate) { }
#endif
```
I tried removing these guards, but the error persists. Exact compiler flags are simply `-DNDEBUG -fPIC`
Furthermore, I'm linking it only as a static library, making this dynamic lookup bit even more confusing
My own code is not referencing this enc::enc() bit, it is only using the external public interfaces as AES
| undefined symbol: _ZN8CryptoPP8Rijndael3EncC2Ev | https://api.github.com/repos/weidai11/cryptopp/issues/453/comments | 3 | 2017-08-02T23:32:04Z | 2017-08-03T00:46:34Z | https://github.com/weidai11/cryptopp/issues/453 | 247,552,186 | 453 |
[
"weidai11",
"cryptopp"
] | We are still seeing users stuck at Crypto++ 4.2, Crypto++ 5.2, and other down level versions. The sticking point appears to be the old PGP style `RandomPool` generator. The PGP style `RandomPool` is effectively a deterministic generator and it was used as a deterministic key derivation function. See, for example:
* [Migrating from Crypto++ 5.2.1 to Crypto++ 5.6.5](https://groups.google.com/d/msg/cryptopp-users/lVtQizUAtlY/dH5Goc60AgAJ)
* [Moving from Crypto++ 4.2 to Crypto++ 5.6.4](https://groups.google.com/forum/#!topic/cryptopp-users/lVtQizUAtlY)
While we discourage the old PGP style `RandomPool` generator for several technical reasons, we should not allow it to be a barrier to a modern Crypto++ upgrade. The lack of a clear migration path and non-interoperability is a security engineering failure on our part.
This issue will track the addition of `OldRandomPool` to give users a clear and interoperable upgrade path. | Add OldRandomPool for pre-Crypto++ 5.5 compatibility | https://api.github.com/repos/weidai11/cryptopp/issues/452/comments | 2 | 2017-08-01T21:39:40Z | 2021-06-18T17:57:43Z | https://github.com/weidai11/cryptopp/issues/452 | 247,210,087 | 452 |
[
"weidai11",
"cryptopp"
] | ```
$ make -j 9
...
sosemanuk.cpp:642:9: warning: operation on ‘s0’ may be undefined [-Wsequence-point]
s##x0 = MUL_A(s##x0) ^ DIV_A(s##x3) ^ s##x9;\
~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sosemanuk.cpp:672:3: note: in expansion of macro ‘STEP’
STEP(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, v0, u0)
...
```
Part of the challenge is fixing the issue is, we need to examine the preprocessed source file to understand what is going on. Its kind of a painful thing to do, but here's the command: `$ g++ -DNDEBUG -E sosemanuk.cpp`. When looking at the preprocessed file, you will see (this is `STEP 0`):
```
u0 = (s9 + ((0%2) ? reg1 : reg2)) ^ ((0%2) ? reg2 : reg1); v0 = s0; s0 = (s0 =
rotlFixed(s0, 8), s0 ^ s_sosemanukMulTables[byte(s0)]) ^ (((s3) >> 8) ^
s_sosemanukMulTables[256 + byte(s3)]) ^ s9; ((0%2) ? reg2 : reg1) +=
(s2 ^ (s9 & (0 - (((0%2) ? reg1 : reg2) & 1)))); ((0%2) ? reg1 : reg2) =
rotlFixed(((0%2) ? reg1 : reg2) * 0x54655307, 7);
```
Though the compiler flags this define:
```
#define MUL_A(x) (x = rotlFixed(x, 8), x ^ s_sosemanukMulTables[byte(x)])
```
The underlying issue is shown below. Parenthesis don't create sequence points. Also see [Do parentheses force order of evaluation and make an undefined expression defined?](https://stackoverflow.com/q/22817517/608639) on Stack Overflow.
```
s0 = (s0 = MUL_A(s0) ... );
```
| sosemanuk.cpp and -Wsequence-point warnings | https://api.github.com/repos/weidai11/cryptopp/issues/449/comments | 1 | 2017-07-28T00:26:04Z | 2017-07-28T04:50:22Z | https://github.com/weidai11/cryptopp/issues/449 | 246,205,786 | 449 |
[
"weidai11",
"cryptopp"
] | `SecBlock<T,A>` data members are public, even though there are plenty of const and non-const accessors available, including `begin()`, `data()`, and `operator T*`
At 6.0 we can make the change that hides them by making them `protected`.
```
template <class T, class A = AllocatorWithCleanup<T> >
class SecBlock
{
public:
...
A m_alloc;
size_type m_mark, m_size;
T *m_ptr;
};
```
It appears the change will only effect `sosemanuk.cpp`:
```
g++ -DNDEBUG -g2 -O2 -fPIC -march=native -pipe -c threefish.cpp
sosemanuk.cpp: In member function ‘virtual void CryptoPP::SosemanukPolicy::OperateKeystream(CryptoPP::KeystreamOperation, CryptoPP::byte*, const byte*, size_t)’:
sosemanuk.cpp:604:19: error: ‘unsigned int* CryptoPP::SecBlock<unsigned int, CryptoPP::FixedSizeAllocatorWithCleanup<unsigned int, 12ul, CryptoPP::NullAllocator<unsigned int>, true> >::m_ptr’ is protected within this context
: "a" (m_state.m_ptr), "c" (iterationCount), "S" (s_sosemanukMulTables), "D" (output), "d" (input)
``` | SecBlock<T,A> data members are public | https://api.github.com/repos/weidai11/cryptopp/issues/448/comments | 1 | 2017-07-28T00:06:08Z | 2017-07-28T00:30:44Z | https://github.com/weidai11/cryptopp/issues/448 | 246,203,010 | 448 |
[
"weidai11",
"cryptopp"
] | We are experiencing the following when compiling under Visual Studio 2012 with a Windows Kit installed. [`test.cpp`](http://github.com/weidai11/cryptopp/blob/master/test.cpp) has a `using namespace CryptoPP`.
The practical problem for us is, `main` must ***not*** be in a namespace. It looks like we need to proxy `main`. That is, we provide an global `main` for C++, and then a `CryptoPP::Test::main` to avoid `using namespace CryptoPP`. Also see [Windows and "error C2872: 'byte' : ambiguous symbol"](http://groups.google.com/d/msg/cryptopp-users/FhdEmnATJJo/s0iDa6FYBgAJ) on the user list.
```
2> test.cpp
2>test.cpp(461): error C2872: 'byte' : ambiguous symbol
2> could be 'c:\program files (x86)\windows kits\8.0\include\shared\rpcndr.h(164) : unsigned char byte'
2> or 'c:\users\cryptopp-fork\config.h(203) : CryptoPP::byte'
2>test.cpp(480): error C2872: 'byte' : ambiguous symbol
2> could be 'c:\program files (x86)\windows kits\8.0\include\shared\rpcndr.h(164) : unsigned char byte'
2> or 'c:\users\cryptopp-fork\config.h(203) : CryptoPP::byte'
2>test.cpp(566): error C2872: 'byte' : ambiguous symbol
2> could be 'c:\program files (x86)\windows kits\8.0\include\shared\rpcndr.h(164) : unsigned char byte'
2> or 'c:\users\cryptopp-fork\config.h(203) : CryptoPP::byte'
2>test.cpp(584): error C2872: 'byte' : ambiguous symbol
2> could be 'c:\program files (x86)\windows kits\8.0\include\shared\rpcndr.h(164) : unsigned char byte'
2> or 'c:\users\cryptopp-fork\config.h(203) : CryptoPP::byte'
2>test.cpp(595): error C2872: 'byte' : ambiguous symbol
2> could be 'c:\program files (x86)\windows kits\8.0\include\shared\rpcndr.h(164) : unsigned char byte'
2> or 'c:\users\cryptopp-fork\config.h(203) : CryptoPP::byte'
2>test.cpp(618): error C2872: 'byte' : ambiguous symbol
2> could be 'c:\program files (x86)\windows kits\8.0\include\shared\rpcndr.h(164) : unsigned char byte'
2> or 'c:\users\cryptopp-fork\config.h(203) : CryptoPP::byte'
2>test.cpp(630): error C2872: 'byte' : ambiguous symbol
2> could be 'c:\program files (x86)\windows kits\8.0\include\shared\rpcndr.h(164) : unsigned char byte'
2> or 'c:\users\cryptopp-fork\config.h(203) : CryptoPP::byte'
2>test.cpp(631): error C2872: 'byte' : ambiguous symbol
2> could be 'c:\program files (x86)\windows kits\8.0\include\shared\rpcndr.h(164) : unsigned char byte'
2> or 'c:\users\cryptopp-fork\config.h(203) : CryptoPP::byte'
2>test.cpp(632): error C2872: 'byte' : ambiguous symbol
2> could be 'c:\program files (x86)\windows kits\8.0\include\shared\rpcndr.h(164) : unsigned char byte'
2> or 'c:\users\cryptopp-fork\config.h(203) : CryptoPP::byte'
2>test.cpp(636): error C2872: 'byte' : ambiguous symbol
2> could be 'c:\program files (x86)\windows kits\8.0\include\shared\rpcndr.h(164) : unsigned char byte'
2> or 'c:\users\cryptopp-fork\config.h(203) : CryptoPP::byte'
2>test.cpp(686): error C2872: 'byte' : ambiguous symbol
2> could be 'c:\program files (x86)\windows kits\8.0\include\shared\rpcndr.h(164) : unsigned char byte'
2> or 'c:\users\cryptopp-fork\config.h(203) : CryptoPP::byte'
2>test.cpp(687): error C2872: 'byte' : ambiguous symbol
2> could be 'c:\program files (x86)\windows kits\8.0\include\shared\rpcndr.h(164) : unsigned char byte'
2> or 'c:\users\cryptopp-fork\config.h(203) : CryptoPP::byte'
2>test.cpp(688): error C2872: 'byte' : ambiguous symbol
2> could be 'c:\program files (x86)\windows kits\8.0\include\shared\rpcndr.h(164) : unsigned char byte'
2> or 'c:\users\cryptopp-fork\config.h(203) : CryptoPP::byte'
2>test.cpp(692): error C2872: 'byte' : ambiguous symbol
2> could be 'c:\program files (x86)\windows kits\8.0\include\shared\rpcndr.h(164) : unsigned char byte'
2> or 'c:\users\cryptopp-fork\config.h(203) : CryptoPP::byte'
2>test.cpp(863): error C2872: 'byte' : ambiguous symbol
2> could be 'c:\program files (x86)\windows kits\8.0\include\shared\rpcndr.h(164) : unsigned char byte'
2> or 'c:\users\cryptopp-fork\config.h(203) : CryptoPP::byte'
```
Also see [Test C++17 byte change with dry runs from various projects](https://github.com/weidai11/cryptopp/issues/442) | Windows and "error C2872: 'byte' : ambiguous symbol" | https://api.github.com/repos/weidai11/cryptopp/issues/447/comments | 1 | 2017-07-23T14:20:38Z | 2017-07-28T05:21:15Z | https://github.com/weidai11/cryptopp/issues/447 | 244,913,208 | 447 |
[
"weidai11",
"cryptopp"
] | 1>cl : Command line warning D9002: ignoring unknown option '/arch:SSE2'
This is triggered by the:
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
project setting in the group..
<ItemDefinitionGroup Condition="'$(Platform)'=='x64'" Label="X64 Configuration">
This causes the /arch:SSE2 compile option which is only supported on x86 (32 bit).
The help text for this option says "If no option is specified, the compiler will use instructions found on processors that support SSE2." so perhaps no option should be set in either configuration.. | Visual Studio 64 bit builds produce /arch:SSE2 warnings | https://api.github.com/repos/weidai11/cryptopp/issues/445/comments | 10 | 2017-07-18T17:10:30Z | 2023-04-21T12:19:01Z | https://github.com/weidai11/cryptopp/issues/445 | 243,787,303 | 445 |
[
"weidai11",
"cryptopp"
] | ```
In file included from default.cpp:13:
./default.h:146:43: warning: 'DefaultDecryptor' is deprecated [-Wdeprecated-declarations]
class MACBadErr : public DefaultDecryptor::Err {public: MACBadErr() : DefaultDecryptor::Err("DefaultDecryptorWithMAC: MAC check failed") {}};
^
./default.h:57:7: note: 'DefaultDecryptor' has been explicitly marked deprecated here
class DefaultDecryptor : public ProxyFilter
^
./default.h:161:18: warning: 'DefaultDecryptor' is deprecated [-Wdeprecated-declarations]
DefaultDecryptor::State CurrentState() const;
^
./default.h:57:7: note: 'DefaultDecryptor' has been explicitly marked deprecated here
class DefaultDecryptor : public ProxyFilter
^
2 warnings generated.
``` | depreceated calls | https://api.github.com/repos/weidai11/cryptopp/issues/443/comments | 1 | 2017-07-17T11:25:32Z | 2017-07-17T13:00:51Z | https://github.com/weidai11/cryptopp/issues/443 | 243,365,418 | 443 |
[
"weidai11",
"cryptopp"
] | I'd like to use this issue to track some dry runs of the proposed change due to C++17, `std::byte` and collisions with Crypto++ `byte` . We've tested the change with toy programs, and we would like to solicit feedback from real projects using Crypto++.
The 3 second tour is as follows. From 10,000 feet, Crypto++ plans on moving `byte` from the global namespace into the Crypto++ namespace. The move creates a void in *user programs*, and it can be filled by (1) using `CryptoPP::byte` instead of `byte`; (2) `using byte = CryptoPP::byte;` (C++11 and above); or (3) `typedef unsigned char byte;` (C++03 and above). If possible, you should use (3) - supply your own typedef.
1. Make this change to Crypto++ library:
```
$ cat byte.diff
diff --git a/config.h b/config.h
index 291b148..92a6b84 100644
--- a/config.h
+++ b/config.h
@@ -194,10 +194,12 @@ namespace CryptoPP { }
# define __USE_W32_SOCKETS
#endif
-typedef unsigned char byte;
+// typedef unsigned char byte;
+#define CRYPTOPP_NO_GLOBAL_BYTE 1
NAMESPACE_BEGIN(CryptoPP)
+typedef unsigned char byte;
typedef unsigned short word16;
typedef unsigned int word32;
```
2. Optionally, make this change in the *user program* or *project* using Crypto++:
```
#include <cryptopp/config.h>
#if (CRYPTOPP_VERSION >= 600) && (__cplusplus >= 201103L)
using byte = CryptoPP::byte;
#else
typedef unsigned char byte;
#endif
// Alternately, use CryptoPP::byte everywhere instead of ::byte
```
3. Use GCC 7
* Fedora 26 ships with it
* [Debian Buster](http://wiki.debian.org/DebianBuster) with `apt-get install gcc-7 g++-7`
4. Use `-std=c++17`
* Build Crypto++ library with `-std=c++17` (will be OK)
* Build project with `-std=c++17` (report your problems)
For item (4), Build Crypto++ library with `-std=c++17` , perform the following:
```
$ CXX=g++-7 CXXFLAGS="-DNDEBUG -g2 -O3 -std=c++17" make -j 2
```
`CRYPTOPP_NO_GLOBAL_BYTE` is a convenience item for those supporting multiple versions of Crypto++. It is really only needed for the gap between the 5.6.5 release and the 6.0 release because Master currently uses `#define CRYPTOPP_VERSION 600`. But signalling it through a define is painless. Related, see [Release Versioning | Post-Release Increment](http://www.cryptopp.com/wiki/Release_Versioning#Post-Release_Increment) on the Crypto++ wiki.
Please report problems and work-arounds below. If you had problems, please state if it was due to `using namespace std;`. Work-arounds are suggested at [std::byte | Fixing Programs](https://www.cryptopp.com/wiki/Std::byte#Fixing_Programs) on the Crypto++ wiki.
-----
Here are folks who may be able to help with the dry run. Listing their name generates the GitHub notification. The names were gathered from a GitHub search for projects with activity in 2016 and 2017. @anonimal, @swarren, @mmoss, @zooko, @huahang, @prakhs123, @pld-linux, @sechaser, @elementrem, @xItsMe, @Mowje, @NickNaso, @cawka, @wyrover, @vunguyenthe, @vster, @alphaemmeo, @smasherprog, @pschord, @psforever, @harrywye, @vcpkgs, @tpgxyz, @luofujie, @badforlabor, @smasherprog, @riebl, @DonAlonzo, @amani-lei, @xy12423, @Cyberunner23, @Xiao-Chong, @codercheny, @familyld, @firngrod, @tcolligan-ap, @dotman14, @reganheath, @motioncity, @MarcelRaad, @DevJPM, @mouse07410, @denisbider, @gcsideal, @buildroot-auto-update, @woodsts, @snickl.
If you need to update your Crypto++ clone, then issue `git pull`. If you need to reset your Crypto++ clone to upstream/master, then see [`reset-fork.sh`](https://github.com/weidai11/cryptopp/blob/master/TestScripts/reset-fork.sh) provided in Crypto++ Master.
The change to accommodate C++17 and `std::byte` will be available in Master and eventually Crypto++ 6.0. The change requires a major version bump.
-----
For documentation purposes, see the following on the Crypto++ User mailing list:
* [PR 438: Use ::byte instead of byte](https://groups.google.com/forum/#!topic/cryptopp-users/HKKccPazkNc)
* [Merge byte change (::byte → CryptoPP::byte)](https://groups.google.com/forum/#!topic/cryptopp-users/n2tAysIZ6wg) | Test C++17 byte change with dry runs from various projects | https://api.github.com/repos/weidai11/cryptopp/issues/442/comments | 3 | 2017-07-16T19:01:55Z | 2017-08-15T06:41:07Z | https://github.com/weidai11/cryptopp/issues/442 | 243,258,996 | 442 |
[
"weidai11",
"cryptopp"
] | Fedora 26 with GCC 7.1. It looks like we've got a few of these to cleanup. They are dirty compiles and cause noise that could mask valid findings.
```
In file included from validat3.cpp:25:0:
siphash.h: In member function ‘void CryptoPP::SipHash_Base<C, D, T_128bit>::TruncatedFinal(byte*, size_t) [with unsigned int C = 4; unsigned int D = 8; bool T_128bit = true]’:
siphash.h:219:4: warning: this statement may fall through [-Wimplicit-fallthrough=]
m_b[0] |= ((word64)m_acc[6]) << 48;
^~~
siphash.h:220:3: note: here
case 6:
^~~~
siphash.h:221:4: warning: this statement may fall through [-Wimplicit-fallthrough=]
m_b[0] |= ((word64)m_acc[5]) << 40;
^~~
siphash.h:222:3: note: here
case 5:
^~~~
siphash.h:223:4: warning: this statement may fall through [-Wimplicit-fallthrough=]
m_b[0] |= ((word64)m_acc[4]) << 32;
^~~
siphash.h:224:3: note: here
case 4:
^~~~
siphash.h:225:4: warning: this statement may fall through [-Wimplicit-fallthrough=]
m_b[0] |= ((word64)m_acc[3]) << 24;
^~~
siphash.h:226:3: note: here
case 3:
^~~~
siphash.h:227:4: warning: this statement may fall through [-Wimplicit-fallthrough=]
m_b[0] |= ((word64)m_acc[2]) << 16;
^~~
siphash.h:228:3: note: here
case 2:
^~~~
siphash.h:229:4: warning: this statement may fall through [-Wimplicit-fallthrough=]
m_b[0] |= ((word64)m_acc[1]) << 8;
^~~
siphash.h:230:3: note: here
case 1:
^~~~
```
| GCC7 and -Wimplicit-fallthrough warnings | https://api.github.com/repos/weidai11/cryptopp/issues/441/comments | 1 | 2017-07-16T14:19:02Z | 2017-07-18T20:12:37Z | https://github.com/weidai11/cryptopp/issues/441 | 243,242,817 | 441 |
[
"weidai11",
"cryptopp"
] | The goal is to be able to run `cryptest.exe` (including `cryptest.exe v` etc.) after the installation has completed, possibly when the `cryptopp` source directory has been removed.
Any attempt to supply `CRYPTOPP_DATA_DIR` flag seems to fail:
```
$ echo $CXXFLAGS
-maes -mpclmul -mrdrnd -msse2 -mssse3 -msse4.1 -msse4.2 -std=c++11 -Os -Ofast -DCRYPTOPP_DATA_DIR="/opt/local/share/cryptopp/"
. . . . .
clang++ -maes -mpclmul -mrdrnd -msse2 -mssse3 -msse4.1 -msse4.2 -std=c++11 -Os -Ofast -DCRYPTOPP_DATA_DIR="/opt/local/share/cryptopp/" -fPIC -march=native -pipe -c validat0.cpp
test.cpp:393:21: error: expected expression
FileSource usage(CRYPTOPP_DATA_DIR "TestData/usage.dat", true, new F...
^
<command line>:1:27: note: expanded from here
#define CRYPTOPP_DATA_DIR /opt/local/share/cryptopp/
^
test.cpp:393:21: error: use of undeclared identifier 'opt'
<command line>:1:28: note: expanded from here
#define CRYPTOPP_DATA_DIR /opt/local/share/cryptopp/
^
test.cpp:393:21: error: use of undeclared identifier 'local'
<command line>:1:32: note: expanded from here
#define CRYPTOPP_DATA_DIR /opt/local/share/cryptopp/
^
test.cpp:393:21: error: use of undeclared identifier 'share'
<command line>:1:38: note: expanded from here
#define CRYPTOPP_DATA_DIR /opt/local/share/cryptopp/
^
test.cpp:393:21: error: use of undeclared identifier 'cryptopp'
<command line>:1:44: note: expanded from here
#define CRYPTOPP_DATA_DIR /opt/local/share/cryptopp/
^
5 errors generated.
```
I don't know what the following code in `GNUmakefile` does
```
# Only use CRYPTOPP_DATA_DIR if its not set in CXXFLAGS
ifeq ($(findstring -DCRYPTOPP_DATA_DIR, $(strip $(CXXFLAGS))),)
ifneq ($(strip $(CRYPTOPP_DATA_DIR)),)
validat%.o : validat%.cpp
$(CXX) $(strip $(CXXFLAGS)) -DCRYPTOPP_DATA_DIR=\"$(CRYPTOPP_DATA_DIR)\" -c $<
bench%.o : bench%.cpp
$(CXX) $(strip $(CXXFLAGS)) -DCRYPTOPP_DATA_DIR=\"$(CRYPTOPP_DATA_DIR)\" -c $<
datatest.o : datatest.cpp
$(CXX) $(strip $(CXXFLAGS)) -DCRYPTOPP_DATA_DIR=\"$(CRYPTOPP_DATA_DIR)\" -c $<
test.o : test.cpp
$(CXX) $(strip $(CXXFLAGS)) -DCRYPTOPP_DATA_DIR=\"$(CRYPTOPP_DATA_DIR)\" -c $<
endif
endif
```
but based on my experience on MacOS it is either not enough, or not correct.
I think the options are:
- copy/install test vectors and data to the `CRYPTOPP_DATA_DIR` before invoking `./cryptest.exe` in the GNUmakefile (target `test`), aka perform partial installation before running the test;
- in the test-modules like `validat.cpp` check for the existence of `CRYPTOPP_DATA_DIR`, and if it is not found - use the current directory.
I lean towards the second option as the more robust one. | Impossible to provide -DCRYPTOPP_DATA_DIR in CXXFLAGS | https://api.github.com/repos/weidai11/cryptopp/issues/440/comments | 8 | 2017-06-25T02:12:50Z | 2017-07-23T14:02:45Z | https://github.com/weidai11/cryptopp/issues/440 | 238,354,938 | 440 |
[
"weidai11",
"cryptopp"
] | Hi, I'm trying to use Crypto++ 5.6.5 on an embedded system that can only fit a flash file of a few MBs on it. When I compile the libcryptopp.a, it is 40MB! If I try to only compile what I need, it is still 10MB. I also found that I cannot exclude dll.cpp or fips140.cpp, even though I'm not using the DLL or fips versions.
Is there any way to make the library a few hundred kBs?
I've already tried using -ffunction-sections and -fdata-sections and --gc-sections when compiling the code and building the library - it had no effect.
I'm using Nios II Eclipse for compiling - part of the Altera Quartus 14.1 package. | CryptoPP library file much too large | https://api.github.com/repos/weidai11/cryptopp/issues/436/comments | 5 | 2017-06-13T23:51:04Z | 2017-06-14T16:49:31Z | https://github.com/weidai11/cryptopp/issues/436 | 235,724,551 | 436 |
[
"weidai11",
"cryptopp"
] | **TL;DR:** The 5.6.5 change to Integer::Zero() has introduced a DLL loader lock deadlock on windows server 2003 and server 2008.
I build crypto++ into a DLL (called "transformd") which I link to several executables (import library/dll combo).
Since upgrading to Crypto++ 5.6.5 these executables hang when I try to run them on windows server 2003 or 2008 (but not 2012 or 2016).
Running a debug build in windbg shows the following stack trace:
```
ntdll!NtWaitForKeyedEvent+0x15
ntdll!RtlFreeUserStack+0x2bb
*** ERROR: Symbol file could not be found. Defaulted to export symbols for C:\Windows\syswow64\kernel32.dll -
ntdll!RtlRegisterWait+0x183
*** ERROR: Symbol file could not be found. Defaulted to export symbols for C:\Htape\DR\bin\MSVCR120D.dll -
kernel32!RegisterWaitForSingleObject+0x4f
MSVCR120D!Concurrency::set_task_execution_resources+0x4298
MSVCR120D!Concurrency::details::_SetUnobservedExceptionHandler+0x7fe
MSVCR120D!Concurrency::details::_SetUnobservedExceptionHandler+0x977
MSVCR120D!Concurrency::Scheduler::Create+0x17c
MSVCR120D!Concurrency::Scheduler::Create+0x148a
MSVCR120D!Concurrency::Scheduler::Create+0x6b
MSVCR120D!Concurrency::Context::CurrentContext+0x25
MSVCR120D!Concurrency::details::platform::GetCurrentThreadId+0x980
*** ERROR: Symbol file could not be found. Defaulted to export symbols for C:\Htape\DR\bin\MSVCP120D.dll -
MSVCR120D!Concurrency::critical_section::lock+0x13
MSVCP120D!Thrd_yield+0x159
MSVCP120D!Mtx_lock+0xe
transformd!std::_Mtx_lockX+0x10 [c:\program files (x86)\microsoft visual studio 12.0\vc\include\thr\xthread @ 68]
transformd!std::_Mutex_base::lock+0x17 [c:\program files (x86)\microsoft visual studio 12.0\vc\include\mutex @ 41]
transformd!std::lock_guard<std::mutex>::lock_guard<std::mutex>+0x20 [c:\program files (x86)\microsoft visual studio 12.0\vc\include\mutex @ 184]
transformd!CryptoPP::Singleton<CryptoPP::Integer,CryptoPP::NewObject<CryptoPP::Integer>,0>::Ref+0xcb [s:\src\c\cryptopp\misc.h @ 296]
transformd!CryptoPP::`anonymous namespace'::`dynamic initializer for 's_zero''+0x24 [s:\src\c\cryptopp\integer.cpp @ 3031]
MSVCR120D!initterm+0x1a
transformd!_CRT_INIT+0xc3 [f:\dd\vctools\crt\crtw32\dllstuff\crtdll.c @ 295]
transformd!__DllMainCRTStartup+0xac [f:\dd\vctools\crt\crtw32\dllstuff\crtdll.c @ 502]
transformd!_DllMainCRTStartup+0x1f [f:\dd\vctools\crt\crtw32\dllstuff\crtdll.c @ 472]
ntdll!RtlQueryEnvironmentVariable+0x245
ntdll!LdrResSearchResource+0xa36
ntdll!RtlGetNtVersionNumbers+0x9b
ntdll!RtlSetUnhandledExceptionFilter+0x50
ntdll!LdrInitializeThunk+0x10
```
A google found this post which I think describes the issue: [Microsoft Connect Issue 809005, Deadlock when locking std::mutex during DllMain static initialization](https://connect.microsoft.com/VisualStudio/feedback/details/809005/deadlock-when-locking-std-mutex-during-dllmain-static-initialization).
Essentially my exe loads my dll which follows the default dll initialisation path calling CRT_INIT to initialise global variables, like s_zero, which locks a std::mutex and sends us into the "not dllmain safe" concurrency code, which I suspect is waiting for something else to initialise - but as we hold the loader lock that thing cannot initialse, thus the deadlock.
| Windows Server 2003/2008 DLL loader lock deadlock | https://api.github.com/repos/weidai11/cryptopp/issues/435/comments | 5 | 2017-06-08T12:56:23Z | 2017-06-11T07:16:47Z | https://github.com/weidai11/cryptopp/issues/435 | 234,518,169 | 435 |
[
"weidai11",
"cryptopp"
] | I don't know whether rsa have supply the interface prikey encode, pubkey decode?
| I don't know whether rsa have supply the interface prikey encode, pubkey decode | https://api.github.com/repos/weidai11/cryptopp/issues/434/comments | 1 | 2017-06-07T08:07:32Z | 2017-06-07T18:01:47Z | https://github.com/weidai11/cryptopp/issues/434 | 234,125,751 | 434 |
[
"weidai11",
"cryptopp"
] | it no export define in cmake.
so it no lib file create. | use cmake to create dll in widows no support | https://api.github.com/repos/weidai11/cryptopp/issues/433/comments | 5 | 2017-05-29T12:46:22Z | 2017-09-16T22:39:08Z | https://github.com/weidai11/cryptopp/issues/433 | 232,013,726 | 433 |
[
"weidai11",
"cryptopp"
] | some one have this error?
/root/testdir/cryptopp/rdrand.cpp:345: Error: no such instruction: `rdseed rax'
clone the newest version same error when build。
use gcc 7.1 gcc 4.9 is same | /root/testdir/cryptopp/rdrand.cpp:345: Error: no such instruction: `rdseed rax' | https://api.github.com/repos/weidai11/cryptopp/issues/431/comments | 23 | 2017-05-22T14:09:59Z | 2019-04-25T16:36:50Z | https://github.com/weidai11/cryptopp/issues/431 | 230,408,229 | 431 |
[
"weidai11",
"cryptopp"
] | This issue tracks adding PCLMUL intrinsics when \_\_PCLMUL\_\_ is not defined. This happens when a machine lacks PCLMUL or `-march=native` is _not_ used. While it may seem counter-intuitive to add it when its not needed, the primary use case is distro's, which builds for generic x86_64 and its users who have a more capable machine. A secondary use case is Clang, which does not enable _all_ cpu features under `-march=native` on occasion.
Also see [Fixing "ERROR: failed to generate sha1rnds4 instruction" (and friends)](https://groups.google.com/forum/#!topic/cryptopp-users/3ilaqjhNPv4) on the mailing list. | Add Carryless Multiply intrinsics when __PCLMUL__ is not defined | https://api.github.com/repos/weidai11/cryptopp/issues/430/comments | 1 | 2017-05-22T05:51:30Z | 2017-08-17T17:12:17Z | https://github.com/weidai11/cryptopp/issues/430 | 230,290,905 | 430 |
[
"weidai11",
"cryptopp"
] | This issue tracks adding AES intrinsics when \_\_AES\_\_ is not defined. This happens when a machine lacks AES or `-march=native` is _not_ used. While it may seem counter-intuitive to add it when its not needed, the primary use case is distro's, which builds for generic x86_64 and its users who have a more capable machine. A secondary use case is Clang, which does not enable _all_ cpu features under `-march=native` on occasion.
Also see [Fixing "ERROR: failed to generate sha1rnds4 instruction" (and friends)](https://groups.google.com/forum/#!topic/cryptopp-users/3ilaqjhNPv4) on the mailing list. | Add AES intrinsics when __AES__ is not defined | https://api.github.com/repos/weidai11/cryptopp/issues/429/comments | 4 | 2017-05-22T05:49:50Z | 2017-08-17T20:39:43Z | https://github.com/weidai11/cryptopp/issues/429 | 230,290,721 | 429 |
[
"weidai11",
"cryptopp"
] | This issue tracks adding CRC intrinsics when \_\_CRC\_\_ is not defined. This happens when a machine lacks CRC or `-march=native` is _not_ used. While it may seem counter-intuitive to add it when its not needed, the primary use case is distro's, which builds for generic x86_64 and its users who have a more capable machine. A secondary use case is Clang, which does not enable _all_ cpu features under `-march=native` on occasion.
Also see [Fixing "ERROR: failed to generate sha1rnds4 instruction" (and friends)](https://groups.google.com/forum/#!topic/cryptopp-users/3ilaqjhNPv4) on the mailing list. | Add CRC intrinsics when __CRC__ is not defined | https://api.github.com/repos/weidai11/cryptopp/issues/428/comments | 1 | 2017-05-20T20:32:51Z | 2017-08-17T16:43:39Z | https://github.com/weidai11/cryptopp/issues/428 | 230,177,389 | 428 |
[
"weidai11",
"cryptopp"
] | This issue tracks adding SHA intrinsics when \_\_SHA\_\_ is not defined. This happens when a machine lacks SHA or `-march=native` is _not_ used. While it may seem counter-intuitive to add it when its not needed, the primary use case is distro's, which builds for generic x86_64 and its users who have a more capable machine. A secondary use case is Clang, which does not enable _all_ cpu features under `-march=native` on occasion.
Also see [Fixing "ERROR: failed to generate sha1rnds4 instruction" (and friends)](https://groups.google.com/forum/#!topic/cryptopp-users/3ilaqjhNPv4) on the mailing list. | Add SHA intrinsics when __SHA__ is not defined | https://api.github.com/repos/weidai11/cryptopp/issues/427/comments | 1 | 2017-05-20T18:41:31Z | 2017-08-17T16:43:55Z | https://github.com/weidai11/cryptopp/issues/427 | 230,171,612 | 427 |
[
"weidai11",
"cryptopp"
] | We recently added variable block sizes and ciphers that incorporate them. Refer to the bug reports below. The larger block sizes require different polynomials. This ticket will track the related work.
We already accomplished the work for the polynomials for CMAC, but it should be documented. GCM mode is still outstanding.
According to [Table of Low-Weight Binary Irreducible Polynomials](http://www.hpl.hp.com/techreports/98/HPL-98-135.pdf), here are the 256, 512 and 1024-bit polynomials:
* x^256 + x^10 + x^5 + x + 1
* x^512 + x^8 + x^5 + x^2 + 1
* x^1024 + x^19 + x^6 + x + 1
Also see [OMAC/CMAC constant for different block sizes](https://crypto.stackexchange.com/questions/9815/omac-cmac-constant-for-different-block-sizes) on Crypto Stack Exchange.
-----
Related bug reports:
* [Add support for variable block sizes, GH #408](https://github.com/weidai11/cryptopp/issues/408)
* [Add Kalyna block cipher, GH #411](https://github.com/weidai11/cryptopp/issues/411)
* [Add Threefish block cipher, GH #422](https://github.com/weidai11/cryptopp/issues/422) | Polynomials for CMAC and GCM mode | https://api.github.com/repos/weidai11/cryptopp/issues/423/comments | 6 | 2017-05-16T05:02:54Z | 2018-01-19T15:59:30Z | https://github.com/weidai11/cryptopp/issues/423 | 228,916,011 | 423 |
[
"weidai11",
"cryptopp"
] | This issue will track the addition of Threefish. Skein will be added once we modify the library to accommodate tweaks.
Also see [Issue 408, Add support for variable block sizes](https://github.com/weidai11/cryptopp/issues/408). | Add Threefish block cipher | https://api.github.com/repos/weidai11/cryptopp/issues/422/comments | 1 | 2017-05-14T17:50:06Z | 2017-11-18T18:42:55Z | https://github.com/weidai11/cryptopp/issues/422 | 228,557,092 | 422 |
[
"weidai11",
"cryptopp"
] | This result is from GCC's compile farm and [host `gcc110`](https://gcc.gnu.org/wiki/CompileFarm). `gcc110` is IBM Power 730 Express server (big-endian POWER7) running Fedora 20.
```
$ CXXFLAGS="-DNDEBUG -DCRYPTOPP_COVERAGE -g2 -O5 -Wall" make -j 32
...
$ ./cryptest.exe v
...
passed: RoundUpToMultipleOf, word64, no overflow
passed: RoundUpToMultipleOf, word64, no overflow
passed: RoundUpToMultipleOf, word64, no overflow
passed: RoundUpToMultipleOf, word64, no overflow
passed: RoundUpToMultipleOf, word64, no overflow
passed: RoundUpToMultipleOf, word64, overflow
passed: RoundUpToMultipleOf, word128, no overflow
FAILED: RoundUpToMultipleOf, word128, no overflow
FAILED: RoundUpToMultipleOf, word128, no overflow
FAILED: RoundUpToMultipleOf, word128, no overflow
FAILED: RoundUpToMultipleOf, word128, no overflow
passed: RoundUpToMultipleOf, word128, overflow
...
```
The code for the test is available in [`validat0.cpp : 1130`](https://github.com/weidai11/cryptopp/blob/master/validat0.cpp#L1131). Here's what a typical failure looks like. Its the second failed test case from above.
```
try
{
const word128 v=1, b=0x08;
word128 r=RoundUpToMultipleOf(v, b);
fail = (r != b);
}
catch(const Exception&)
{
fail = true;
}
pass = !fail && pass;
std::cout << (fail ? "FAILED:" : "passed:") << " RoundUpToMultipleOf, word128, no overflow\n"
```
-----
```
[noloader@gcc1-power7 cryptopp]$ gcc --version
gcc (GCC) 4.8.3 20140911 (Red Hat 4.8.3-7)
Copyright (C) 2013 Free Software Foundation, Inc.
[noloader@gcc1-power7 cryptopp]$ uname -a
Linux gcc1-power7.osuosl.org 3.17.2-200.fc20.ppc64p7 #1 SMP Wed Feb 18 20:59:33 MST 2015 ppc64 ppc64 ppc64 GNU/Linux
[noloader@gcc1-power7 cryptopp]$ lsb_release -a
LSB Version: :core-4.1-noarch:core-4.1-ppc64:cxx-4.1-noarch:cxx-4.1-ppc64:desktop-4.1-noarch:desktop-4.1-ppc64:languages-4.1-noarch:languages-4.1-ppc64:printing-4.1-noarch:printing-4.1-ppc64
Distributor ID: Fedora
Description: Fedora release 20 (Heisenbug)
Release: 20
Codename: Heisenbug
``` | Fedora, POWER7 and RoundUpToMultipleOf failures | https://api.github.com/repos/weidai11/cryptopp/issues/421/comments | 2 | 2017-05-13T00:31:57Z | 2017-05-13T03:54:00Z | https://github.com/weidai11/cryptopp/issues/421 | 228,436,464 | 421 |
[
"weidai11",
"cryptopp"
] | This is a tracking issue to document Filename, Filetime and Comment support for Gzip.
Also see [Add Filename, Filetime and Comment support to Gzip?](https://groups.google.com/forum/#!topic/cryptopp-users/FB8b02N5utI) on the mailing list and [Pull Request 418](https://github.com/weidai11/cryptopp/pull/418). | Add Gzip Filename, Filetime and Comment support | https://api.github.com/repos/weidai11/cryptopp/issues/420/comments | 10 | 2017-05-12T19:23:12Z | 2017-05-16T14:04:29Z | https://github.com/weidai11/cryptopp/issues/420 | 228,384,868 | 420 |
[
"weidai11",
"cryptopp"
] | Built against 35451f3
Build logs:
[armv7l | GCC 5.4.0 | Ubuntu Xenial](https://build.getmonero.org/builders/kovri-all-ubuntu-arm7/builds/321/steps/compile/logs/stdio)
[aarch64 | GCC 6.2.1 | Debian 8](https://build.getmonero.org/builders/kovri-all-debian-arm8/builds/306/steps/compile/logs/stdio)
Successful build logs for remaining platforms:
https://github.com/monero-project/kovri/pull/639 | armv7l/aarch64: error: ‘HasRDRAND’ was not declared in this scope | https://api.github.com/repos/weidai11/cryptopp/issues/419/comments | 8 | 2017-05-11T18:02:14Z | 2017-09-16T22:39:30Z | https://github.com/weidai11/cryptopp/issues/419 | 228,074,338 | 419 |
[
"weidai11",
"cryptopp"
] | The constructor `BLAKE2_Base(bool treeMode, unsigned int digestSize)` uses an incorrect initialization block and produces wrong results if either treeMode or digestSize differ from default.
The patch is here:
[blake2-init-patch.zip](https://github.com/weidai11/cryptopp/files/991589/blake2-init-patch.zip)
In essense it replaces
`UncheckedSetKey(NULL, 0, g_nullNameValuePairs);`
with
`UncheckedSetKey(NULL, 0, MakeParameters(Name::DigestSize(), (int)digestSize)(Name::TreeMode(), treeMode, false));` | BLAKE2 produces wrong hashes for non-default digest sizes | https://api.github.com/repos/weidai11/cryptopp/issues/415/comments | 8 | 2017-05-11T01:00:53Z | 2017-05-11T04:14:55Z | https://github.com/weidai11/cryptopp/issues/415 | 227,850,744 | 415 |
[
"weidai11",
"cryptopp"
] | We started fuzzing library classes. Its dumb fuzzing, and all we do is generate a random string and send it into a filter like `Inflator` or `Gunzip`. (There's some smartness for some of the classes, like ensuring data is formatted and magics are present).
It looks like `Inflator` is having some trouble. The assert below was added when we noticed some odd behavior.
```
Testing Compressors and Decompressors...
Assertion failed: zinflate.cpp(554): DecodeBody
zinflate.cpp:561:69: runtime error: index 31 out of bounds for type 'unsigned int [30]'
passed: 128 zips and unzips
Assertion failed: zinflate.cpp(554): DecodeBody
Assertion failed: zinflate.cpp(554): DecodeBody
passed: 128 deflates and inflates
passed: 128 zlib decompress and compress
```
Running the test suite under Address Sanitizer with garbage/random data results in the following. It looks like we have an out-of-bounds read. Its not clear if there's an accompanying write, or if it can be controlled by an attacker.
```
Assertion failed: zinflate.cpp(554): DecodeBody
=================================================================
==16749==ERROR: AddressSanitizer: global-buffer-overflow on address 0x000000b5a7dc at pc 0x000000961356 bp 0x7ffd88929970 sp 0x7ffd88929960
READ of size 4 at 0x000000b5a7dc thread T0
#0 0x961355 in Inflator::DecodeBody() /home/cryptopp/zinflate.cpp:561
#1 0x95f539 in Inflator::ProcessInput(bool) /home/cryptopp/zinflate.cpp:354
#2 0x95ef69 in Inflator::Put2(unsigned char const*, unsigned long, int, bool) /home/cryptopp/zinflate.cpp:306
#3 0x69fa21 in BufferedTransformation::ChannelPut2(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned char const*, unsigned long, int, bool) /home/cryptopp/cryptlib.cpp:438
#4 0x872c70 in StringStore::CopyRangeTo2(BufferedTransformation&, unsigned long&, unsigned long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool) const /home/cryptopp/filters.cpp:1132
#5 0x8729d4 in StringStore::TransferTo2(BufferedTransformation&, unsigned long&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool) /home/cryptopp/filters.cpp:1122
#6 0x6a19c1 in BufferedTransformation::TransferMessagesTo2(BufferedTransformation&, unsigned int&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool) /home/cryptopp/cryptlib.cpp:590
#7 0x6a237b in BufferedTransformation::TransferAllTo2(BufferedTransformation&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool) /home/cryptopp/cryptlib.cpp:636
#8 0x4767d3 in SourceTemplate<StringStore>::PumpAll2(bool) /home/cryptopp/filters.h:1361
#9 0x4483dc in Source::PumpAll() /home/cryptopp/filters.h:1302
#10 0x448465 in Source::SourceInitialize(bool, NameValuePairs const&) /home/cryptopp/filters.h:1335
#11 0x52105d in StringSource::StringSource(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool, BufferedTransformation*) /home/cryptopp/filters.h:1404
#12 0x50e5cb in Test::TestCompressors() /home/cryptopp/validat0.cpp:90
#13 0x53bb05 in Test::ValidateAll(bool) /home/cryptopp/validat1.cpp:102
#14 0x43c09e in Validate(int, bool, char const*) /home/cryptopp/test.cpp:911
#15 0x433093 in main /home/cryptopp/test.cpp:401
#16 0x7f9468830400 in __libc_start_main (/lib64/libc.so.6+0x20400)
#17 0x4308a9 in _start (/home/cryptopp/cryptest.exe+0x4308a9)
0x000000b5a7dc is located 4 bytes to the right of global variable 'distanceStarts' defined in 'zinflate.cpp:504:29' (0xb5a760) of size 120
0x000000b5a7dc is located 36 bytes to the left of global variable 'distanceExtraBits' defined in 'zinflate.cpp:508:29' (0xb5a800) of size 120
SUMMARY: AddressSanitizer: global-buffer-overflow /home/cryptopp/zinflate.cpp:561 in Inflator::DecodeBody()
Shadow bytes around the buggy address:
0x0000801634a0: f9 f9 f9 f9 00 00 00 00 00 00 00 00 00 00 00 00
0x0000801634b0: 00 04 f9 f9 f9 f9 f9 f9 00 00 00 00 00 00 00 00
0x0000801634c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0000801634d0: 00 00 04 f9 f9 f9 f9 f9 00 00 00 00 00 00 00 00
0x0000801634e0: 00 00 00 00 00 00 04 f9 f9 f9 f9 f9 00 00 00 00
=>0x0000801634f0: 00 00 00 00 00 00 00 00 00 00 00[f9]f9 f9 f9 f9
0x000080163500: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 f9
0x000080163510: f9 f9 f9 f9 00 00 00 00 00 00 00 00 00 00 00 00
0x000080163520: 00 00 00 00 00 00 00 00 00 00 00 00 07 f9 f9 f9
0x000080163530: f9 f9 f9 f9 00 f9 f9 f9 f9 f9 f9 f9 07 f9 f9 f9
0x000080163540: f9 f9 f9 f9 00 00 00 00 00 03 f9 f9 f9 f9 f9 f9
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 right 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
Container overflow: fc
Array cookie: ac
Intra object redzone: bb
ASan internal: fe
Left alloca redzone: ca
Right alloca redzone: cb
==16749==ABORTING
```
-----
This issue has been assigned CVE-2017-9434 (thanks @carnil). The issue was announced on OSS-Security at [Crypto++ and invalid read in decompressor class](http://www.openwall.com/lists/oss-security/2017/06/06/2). | Zinflate and AddressSanitizer finding | https://api.github.com/repos/weidai11/cryptopp/issues/414/comments | 11 | 2017-05-10T21:00:45Z | 2017-08-25T14:47:06Z | https://github.com/weidai11/cryptopp/issues/414 | 227,809,212 | 414 |
[
"weidai11",
"cryptopp"
] | I just downloaded and built the library. Two questions:
1. It appears to be a fantastic library with tons of functionality, but the release version is nearly 30MB. Have project files been made available for limited functionality. Or perhaps a guide on figuring out which files I'd need? (I'm looking for a good hash--probably HD5--and encryption/decryption--probably AES.)
2. I'm getting some warnings under Visual Studio 2017. Are these known issues?
>d:\users\jonathan\desktop\cryptopp\wait.h(159): warning C4589: Constructor of abstract class 'CryptoPP::WaitObjectsTracer' ignores initializer for virtual base class 'CryptoPP::Tracer'
>d:\users\jonathan\desktop\cryptopp\wait.h(159): note: virtual base classes are only initialized by the most-derived type
>d:\users\jonathan\desktop\cryptopp\wait.h(159): warning C4589: Constructor of abstract class 'CryptoPP::WaitObjectsTracer' ignores initializer for virtual base class 'CryptoPP::Tracer'
>d:\users\jonathan\desktop\cryptopp\wait.h(159): note: virtual base classes are only initialized by the most-derived type
>d:\users\jonathan\desktop\cryptopp\wait.h(159): warning C4589: Constructor of abstract class 'CryptoPP::WaitObjectsTracer' ignores initializer for virtual base class 'CryptoPP::Tracer'
>d:\users\jonathan\desktop\cryptopp\wait.h(159): note: virtual base classes are only initialized by the most-derived type
>d:\users\jonathan\desktop\cryptopp\wait.h(159): warning C4589: Constructor of abstract class 'CryptoPP::WaitObjectsTracer' ignores initializer for virtual base class 'CryptoPP::Tracer'
>d:\users\jonathan\desktop\cryptopp\wait.h(159): note: virtual base classes are only initialized by the most-derived type
| Just built the library, but a few questions... | https://api.github.com/repos/weidai11/cryptopp/issues/413/comments | 2 | 2017-05-10T00:11:21Z | 2017-05-13T14:42:50Z | https://github.com/weidai11/cryptopp/issues/413 | 227,532,916 | 413 |
[
"weidai11",
"cryptopp"
] | config.h is included in public headers and enables and disables compiler warnings globally:
https://github.com/weidai11/cryptopp/blob/CRYPTOPP_5_6_5/config.h#L414
Maybe this block could be moved to some library-internal header like pch.h? Or alternatively, if it is meant to protect also the public headers when building user code, every public header should have a warning push/pop pair. | Crypto++ messes with user's warning config | https://api.github.com/repos/weidai11/cryptopp/issues/412/comments | 10 | 2017-05-09T16:16:10Z | 2017-08-03T04:43:50Z | https://github.com/weidai11/cryptopp/issues/412 | 227,420,712 | 412 |
[
"weidai11",
"cryptopp"
] | This issue will track the addition of Kalyna. Kalyna is a Ukrainian national cipher specified by DSTU 7624:2014. The cipher is interesting to Crypto++ because of the variable block sizes under a key. Variable block sizes are nothing new, but its our first attempt to implement them.
Also see [Issue 408, Add support for variable block sizes](https://github.com/weidai11/cryptopp/issues/408). | Add Kalyna block cipher | https://api.github.com/repos/weidai11/cryptopp/issues/411/comments | 0 | 2017-05-05T19:04:07Z | 2017-07-20T18:40:44Z | https://github.com/weidai11/cryptopp/issues/411 | 226,664,097 | 411 |
[
"weidai11",
"cryptopp"
] | The makefile has `make coverage` recipe to run the test vectors under [`gprof`](https://sourceware.org/binutils/docs/gprof/). We use it to see where we need to add self tests, and to a lesser extent, where bottlenecks are when adding new algorithms. After executing the recipe, we can navigate to `TestCoverage/index.html` for the results.
The recipe does not activate code paths deemed to be *"Debug"* routines. For example, from `validate.h`:
```
#if defined(CRYPTOPP_DEBUG) && !defined(CRYPTOPP_IMPORTS)
// http://github.com/weidai11/cryptopp/issues/92
bool TestSecBlock();
// http://github.com/weidai11/cryptopp/issues/64
bool TestPolynomialMod2();
// http://github.com/weidai11/cryptopp/issues/336
bool TestIntegerBitops();
// http://github.com/weidai11/cryptopp/issues/360
bool TestRounding();
// http://github.com/weidai11/cryptopp/issues/242
bool TestHuffmanCodes();
// http://github.com/weidai11/cryptopp/issues/346
bool TestASN1Parse();
#endif
```
Since we are interested in profiling data, we should include all code paths when running the recipe.
| Code Coverage recipe does not include all validation routines | https://api.github.com/repos/weidai11/cryptopp/issues/410/comments | 1 | 2017-05-04T23:47:28Z | 2017-05-04T23:50:20Z | https://github.com/weidai11/cryptopp/issues/410 | 226,438,809 | 410 |
[
"weidai11",
"cryptopp"
] | I have tried to implement Salsa20 in some code to learn more about cryptography. But, my code didn't end up outputting original plaintext. After many failed changes, I tried copy and pasting the whole sample code and compiling it (and of course, changed the includes). I got the same problem. I originally used the crypto++ from my package manager (apt on ubuntu 17.04), and tried many times cloning the library from github and compiling it from source, but no luck. Can anyone try compiling this sample please?
My build commands (using ubuntu's crypto++):
`g++ code.cpp -lcrypto++`
My build commands (using the one I built):
`g++ code.cpp libcryptopp.a` (I tried again pasting the code into the top of the repository, didn't touch includes here)
All the times I tried, I got something like:
`Plaintext: My Plaintext!! My Dear plaintext!!
Ciphertext: �ߡ[�j�V�S0j=���
��������z^M
Plaintext Again: 1�ߡ[�j�V�S0j=���
SALSA!
...20...`
And here in base64, if that helps:
`UGxhaW50ZXh0OiBNeSBQbGFpbnRleHQhISBNeSBEZWFyIHBsYWludGV4dCEhCkNpcGhlcnRleHQ6IDfQTw3P/Z2fqWW3jn7WRXe85+36Z1YxgyMXmPWKz93wpDMKUGxhaW50ZXh0IEFnYWluOiAAAAAAAAAxAAAAAAAAADfQTw3P/Z2fqWW3jn7WRXe85+36CgoKU0FMU0EhCgogICAgIC4uLjIwLi4uCg==`
Sample from here [https://www.cryptopp.com/wiki/Salsa20](url) | Salsa20 sample from wiki does not decrypt original plaintext message | https://api.github.com/repos/weidai11/cryptopp/issues/409/comments | 2 | 2017-05-03T07:42:09Z | 2017-08-26T17:03:46Z | https://github.com/weidai11/cryptopp/issues/409 | 225,905,535 | 409 |
[
"weidai11",
"cryptopp"
] | This ticket tracks support for variable sizes. Variable block sizes are becoming increasing popular in modern block ciphers. We need the support Threefish and Kalyna.
Also see [Block Ciphers and variable block sizes](https://groups.google.com/forum/#!topic/cryptopp-users/EdQqu0ts5UM) on the mailing list. | Add support for variable block sizes | https://api.github.com/repos/weidai11/cryptopp/issues/408/comments | 1 | 2017-05-02T20:20:41Z | 2018-01-04T13:16:21Z | https://github.com/weidai11/cryptopp/issues/408 | 225,809,586 | 408 |
[
"weidai11",
"cryptopp"
] | clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c cryptlib.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c cpu.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c integer.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c seal.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c gzip.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c fips140.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c twofish.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c eprecomp.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c dsa.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c dh.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c filters.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c vmac.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c hrtimer.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c blake2.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c fipstest.cpp
In file included from fipstest.cpp:9:
In file included from ./dll.h:37:
./pkcspad.h:86:53: warning: instantiation of variable
'CryptoPP::PKCS_DigestDecoration<CryptoPP::SHA1>::decoration' required here, but
no definition is available [-Wundefined-var-template]
...return HashIdentifier(PKCS_DigestDecoration<H>::decoration, PKCS_DigestDecorati...
^
./pubkey.h:596:19: note: in instantiation of member function
'CryptoPP::PKCS1v15_SignatureMessageEncodingMethod::HashIdentifierLookup::HashIdentifierLookup2<CryptoPP::SHA1>::Lookup'
requested here
return L::Lookup();
^
./pubkey.h:1989:26: note: in instantiation of member function
'CryptoPP::TF_ObjectImplBase<CryptoPP::TF_SignerBase,
CryptoPP::TF_SignatureSchemeOptions<CryptoPP::TF_SS<CryptoPP::RSA,
CryptoPP::PKCS1v15, CryptoPP::SHA1, int>, CryptoPP::RSA,
CryptoPP::PKCS1v15_SignatureMessageEncodingMethod, CryptoPP::SHA1>,
CryptoPP::InvertibleRSAFunction>::GetHashIdentifier' requested here
class CRYPTOPP_NO_VTABLE PK_FinalTemplate : public BASE
^
fipstest.cpp:577:3: note: in instantiation of function template specialization
'CryptoPP::SignatureKnownAnswerTest<CryptoPP::RSASS<CryptoPP::PKCS1v15,
CryptoPP::SHA1> >' requested here
SignatureKnownAnswerTest<RSASS<PKCS1v15, SHA1> >(
^
./pkcspad.h:37:20: note: forward declaration of template entity is here
static const byte decoration[];
^
1 warning generated.
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c rc5.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c mars.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c md4.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c osrng.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c queue.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c xtrcrypt.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c gf256.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c cmac.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c authenc.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c des.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c idea.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c gcm.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c squaretb.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c xtr.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c emsa2.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c sha.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c network.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c eax.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c tea.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c gf2_32.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c tigertab.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c square.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c dessp.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c algparam.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c elgamal.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c mqueue.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c zlib.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c dh2.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c strciphr.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c iterhash.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c ecp.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c marss.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c adler32.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c wait.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c safer.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c base32.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c wake.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c gf2n.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c default.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c rc2.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c chacha.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c oaep.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c ida.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c shark.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c md5.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c shacal2.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c base64.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c arc4.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c misc.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c ripemd.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c camellia.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c pubkey.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c zdeflate.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c trdlocal.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c salsa.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c luc.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c ttmac.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c crc.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c mqv.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c bfinit.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c whrlpool.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c asn.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c rw.cpp
rw.cpp:17:19: warning: unused variable 'CRYPTOPP_RW_USE_OMP' [-Wunused-const-variable]
static const bool CRYPTOPP_RW_USE_OMP = false;
^
1 warning generated.
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c cast.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c tiger.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c rng.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c zinflate.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c pssr.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c algebra.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c rdrand.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c pkcspad.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c rc6.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c channels.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c basecode.cpp
In file included from basecode.cpp:16:
./basecode.h:103:6: warning: private field 'm_padding' is not used
[-Wunused-private-field]
int m_padding, m_bitsPerChar, m_outputBlockSize;
^
1 warning generated.
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c blumshub.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c polynomi.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c ec2n.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c dll.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c poly1305.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c md2.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c gfpcrypt.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c esign.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c gost.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c casts.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c modes.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c sha3.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c panama.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c nbtheory.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c socketft.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c ccm.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c eccrypto.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c cbcmac.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c rdtables.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c rsa.cpp
In file included from rsa.cpp:4:
In file included from ./rsa.h:14:
./pkcspad.h:86:53: warning: instantiation of variable
'CryptoPP::PKCS_DigestDecoration<CryptoPP::SHA1>::decoration' required here, but
no definition is available [-Wundefined-var-template]
...return HashIdentifier(PKCS_DigestDecoration<H>::decoration, PKCS_DigestDecorati...
^
./pubkey.h:596:19: note: in instantiation of member function
'CryptoPP::PKCS1v15_SignatureMessageEncodingMethod::HashIdentifierLookup::HashIdentifierLookup2<CryptoPP::SHA1>::Lookup'
requested here
return L::Lookup();
^
./pubkey.h:1989:26: note: in instantiation of member function
'CryptoPP::TF_ObjectImplBase<CryptoPP::TF_SignerBase,
CryptoPP::TF_SignatureSchemeOptions<CryptoPP::TF_SS<CryptoPP::RSA,
CryptoPP::PKCS1v15, CryptoPP::SHA1, int>, CryptoPP::RSA,
CryptoPP::PKCS1v15_SignatureMessageEncodingMethod, CryptoPP::SHA1>,
CryptoPP::InvertibleRSAFunction>::GetHashIdentifier' requested here
class CRYPTOPP_NO_VTABLE PK_FinalTemplate : public BASE
^
./pkcspad.h:37:20: note: forward declaration of template entity is here
static const byte decoration[];
^
1 warning generated.
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c tftables.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c sosemanuk.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c 3way.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c rabin.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c keccak.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c serpent.cpp
clang++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -fPIC -Wall -c aria.cpp
aria.cpp:288:21: error: always_inline function '_mm_shuffle_epi8' requires target
feature 'ssse3', but would be inlined into function 'UncheckedSetKey' that is
compiled without support for 'ssse3'
const __m128i w = _mm_shuffle_epi8(_mm_loadu_si128((const __m12...
^
aria.cpp:298:5: error: always_inline function '_mm_shuffle_epi8' requires target
feature 'ssse3', but would be inlined into function 'UncheckedSetKey' that is
compiled without support for 'ssse3'
_mm_shuffle_epi8(_mm_loadu_si128((const __m128i...
^
aria.cpp:566:5: error: always_inline function '_mm_shuffle_epi8' requires target
feature 'ssse3', but would be inlined into function 'ProcessAndXorBlock' that is
compiled without support for 'ssse3'
_mm_shuffle_epi8(_mm_load_si128((const __m128i*...
^
3 errors generated.
make: *** [GNUmakefile-cross:266: aria.o] Error 1
| Build Failure | https://api.github.com/repos/weidai11/cryptopp/issues/407/comments | 3 | 2017-04-30T01:42:57Z | 2017-05-02T12:15:19Z | https://github.com/weidai11/cryptopp/issues/407 | 225,297,639 | 407 |
[
"weidai11",
"cryptopp"
] | The password_hash and password_verify PHP functions provide a simple to use interface, could an interface like this be added to crypto++ as well (for those of us stuck with passwords)?
A tutorial to properly use the currently available classes for password hashing might be nice as well, as getting it right appears to be hard.
http://php.net/manual/en/book.password.php | Password hashing support / tutorial | https://api.github.com/repos/weidai11/cryptopp/issues/406/comments | 1 | 2017-04-28T13:40:17Z | 2017-04-28T16:10:37Z | https://github.com/weidai11/cryptopp/issues/406 | 225,084,020 | 406 |
[
"weidai11",
"cryptopp"
] | Compiling 5.6.5 with g++ (Ubuntu 6.3.0-12ubuntu2) 6.3.0 20170406 when i type "make" command appears that warnings
```
default.cpp: In constructor ‘CryptoPP::DefaultEncryptorWithMAC::DefaultEncryptorWithMAC(const char*, CryptoPP::BufferedTransformation*)’:
default.cpp:220:39: warning: ‘DefaultEncryptor’ is deprecated: 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));
^~~~~~~~~~~~~~~~
In file included from default.cpp:13:0:
default.h:29:7: note: declared here
class DefaultEncryptor : public ProxyFilter
^~~~~~~~~~~~~~~~
default.cpp: In constructor ‘CryptoPP::DefaultEncryptorWithMAC::DefaultEncryptorWithMAC(const byte*, size_t, CryptoPP::BufferedTransformation*)’:
default.cpp:227:39: warning: ‘DefaultEncryptor’ is deprecated: 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));
^~~~~~~~~~~~~~~~
In file included from default.cpp:13:0:
default.h:29:7: note: declared here
class DefaultEncryptor : public ProxyFilter
^~~~~~~~~~~~~~~~
default.cpp: In constructor ‘CryptoPP::DefaultDecryptorWithMAC::DefaultDecryptorWithMAC(const char*, CryptoPP::BufferedTransformation*, bool)’:
default.cpp:243:16: warning: ‘DefaultDecryptor’ is deprecated: 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));
^~~~~~~~~~~~~~~~
In file included from default.cpp:13:0:
default.h:57:7: note: declared here
class DefaultDecryptor : public ProxyFilter
^~~~~~~~~~~~~~~~
default.cpp: In constructor ‘CryptoPP::DefaultDecryptorWithMAC::DefaultDecryptorWithMAC(const byte*, size_t, CryptoPP::BufferedTransformation*, bool)’:
default.cpp:251:16: warning: ‘DefaultDecryptor’ is deprecated: 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));
^~~~~~~~~~~~~~~~
In file included from default.cpp:13:0:
default.h:57:7: note: declared here
class DefaultDecryptor : public ProxyFilter
^~~~~~~~~~~~~~~~
default.cpp: In member function ‘CryptoPP::DefaultDecryptor::State CryptoPP::DefaultDecryptorWithMAC::CurrentState() const’:
default.cpp:256:44: warning: ‘DefaultDecryptor’ is deprecated: 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();
^
In file included from default.cpp:13:0:
default.h:57:7: note: declared here
class DefaultDecryptor : public ProxyFilter
^~~~~~~~~~~~~~~~
``` | Compilation Warnings | https://api.github.com/repos/weidai11/cryptopp/issues/404/comments | 1 | 2017-04-27T17:19:03Z | 2017-04-27T19:57:43Z | https://github.com/weidai11/cryptopp/issues/404 | 224,854,858 | 404 |
[
"weidai11",
"cryptopp"
] | See [Coredump in cryptest.exe on Solaris 10](https://groups.google.com/d/msg/cryptopp-users/OYaByDEbSI0/624NTaBmBQAJ) on the mailing list and [Pull Request 402](https://github.com/weidai11/cryptopp/pull/402). Multiple self tests fail when `data` is read as a `word64`. Alignment appears to be OK.
The unusual thing is, `memcpy`-out the `data` parameter to a `word64` clears some of the issues. But the debugger shows the `data` parameter is aligned (from the core dump):
```
Testing MessageDigest algorithm SHA-384.
..signal BUS (invalid address alignment) in CryptoPP::SHA512::Transform at line 1762 in file "sha.cpp"
1762 R( 0); R( 1); R( 2); R( 3);^M
(dbx) where
=>[1] CryptoPP::SHA512::Transform(state = 0x101167a08, data = 0xffffffff7fffa68c), line 1762 in "sha.cpp"
[2] CryptoPP::SHA384::Transform(digest = 0x101167a08, data = 0xffffffff7fffa68c), line 85 in "sha.h"
[3] CryptoPP::IteratedHashWithStaticTransform<unsigned long,CryptoPP::EnumToType<CryptoPP::ByteOrder,1>,128U,64U,CryptoPP::SHA384,48U,0>::HashEndianCorrectedBlock(this = 0x101167950, data = 0xffffffff7fffa68c), line 165 in "iterhash.h"
[4] CryptoPP::IteratedHashBase<unsigned long,CryptoPP::HashTransformation>::HashMultipleBlocks(this = 0x101167950, input = 0xffffffff7fffa68c, length = 2852U), line 94 in "iterhash.cpp"
...
```
| Solaris 10 and SIGBUS crashes in cryptest.exe | https://api.github.com/repos/weidai11/cryptopp/issues/403/comments | 7 | 2017-04-22T02:08:03Z | 2018-07-21T16:01:56Z | https://github.com/weidai11/cryptopp/issues/403 | 223,533,372 | 403 |
[
"weidai11",
"cryptopp"
] | Hello and really KUDOS 👍 for this nice library
I try to include cryptopp in my native electron (node js) module and i observed something weird. When i use the debug version of the library the following code works but when i build against the release version i get an "Electron has stopped working error". I attach the vcxproj of the module and my code. I really cant tell what is the matter and i would really like your help. If your require more info, i would gladly provide them :)
Addon vcxproj, vcxproj.filters, binding.sln
[build.zip](https://github.com/weidai11/cryptopp/files/945148/build.zip)
Command to issue the compilation of cryptlib.lib
"C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe" cryptlib.vcxproj /p:configuration="Release" /p:platform="Win32"
Partial Code (Ommited for bravety, i can upload the whole addon.cpp file if you need it)
[code.zip](https://github.com/weidai11/cryptopp/files/945173/code.zip)
Regards | [Debug ok, Release no] Help with electron native module | https://api.github.com/repos/weidai11/cryptopp/issues/401/comments | 1 | 2017-04-20T18:45:50Z | 2017-04-21T08:21:28Z | https://github.com/weidai11/cryptopp/issues/401 | 223,162,271 | 401 |
[
"weidai11",
"cryptopp"
] | version 5.6.5
gcc 4.9.4
#395 solve this problem?
I must disable DISABLE_NATIVE_ARCH to make success
-----
1.cmake -DDISABLE_NATIVE_ARCH=TRUE
2.make -f Makefile | linux Assembler error: no such instruction | https://api.github.com/repos/weidai11/cryptopp/issues/400/comments | 5 | 2017-04-19T11:10:15Z | 2017-09-16T22:39:39Z | https://github.com/weidai11/cryptopp/issues/400 | 222,702,011 | 400 |
[
"weidai11",
"cryptopp"
] | Thanks for your hard work on this library!
Argon2 winning the [PHC](https://password-hashing.net/) made it a great choice for a memory hard KDF. BLAKE2 is already implemented here so I think it would be a bit less work than a fresh implementation.
I've found some useful writeups [here](https://wiki.mozilla.org/NSS/ARGON2) although there doesn't seem to be any work in the past couple months. | Argon2 support | https://api.github.com/repos/weidai11/cryptopp/issues/399/comments | 3 | 2017-04-18T05:36:58Z | 2021-04-25T17:23:44Z | https://github.com/weidai11/cryptopp/issues/399 | 222,307,366 | 399 |
[
"weidai11",
"cryptopp"
] | Hi,
I did the global benchmark: “cryptest.exe b 3 2.0 > benchmark.html”.
I want to know how to do a benchmark of the all MAC(message authentication code) algorithms: HMAC, CMAC, GMAC, VMAC, … , and its variants (HMAC: HMAC-SHA-1, HMAC-SHA-224, HMAC-SHA-256, HMAC-SHA-384 and HMAC-SHA-512).
I added some lines, in bench1.cpp file, to have all the MAC statistics, but the Benchmark stopped with an exception message (“CryptoPP::Exception caught: ObjectFactoryRegistry: could not find factory for algorithm HMAC(SHA265)”).
I want to do a performance comparison to choose the right MAC algorithm for my Ad Hoc network(OLSR protocol).
Thanks in advance. | MAC Benchmark | https://api.github.com/repos/weidai11/cryptopp/issues/396/comments | 2 | 2017-03-25T00:11:18Z | 2017-03-25T13:38:30Z | https://github.com/weidai11/cryptopp/issues/396 | 216,933,161 | 396 |
[
"weidai11",
"cryptopp"
] | System info:
- OpenBSD 6.0 (GENERIC)
- cpu0: Intel(R) Xeon(R) CPU E5-1650 v2 @ 3.50GHz, 3500.59 MHz
- cpu0: FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,SSE3,PCLMUL,MWAIT,SSSE3,CX16,SSE4.1,SSE4.2,POPCNT,AES,XSAVE,AVX,RDRAND,NXE,LONG,LAHF,ITSC
Notes:
- Only producible with egcc/eg++ 4.9.3 (no errors with other tested compilers: clang 3.8 or gcc 4.2.1)
- `-DDISABLE_ASM=ON` reduced number of errors but the issue still remains
- **`-DDISABLE_NATIVE_ARCH=ON` patches the issue** (I imagine env exporting from cli will also work)
Build:
- Built against f502ee9218c3a090920bc1584334a3a8e3fbb043
- [Cryptopp-f502ee9-OpenBSD-build-error.CMake.log.txt](https://github.com/weidai11/cryptopp/files/856184/Cryptopp-f502ee9-OpenBSD-build-error.CMake.log.txt)
- [cryptest-result.txt](https://github.com/weidai11/cryptopp/files/856211/cryptest-result.txt)
| OpenBSD (egcc/eg++): Assembler error: no such instruction | https://api.github.com/repos/weidai11/cryptopp/issues/395/comments | 9 | 2017-03-20T20:04:34Z | 2017-03-28T00:30:14Z | https://github.com/weidai11/cryptopp/issues/395 | 215,539,016 | 395 |
[
"weidai11",
"cryptopp"
] | The review of API/ABI changes for Crypto++ since 5_5_2 version: https://abi-laboratory.pro/tracker/timeline/cryptopp/
The report is updated 3 times a week. Hope it will be helpful for users and maintainers of the library.
Created with the help of open-source abi-tracker tool: https://github.com/lvc/abi-tracker
Thank you.


| API/ABI changes review for Crypto++ | https://api.github.com/repos/weidai11/cryptopp/issues/393/comments | 5 | 2017-03-20T07:55:10Z | 2018-07-13T13:48:26Z | https://github.com/weidai11/cryptopp/issues/393 | 215,349,105 | 393 |
[
"weidai11",
"cryptopp"
] | On windows `NonblockingRng::GenerateBlock` initializes a static reference to the `MicrosoftCryptoProvider` (see [osrng.cpp](/weidai11/cryptopp/blob/CRYPTOPP_5_6_5/osrng.cpp#L153)). This can lead to a crash when the code was compiled with Visual Studio 2013 because local static variables are not thread-safe, as mentioned in #372. | Crash in NonblockingRng::GenerateBlock | https://api.github.com/repos/weidai11/cryptopp/issues/391/comments | 11 | 2017-03-14T15:36:58Z | 2017-03-16T00:04:46Z | https://github.com/weidai11/cryptopp/issues/391 | 214,112,596 | 391 |
[
"weidai11",
"cryptopp"
] | Hi,
I'd like to use crypto++. I am using Windows 7 (64 bit). The last days I have tried to build it using different Visual Studio versions but I did not have success. I'd like to describe the steps I did and ask for help what I did wrong.
- [Here](https://github.com/weidai11/cryptopp/issues/388#issuecomment-284732216) I read that building Crypto++ should work with Visual Studio 2012, so I downloaded and installed the "Microsoft Visual Studio 2012 Express" version.
- I [downloaded](https://www.cryptopp.com/#download) the cryptop++ version 5.6.5.
- I unzip crypto++ and open the _cryptest.sln_ file with Visual Studio 2012.
- VS2012 tells me that at least one of the projects is intended to be used with an older version of the Visual C++ Compiler and the respective libraries. It gives me the option to update the projects such that libraries and the compiler of VS2012 can be used.
- I agree to update the projects. (What I think happens now is that _Project-> Properties -> General -> Platform Toolset_ is set to _v110_).
- I choose I want to create a static library. According to the _Readme.txt_ I have to build _cryptest_ with the _Non-DLL-Import Configuration_ . According to the _Readme.txt_ there is also a _DLL-Import Configuration_. I don't know how I can choose in VS2012 which configuration to use. At the top in VS2012 I choose _x64_ (instead of _Win32_), _Release_ (instead of _Debug_) and and right-click on _cryptest_ and choose _build_.
- The output says that everything was successfull, including
> cryptest.vcxproj -> C:\cryptopp565\x64\Output\Release\cryptest.exe
> cryptlib.vcxproj -> C:\cryptopp565\x64\Output\Release\cryptlib.lib
Among others, the following was given in the output as well:
> cl : warning D9002: Unkown option "/arch:SSE2" will be ignored.
> elgamal.obj / dh.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library.
- I open cmd.exe, move to _C:\cryptopp565\x64\Output\Release_, copy the _TestData_ and _TestVector_ folders into this folder and execute _cryptest.exe v_. It ends with _All tests are passed!_.
- In VS2012 I create a new console application project. I copy [the sample code for AES encryption from this StackOverflow anser](http://stackoverflow.com/a/12307096/1219728) into my _ConsoleApplication.cpp_.
- As I understand it, I now have to include the header files of crypto++ and make the static library known to the project:
- I right-click on my _ConsoleApplication_ project and go to _Properties > Configuration Properties > VC++ Directories >Include Directories_. There I add _C:\cryptopp565_ (the folder where the headers are located).
- I right-click on my _ConsoleApplication_ project and go to _Properties > Configuration Properties > VC++ Directories >Library Directories_. There I add _C:\cryptopp565\x64\Output\Release_ (the folder where _cryptlib.lib_ is located).
- I right-click on my _ConsoleApplication_ project and go to _Properties > Configuration Properties > Linker > Input > Additional Dependencies_ . There I add _cryptlib.lib_ (which is in the folder stated one bullet point above).
- Now all the red markings in _ConsoleApplication.cpp_ disappear.
- I right-click on my _ConsoleApplication_ project and choose _build_. 50 errors are displayed in the output window. This is one of them (the rest have the same shape):
> error LNK2001: unresolved external symbol ""protected: virtual void __thiscall CryptoPP::CBC_Decryption::ResizeBuffers(void)" (?ResizeBuffers@CBC_Decryption@CryptoPP@@MAEXXZ)". C:\cryptopp565\ConsoleApplication\ConsoleApplication.obj ConsoleApplication
Does it mean that some definitions / implemenations for some header files are missing? Does more than the _cryptlib.lib_ file have to be included? How can this be fixed?
| Problem building and using Crypto++ on Windows | https://api.github.com/repos/weidai11/cryptopp/issues/390/comments | 3 | 2017-03-14T13:38:49Z | 2017-03-15T09:54:20Z | https://github.com/weidai11/cryptopp/issues/390 | 214,074,431 | 390 |
[
"weidai11",
"cryptopp"
] | Hello everyone,
I'm seeing valid race conditions reported by valgrind (both helgrind and drd):
```
==11362== Conflicting load by thread 2 at 0x0113e540 size 8
==11362== at 0xXXXXXXX: CryptoPP::InitializeInteger::InitializeInteger() (integer.cpp:2874)
==11362== by 0xXXXXXX: CryptoPP::Integer::Integer() (integer.cpp:2897)
```
The offending code seems to be a singleton-like initialization:
```
InitializeInteger::InitializeInteger()
{
if (!g_pAssignIntToInteger)
{
SetFunctionPointers();
g_pAssignIntToInteger = (CryptoPP::PAssignIntToInteger)AssignIntToInteger;
}
}
```
The g_pAssignIntToInteger pointer is also used at algparam.h:455:
```
void AssignValue(const char *name, const std::type_info &valueType, void *pValue) const
{
// special case for retrieving an Integer parameter when an int was passed in
if (!(g_pAssignIntToInteger != NULL && typeid(T) == typeid(int) && g_pAssignIntToInteger(valueType, pValue, &m_value)))
{
///... *snip*
}
}
```
That's obviously not thread safe. Stores can be reordered/and or partial unless they are explicitly atomic. Is there some reasoning behind the unprotected use of g_pAssignIntToInteger in AssignValue?
| Race condition in InitializeInteger::InitializeInteger | https://api.github.com/repos/weidai11/cryptopp/issues/389/comments | 3 | 2017-03-14T06:04:03Z | 2017-03-25T20:59:06Z | https://github.com/weidai11/cryptopp/issues/389 | 213,976,765 | 389 |
[
"weidai11",
"cryptopp"
] | Windows 7, MSVC 2013
```
rdrand.cpp(289) : error C2664: 'int _rdseed32_step(unsigned int *)' : cannot convert argument 1 from 'unsigned __int64 *' to 'unsigned int *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
```
the line is:
```c++
while(!_rdseed32_step(reinterpret_cast<unsigned long long*>(output))) {}
```
use `_rdseed64_step` or `reinterpret_cast<unsigned long*>` instead?
| Build Broken | https://api.github.com/repos/weidai11/cryptopp/issues/388/comments | 3 | 2017-03-07T13:13:34Z | 2017-03-08T08:26:52Z | https://github.com/weidai11/cryptopp/issues/388 | 212,428,682 | 388 |
[
"weidai11",
"cryptopp"
] | While testing code for the upcoming [Add Random Number Generator benchmarks](https://github.com/weidai11/cryptopp/issues/386), RDRAND and RDSEED performance seemed to be lack luster. The generators were not producing streams at the expected rates.
Naively, we thought RDRAND and RDSEED would produce a machine sized random word every 5 to 10 cycles (there's some book-keeping overhead in the loop). We also thought RDRAND and RDSEED would perform at about the same rate (modulo an occasional RDSEED failure).
We have come to find out both were wrong. After examining the behavior and generated code, there were a handful of observations:
* Retry overhead and book-keeping contributed about 40% of the high level C++ code overall
* Exception frame setup and tear down in GenerateBlock contributed about 70% of the [compiler generated] ASM code in GenerateBlock
* It was more efficient to retry a failed gen immediately rather than trying to track it through a variable like "m_retires"
* Helper function return codes and associated logic could be removed if the generator always fulfilled the request
Retrying immediately and removing exceptions from GenerateBlock improved performance by about 50%. In addition, users no longer have to worry about a failed request because the number of retries was wrong. Related, see [CryptoPP::Exception [due to RDSEED]](https://groups.google.com/forum/#!msg/cryptopp-users/SfAlNbw14Eo/YOO1uvQ9CQAJ) on the user list and [Commit 0059f486ad0467d5, "Changed RDSEED to use alternate ctor. Added comments about number of retries for RDRAND and RDSEED"](https://github.com/weidai11/cryptopp/commit/0059f486ad0467d5c4dc692db99a5a5f96c2a733). | Improve RDRAND and RDSEED performance | https://api.github.com/repos/weidai11/cryptopp/issues/387/comments | 1 | 2017-03-07T08:55:01Z | 2017-03-08T03:40:22Z | https://github.com/weidai11/cryptopp/issues/387 | 212,367,686 | 387 |
[
"weidai11",
"cryptopp"
] | This fell out of a [conversation on Stack Overflow](https://stackoverflow.com/questions/26771329/is-there-any-legitimate-use-for-intels-rdrand/33090047?noredirect=1#comment72217241_33090047). Crypto++ does not perform RNG benchmarks. In addition, <strike>Botan and</strike> OpenSSL does not offer a way to test RNG throughput in their respective tools.
In the big picture, I am interested in learning how well RDRAND and RDSEED performs against other generators, like those provided by the OS in `BlockingRNG` and `NonblockingRNG`. I'm also curious about OpenSSL's `md5_rand` (used by default), and the Kernel's proposal to use ChaCha and SipHash based generators for `/dev/urandom` (the kernel claims equivalent security and improved speed/efficiency).
RDRAND and RDSEED seem especially tricky to test. David Johnston of Intel suggested we test RDRAND and RDSEED with [Colin King's StressNG](https://www.google.com/search?q=Colin+King+StressNG). | Add Random Number Generator benchmarks | https://api.github.com/repos/weidai11/cryptopp/issues/386/comments | 1 | 2017-03-07T08:34:53Z | 2017-03-08T22:44:23Z | https://github.com/weidai11/cryptopp/issues/386 | 212,363,556 | 386 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.