### Install Crypto++ using Vcpkg Source: https://github.com/weidai11/cryptopp/blob/master/Install.txt These commands outline the process to download and install the Crypto++ library using the Vcpkg dependency manager. It involves cloning the Vcpkg repository, bootstrapping it, and then integrating and installing packages. ```bash git clone https://github.com/Microsoft/vcpkg.git cd vcpkg ./bootstrap-vcpkg.sh ./vcpkg integrate install ``` -------------------------------- ### Build and Install Crypto++ Library Source: https://github.com/weidai11/cryptopp/blob/master/Install.txt This sequence of commands builds the static Crypto++ library and the `cryptest.exe` program, runs tests, and then installs the library system-wide. It uses default sane flags like "-DNDEBUG -g2 -O3 -fPIC". ```bash make make test sudo make install ``` -------------------------------- ### Install Crypto++ to a Custom Directory Source: https://github.com/weidai11/cryptopp/blob/master/Install.txt This command installs the Crypto++ library to a user-specified directory, such as `/usr/local`. It is recommended to build with '-DCRYPTOPP_DATA_DIR='\"$PREFIX/share/cryptopp/\"'' to ensure `cryptest.exe` can locate test data files and vectors after installation. ```Makefile make install PREFIX=/usr/local ``` -------------------------------- ### Install Crypto++ with vcpkg Source: https://github.com/weidai11/cryptopp/blob/master/Install.txt This command installs the Crypto++ library using the vcpkg package manager. The vcpkg port is actively maintained by Microsoft and community contributors, ensuring it is kept up to date. ```Bash ./vcpkg install cryptopp ``` -------------------------------- ### Symbolize Asan Failures with Path Replacement Source: https://github.com/weidai11/cryptopp/blob/master/Install.txt Command to run Crypto++ validation tests, replace old paths with new ones using `sed` if the Crypto++ installation has moved, and then symbolize Address Sanitizer failures. ```Shell ./cryptest.exe v 2>&1 | sed "s///g" | asan_symbolize ``` -------------------------------- ### Crypto++ GNU Makefile Targets Source: https://github.com/weidai11/cryptopp/blob/master/Install.txt This section provides an overview of common targets available in the Crypto++ GNU makefile for various build, test, installation, and distribution operations. These targets allow users to build static or dynamic libraries, run tests, clean build artifacts, and prepare distribution packages. ```Makefile make ``` ```Makefile make libcryptopp.a ``` ```Makefile make static ``` ```Makefile make libcryptopp.so ``` ```Makefile make dynamic ``` ```Makefile make cryptest.exe ``` ```Makefile make test ``` ```Makefile make check ``` ```Makefile make install ``` ```Makefile make clean ``` ```Makefile make disclean ``` ```Makefile make dist ``` ```Makefile make zip ``` ```Makefile make iso ``` ```Makefile make ubsan ``` ```Makefile make asan ``` -------------------------------- ### Symbolize Address Sanitizer (Asan) Failures Source: https://github.com/weidai11/cryptopp/blob/master/Install.txt Command to run Crypto++ validation tests and pipe the output through `asan_symbolize` to get more detailed information about Address Sanitizer failures. ```Shell ./cryptest.exe v 2>&1 | asan_symbolize ``` -------------------------------- ### RSASSA-PSS Signature Example 5.2 - Verify Source: https://github.com/weidai11/cryptopp/blob/master/TestVectors/rsa_pss.txt Details the message, salt, and expected signature for RSASSA-PSS Example 5.2, specifically for signature verification. ```Hexadecimal Data Test: Verify Comment: RSASSA-PSS Signature Example 5.2 Message: e7 b3 2e 15 56 ea 1b 27 95 04 6a c6 97 39 d2 2a c8 96 6b f1 1c 11 6f 61 4b 16 67 40 e9 6b 90 65 3e 57 50 94 5f cf 77 21 86 c0 37 90 a0 7f da 32 3e 1a 61 91 6b 06 ee 21 57 db 3d ff 80 d6 7d 5e 39 a5 3a e2 68 c8 f0 9e d9 9a 73 20 05 b0 bc 6a 04 af 4e 08 d5 7a 00 e7 20 1b 30 60 ef aa db 73 11 3b fc 08 7f d8 37 09 3a a2 52 35 b8 c1 49 f5 62 15 f0 31 c2 4a d5 bd e7 f2 99 60 df 7d 52 40 70 f7 44 9c 6f 78 50 84 be 1a 0f 73 30 47 f3 36 f9 15 47 38 67 45 47 db 02 a9 f4 4d fc 6e 60 30 10 81 e1 ce 99 84 7f 3b 5b 60 1f f0 6b 4d 57 76 a9 74 0b 9a a0 d3 40 58 fd 3b 90 6e 4f 78 59 df b0 7d 71 73 e5 e6 f6 35 0a da c2 1f 27 b2 30 74 69 Salt: bd 0c e1 95 49 d0 70 01 20 cb e5 10 77 db bb b0 0a 8d 8b 09 Signature: 08 18 0d e8 25 e4 b8 b0 14 a3 2d a8 ba 76 15 55 92 12 04 f2 f9 0d 5f 24 b7 12 90 8f f8 4f 3e 22 0a d1 79 97 c0 dd 6e 70 66 30 ba 3e 84 ad d4 d5 e7 ab 00 4e 58 07 4b 54 97 09 56 5d 43 ad 9e 97 b5 a7 a1 a2 9e 85 b9 f9 0f 4a af cd f5 83 21 de 8c 59 74 ef 9a bf 2d 52 6f 33 c0 f2 f8 2e 95 d1 58 ea 6b 81 f1 73 6d b8 d1 af 3d 6a c6 a8 3b 32 d1 8b ae 0f f1 b2 fe 27 de 4c 76 ed 8c 79 80 a3 4e ``` -------------------------------- ### RSASSA-PSS Signature Example 5.1 - KeyPairValidAndConsistent & Verify Source: https://github.com/weidai11/cryptopp/blob/master/TestVectors/rsa_pss.txt Provides the message, salt, and expected signature for RSASSA-PSS Example 5.1. This example includes a test for key pair validity and consistency, followed by a signature verification test. ```Hexadecimal Data Test: KeyPairValidAndConsistent Comment: RSASSA-PSS Signature Example 5.1 Message: 30 c7 d5 57 45 8b 43 6d ec fd c1 4d 06 cb 7b 96 b0 67 18 c4 8d 7d e5 74 82 a8 68 ae 7f 06 58 70 a6 21 65 06 d1 1b 77 93 23 df df 04 6c f5 77 51 29 13 4b 4d 56 89 e4 d9 c0 ce 1e 12 d7 d4 b0 6c b5 fc 58 20 de cf a4 1b af 59 bf 25 7b 32 f0 25 b7 67 9b 44 5b 94 99 c9 25 55 14 58 85 99 2f 1b 76 f8 48 91 ee 4d 3b e0 f5 15 0f d5 90 1e 3a 4c 8e d4 3f d3 6b 61 d0 22 e6 5a d5 00 8d bf 33 29 3c 22 bf bf d0 73 21 f0 f1 d5 fa 9f df 00 14 c2 fc b0 35 8a ad 0e 35 4b 0d 29 Salt: 08 1b 23 3b 43 56 77 50 bd 6e 78 f3 96 a8 8b 9f 6a 44 51 51 Signature: 0b a3 73 f7 6e 09 21 b7 0a 8f bf e6 22 f0 bf 77 b2 8a 3d b9 8e 36 10 51 c3 d7 cb 92 ad 04 52 91 5a 4d e9 c0 17 22 f6 82 3e eb 6a df 7e 0c a8 29 0f 5d e3 e5 49 89 0a c2 a3 c5 95 0a b2 17 ba 58 59 08 94 95 2d e9 6f 8d f1 11 b2 57 52 15 da 6c 16 15 90 c7 45 be 61 24 76 ee 57 8e d3 84 ab 33 e3 ec e9 74 81 a2 52 f5 c7 9a 98 b5 53 2a e0 0c dd 62 f2 ec c0 cd 1b ae fe 80 d8 0b 96 21 93 ec 1d ``` -------------------------------- ### RSASSA-PSS Signature Example 5.3 - Verify Source: https://github.com/weidai11/cryptopp/blob/master/TestVectors/rsa_pss.txt Presents the message, salt, and expected signature for RSASSA-PSS Example 5.3, intended for signature verification. ```Hexadecimal Data Test: Verify Comment: RSASSA-PSS ``` -------------------------------- ### Build Crypto++ Shared and Static Libraries Source: https://github.com/weidai11/cryptopp/blob/master/Install.txt These commands build both the static library (`libcryptopp.a`) and the shared object (`libcryptopp.so`) along with the `cryptest.exe` program. Choose either syntax to achieve the same result. ```bash make static dynamic cryptest.exe ``` ```bash make libcryptopp.a libcryptopp.so cryptest.exe ``` -------------------------------- ### Build with UBSan and Run Validation Tests Source: https://github.com/weidai11/cryptopp/blob/master/Install.txt This command sequence builds the Crypto++ library with the Undefined Behavior sanitizer (UBSan) enabled, then executes the validation test harness. The output is piped through `grep` to filter for error or failed messages, aiding in the identification of runtime issues. ```Bash make ubsan ./cryptest.exe v 2>&1 | grep -E "(error:|FAILED)" ``` -------------------------------- ### Run Crypto++ Test Vector Suite Source: https://github.com/weidai11/cryptopp/blob/master/Install.txt Executes the Crypto++ test vector suite (`cryptest.exe tv all`) which uses many known test vectors to verify algorithms. The tail of the output should indicate 0 failed tests. ```Shell ./cryptest.exe tv all ``` -------------------------------- ### Override All CXXFLAGS for Crypto++ Build Source: https://github.com/weidai11/cryptopp/blob/master/Install.txt This command demonstrates how to completely override the `CXXFLAGS` variable, preventing the makefile from adding any additional flags. In this example, only `-std=c++11` will be used. ```bash make CXXFLAGS="-std=c++11" ``` -------------------------------- ### Prepare and Execute Coverity Scan Build Source: https://github.com/weidai11/cryptopp/blob/master/TestScripts/coverity-linux.txt This sequence of commands prepares the build environment by cleaning previous builds, then invokes `cov-build` to capture the compilation process of the Crypto++ library using `make` with 2 parallel jobs. It notes that specific CXXFLAGS are often used for testing. ```bash reset make distclean &>/dev/null # Usually we test with these flags # CXXFLAGS="-DNDEBUG -g3 -O2" cov-build --dir cov-int make -j 2 ``` -------------------------------- ### Run Crypto++ Tests and Filter Errors Source: https://github.com/weidai11/cryptopp/blob/master/Install.txt Commands to execute Crypto++ tests (`cryptest.exe`) and filter the output for error or FAILED messages using `grep`. The second set of commands includes building with Address Sanitizer (Asan) before running tests. ```Shell ./cryptest.exe tv all 2>&1 | grep -E "(error:|FAILED)" ``` ```Shell make asan ./cryptest.exe v 2>&1 | grep -E "(error:|FAILED)" ./cryptest.exe tv all 2>&1 | grep -E "(error:|FAILED)" ``` -------------------------------- ### RSASSA-PSS Signature Example 9.6 Test Vector Source: https://github.com/weidai11/cryptopp/blob/master/TestVectors/rsa_pss.txt This snippet provides another test vector for RSASSA-PSS signature verification, including the message, salt, and the expected signature in hexadecimal format. Similar to the previous example, 'Test: Verify' indicates that this signature should successfully verify against the corresponding public key and message, following the specifications of Example 9.6. ```Hexadecimal Message: \ 1b dc 6e 7c 98 fb 8c f5 4e 9b 09 7b 66 a8 31 e9\ cf e5 2d 9d 48 88 44 8e e4 b0 97 80 93 ba 1d 7d\ 73 ae 78 b3 a6 2b a4 ad 95 cd 28 9c cb 9e 00 52\ 26 bb 3d 17 8b cc aa 82 1f b0 44 a4 e2 1 ``` -------------------------------- ### Build Crypto++ with C++11 Standard Source: https://github.com/weidai11/cryptopp/blob/master/Install.txt These commands show how to compile Crypto++ using the C++11 standard by setting the `CXXFLAGS` environment variable. This ensures the compiler uses C++11 features during the build process. ```bash export CXXFLAGS="-DNDEBUG -g2 -O3 -std=c++11" make ``` ```bash CXXFLAGS="-DNDEBUG -g2 -O3 -std=c++11" make ``` -------------------------------- ### Run Crypto++ Validation Suite Source: https://github.com/weidai11/cryptopp/blob/master/Install.txt Executes the Crypto++ validation suite (`cryptest.exe v`) to perform basic system checks and exercise algorithms. The tail of the output should indicate 0 failed tests. ```Shell ./cryptest.exe v ``` -------------------------------- ### RSASSA-PSS Signature Example 10.6 Source: https://github.com/weidai11/cryptopp/blob/master/TestVectors/rsa_pss.txt This snippet provides the hexadecimal values for a message, its corresponding salt, and the RSASSA-PSS signature generated using these inputs, as per Example 10.6 of a cryptographic standard. These values are crucial for verifying the correctness of RSASSA-PSS implementations. ```Hexadecimal 25 f1 08 95 a8 77 16 c1 37 45 0b b9 51 9d fa a1 f2 07 fa a9 42 ea 88 ab f7 1e 9c 17 98 00 85 b5 55 ae ba b7 62 64 ae 2a 3a b9 3c 2d 12 98 11 91 dd ac 6f b5 94 9e b3 6a ee 3c 5d a9 40 f0 07 52 c9 16 d9 46 08 fa 7d 97 ba 6a 29 15 b6 88 f2 03 23 d4 e9 d9 68 01 d8 9a 72 ab 58 92 dc 21 17 c0 74 34 fc f9 72 e0 58 cf 8c 41 ca 4b 4f f5 54 f7 d5 06 8a d3 15 5f ce d0 f3 12 5b c0 4f 91 93 37 8a 8f 5c 4c 3b 8c b4 dd 6d 1c c6 9d ``` -------------------------------- ### Perform Coverity Scan Build and Submission on Windows Source: https://github.com/weidai11/cryptopp/blob/master/TestScripts/coverity-windows.txt This script automates the process of preparing for a Coverity Scan, building the Crypto++ library with `cov-build`, archiving the scan results, and submitting them to the Coverity Scan service. It cleans previous builds, runs the `cov-build` command, zips the `cov-int` directory, and then uses `curl` to upload the archive with specified project details. ```Batch REM coverity-windows.txt - Scan build submission instructions for Windows using cryptest.nmake. REM Written and placed in public domain by Jeffrey Walton and Uri Blumenthal. REM Copyright assigned to Crypto++ project. REM REM The following are copy/paste instructions for invoking cov-build, building the library and REM submitting the artifacts for a scan. Also see http://cryptopp.com/wiki/Coverity_Scan. REM ################################################################ cls del /f cryptopp.zip rmdir /q /s cov-int nmake /f cryptest.nmake clean REM Uncomment CXXFLAGS in makefile. Pay attention to X86, X64 or ARM cov-build.exe --dir cov-int nmake /f cryptest.nmake 7z.exe a -r -tzip -mx=9 cryptopp.zip cov-int set CRYPTOPP_COVERITY_TOKEN=XXXXXXXXXXXXXXXX set COVERITY_SCAN_NAME=Rijndael-AliasedTable-SSE2-Windows-X64 curl.exe ^ --form token="%CRYPTOPP_COVERITY_TOKEN%" ^ --form email=webmaster@cryptopp.com ^ --form file=@cryptopp.zip ^ --form version="%COVERITY_SCAN_NAME%" ^ --form description="%COVERITY_SCAN_NAME%" ^ https://scan.coverity.com/builds?project=Cryptopp ``` -------------------------------- ### RSASSA-PSS Signature Example 10.5 Source: https://github.com/weidai11/cryptopp/blob/master/TestVectors/rsa_pss.txt This snippet provides the hexadecimal values for a message, its corresponding salt, and the RSASSA-PSS signature generated using these inputs, as per Example 10.5 of a cryptographic standard. These values are crucial for verifying the correctness of RSASSA-PSS implementations. ```Hexadecimal 0b 87 77 c7 f8 39 ba f0 a6 4b bb db c5 ce 79 75 5c 57 a2 05 b8 45 c1 74 e2 d2 e9 05 46 a0 89 c4 e6 ec 8a df fa 23 a7 ea 97 ba e6 b6 5d 78 2b 82 db 5d 2b 5a 56 d2 2a 29 a0 5e 7c 44 33 e2 b8 2a 62 1a bb a9 0a dd 05 ce 39 3f c4 8a 84 05 42 45 1a ``` ```Hexadecimal c7 cd 69 8d 84 b6 51 28 d8 83 5e 3a 8b 1e b0 e0 1c b5 41 ec ``` ```Hexadecimal 34 04 7f f9 6c 4d c0 dc 90 b2 d4 ff 59 a1 a3 61 a4 75 4b 25 5d 2e e0 af 7d 8b f8 7c 9b c9 e7 dd ee de 33 93 4c 63 ca 1c 0e 3d 26 2c b1 45 ef 93 2a 1f 2c 0a 99 7a a6 a3 4f 8e ae e7 47 7d 82 cc f0 90 95 a6 b8 ac ad 38 d4 ee c9 fb 7e ab 7a d0 2d a1 d1 1d 8e 54 c1 82 5e 55 bf 58 c2 a2 32 34 b9 02 be 12 4f 9e 90 38 a8 f6 8f a4 5d ab 72 f6 6e 09 45 bf 1d 8b ac c9 04 4c 6f 07 09 8c 9f ce c5 8a 3a ab 10 0c 80 51 78 15 5f 03 0a 12 4c 45 0e 5a cb da 47 d0 e4 f1 0b 80 a2 3f 80 3e 77 4d 02 3b 00 15 c2 0b 9f 9b be 7c 91 29 63 38 d5 ec b4 71 ca fb 03 20 07 b6 7a 60 be 5f 69 50 4a 9f 01 ab b3 cb 46 7b 26 0e 2b ce 86 0b e8 d9 5b f9 2c 0c 8e 14 96 ed 1e 52 85 93 a4 ab b6 df 46 2d de 8a 09 68 df fe 46 83 11 68 57 a2 32 f5 eb f6 c8 5b e2 38 74 5a d0 f3 8f 76 7a 5f db f4 86 fb ``` -------------------------------- ### RSASSA-PSS Signature Example 10.4 Source: https://github.com/weidai11/cryptopp/blob/master/TestVectors/rsa_pss.txt This snippet presents the hexadecimal values for a message, its corresponding salt, and the RSASSA-PSS signature generated using these inputs, as per Example 10.4 of a cryptographic standard. These values are crucial for verifying the correctness of RSASSA-PSS implementations. ```Hexadecimal 08 d9 6b dc aa be 25 2d b0 e4 a9 6c b1 ba c6 01 93 41 db 6f be fb 8d 10 6b 0e 90 ed a6 bc c6 c6 26 2f 37 e7 ea 9c 7e 5d 22 6b d7 df 85 ec 5e 71 ef ff 2f 54 c5 db 57 7f f7 29 ff 91 b8 42 49 1d e2 74 1d 0c 63 16 07 df 58 6b 90 5b 23 b9 1a f1 3d a1 23 04 bf 83 ec a8 a7 3e 87 1f f9 db ``` ```Hexadecimal 4e 96 fc 1b 39 8f 92 b4 46 71 01 0c 0d c3 ef d6 e2 0c 2d 73 ``` ```Hexadecimal 6e 3e 4d 7b 6b 15 d2 fb 46 01 3b 89 00 aa 5b bb 39 39 cf 2c 09 57 17 98 70 42 02 6e e6 2c 74 c5 4c ff d5 d7 d5 7e fb bf 95 0a 0f 5c 57 4f a0 9d 3f c1 c9 f5 13 b0 5b 4f f5 0d d8 df 7e df a2 01 02 85 4c 35 e5 92 18 01 19 a7 0c e5 b0 85 18 2a a0 2d 9e a2 aa 90 d1 df 03 f2 da ae 88 5b a2 f5 d0 5a fd ac 97 47 6f 06 b9 3b 5b c9 4a 1a 80 aa 91 16 c4 d6 15 f3 33 b0 98 89 2b 25 ff ac e2 66 f5 db 5a 5a 3b cc 10 a8 24 ed 55 aa d3 5b 72 78 34 fb 8c 07 da 28 fc f4 16 a5 d9 b2 22 4f 1f 8b 44 2b 36 f9 1e 45 6f de a2 d7 cf e3 36 72 68 de 03 07 a4 c7 4e 92 41 59 ed 33 39 3d 5e 06 55 53 1c 77 32 7b 89 82 1b de df 88 01 61 c7 8c d4 19 6b 54 19 f7 ac c3 f1 3e 5e bf 16 1b 6e 7c 67 24 71 6c a3 3b 85 c2 e2 56 40 19 2a c2 85 96 51 d5 0b de 7e b9 76 e5 1c ec 82 8b 98 b6 56 3b 86 bb ``` -------------------------------- ### RSASSA-PSS Signature Verification Data - Example 4.4 Source: https://github.com/weidai11/cryptopp/blob/master/TestVectors/rsa_pss.txt Hexadecimal test vectors for message, salt, and signature, used to verify an RSASSA-PSS signature according to Example 4.4 of the relevant cryptographic standard. This data is crucial for validating implementations of the RSASSA-PSS algorithm. ```Hexadecimal Message: 28 80 62 af c0 8f cd b7 c5 f8 65 0b 29 83 73 00 46 1d d5 67 6c 17 a2 0a 3c 8f b5 14 89 49 e3 f7 3 ``` -------------------------------- ### Clean and Perform Standard Coverity Build Source: https://github.com/weidai11/cryptopp/blob/master/TestScripts/coverity-macosx.txt This snippet cleans the build directory and then compiles the Crypto++ library using `cov-build` with standard CXXFLAGS for release builds. The `-j 2` flag enables parallel compilation. ```bash reset make distclean &>/dev/null CXXFLAGS="-DNDEBUG -g3 -O2" cov-build --dir cov-int make -j 2 ``` -------------------------------- ### RSASSA-PSS Signature Verification Data - Example 4.3 Source: https://github.com/weidai11/cryptopp/blob/master/TestVectors/rsa_pss.txt Hexadecimal test vectors for message, salt, and signature, used to verify an RSASSA-PSS signature according to Example 4.3 of the relevant cryptographic standard. This data is crucial for validating implementations of the RSASSA-PSS algorithm. ```Hexadecimal Message: d6 a3 11 6a d9 9b bd 17 ed f7 f7 82 f0 db 1c d0 5b 0f 67 74 68 c5 ea 42 0d c1 16 b1 0e 80 d1 10 de 2b 04 61 ea 14 a3 8b e6 86 20 39 2e 7e 89 3c b4 ea 93 93 fb 88 6c 20 ff 79 06 42 30 5b f3 02 00 38 92 e5 4d f9 f6 67 50 9d c5 39 20 df 58 3f 50 a3 dd 61 ab b6 fa b7 5d 60 03 77 e3 83 e6 ac a6 71 0e ee a2 71 56 e0 67 52 c9 4c e2 5a e9 9f cb f8 59 2d be 2d 7e 27 45 3c b4 4d e0 71 00 eb b1 a2 a1 98 11 a4 78 ad be ab 27 0f 94 e8 fe 36 9d 90 b3 ca 61 2f 9f Salt: 22 d7 1d 54 36 3a 42 17 aa 55 11 3f 05 9b 33 84 e3 e5 7e 44 Signature: 04 9d 01 85 84 5a 26 4d 28 fe b1 e6 9e da ec 09 06 09 e8 e4 6d 93 ab b3 83 71 ce 51 f4 aa 65 a5 99 bd aa a8 1d 24 fb a6 6a 08 a1 16 cb 64 4f 3f 1e 65 3d 95 c8 9d b8 bb d5 da ac 27 09 c8 98 40 00 17 84 10 a7 c6 aa 86 67 dd c3 8c 74 1f 71 0e c8 66 5a a9 05 2b e9 29 d4 e3 b1 67 82 c1 66 21 14 c5 41 4b b0 35 34 55 c3 92 fc 28 f3 db 59 05 4b 5f 36 5c 49 e1 d1 56 f8 76 ee 10 cb 4f d7 05 98 ``` -------------------------------- ### GNUmakefile Configuration for OS X libc++ Source: https://github.com/weidai11/cryptopp/blob/master/Install.txt This snippet shows the relevant section in the `GNUmakefile` for OS X builds. It configures the C++ compiler, adds `stdlib=libc++` to `CRYPTOPP_CXXFLAGS`, and sets the archiver (`AR`) to `libtool` for static library creation. ```makefile ifneq ($(IS_DARWIN),0) CXX ?= c++ CRYPTOPP_CXXFLAGS += -stdlib=libc++ AR = libtool ARFLAGS = -static -o endif ``` -------------------------------- ### Perform Coverity Build with Alternate Compiler and C++11 Source: https://github.com/weidai11/cryptopp/blob/master/TestScripts/coverity-macosx.txt This snippet illustrates how to use a specific C++ compiler (e.g., Clang) and enable C++11 standard compliance during the `cov-build` process. The `COVERITY_UNSUPPORTED=1` flag is also included. ```bash CXX=/opt/local/bin/clang++-mp-3.7 COVERITY_UNSUPPORTED=1 CXXFLAGS="-DNDEBUG -g3 -O2 -std=c++11" cov-build --dir cov-int make -j 2 ``` -------------------------------- ### RSA Key Pair Components for RSASSA-PSS Examples Source: https://github.com/weidai11/cryptopp/blob/master/TestVectors/rsa_pss.txt Defines the hexadecimal values for an RSA key pair, including modulus, public exponent, private exponent, prime factors, and other derived parameters. These components are used across the provided RSASSA-PSS signature examples. ```Hexadecimal Data Modulus: 40 52 5f 47 a4 b0 cc 8d a3 25 ed 8a a6 76 b0 d0 f6 26 e0 a7 7f 07 69 21 70 ac ac 80 82 f4 2f aa 7d c7 cd 12 3e 73 0e 31 a8 79 85 20 4c ab cb e6 67 0d 43 a2 dd 2b 2d de f5 e0 53 92 fc 21 3b c5 07 PublicExponent: 01 00 01 PrivateExponent: 03 ce 08 b1 04 ff f3 96 a9 79 bd 3e 4e 46 92 5b 63 19 dd b6 3a cb cf d8 19 f1 7d 16 b8 07 7b 3a 87 10 1f f3 4b 77 fe 48 b8 b2 05 a9 6e 91 51 ba 8e ce a6 4d 0c ce 7b 23 c3 e6 a6 b8 30 58 bc 49 da e8 16 ae 73 6d b5 a4 70 8e 2a d4 35 23 2b 56 7f 90 96 ce 59 ff 28 06 1e 79 ab 1c 02 d7 17 e6 b2 3c ea 6d b8 eb 51 92 fa 7c 1e ab 22 7d ba 74 62 1c 45 60 18 96 ee f1 37 92 c8 44 0b eb 15 aa c1 Prime1: 03 f2 f3 31 f4 14 2d 4f 24 b4 3a a1 02 79 a8 96 52 d4 e7 53 72 21 a1 a7 b2 a2 5d eb 55 1e 5d e9 ac 49 74 11 c2 27 a9 4e 45 f9 1c 2d 1c 13 cc 04 6c f4 ce 14 e3 2d 05 87 34 21 0d 44 a8 7e e1 b7 3f Prime2: 03 4f 09 0d 73 b5 58 03 03 0c f0 36 1a 5d 80 81 bf b7 9f 85 15 23 fe ac 0a 21 24 d0 8d 40 13 ff 08 48 77 71 a8 70 d0 47 9d c0 68 6c 62 f7 71 8d fe cf 02 4b 17 c9 26 76 78 05 91 71 33 9c c0 08 39 ModPrime1PrivateExponent: 02 aa 66 3a db f5 1a b8 87 a0 18 cb 42 6e 78 bc 2f e1 82 dc b2 f7 bc b5 04 41 d1 7f df 0f 06 79 8b 50 71 c6 e2 f5 fe b4 d5 4a d8 18 23 11 c1 ef 62 d4 c4 9f 18 d1 f5 1f 54 b2 d2 cf fb a4 da 1b e5 ModPrime2PrivateExponent: 02 bb e7 06 07 8b 5c 0b 39 15 12 d4 11 db 1b 19 9b 5a 56 64 b8 40 42 ea d3 7f e9 94 ae 72 b9 53 2d fb fb 3e 9e 69 81 a0 fb b8 06 51 31 41 b7 c2 16 3f e5 6c 39 5e 4b fa ee 57 e3 83 3f 9b 91 8d f9 MultiplicativeInverseOfPrime2ModPrime1: 02 42 b6 cd 00 d3 0a 76 7a ee 9a 89 8e ad 45 3c 8e ae a6 3d 50 0b 7d 1e 00 71 3e da e5 1c e3 6b 23 b6 64 df 26 e6 3e 26 6e c8 f7 6e 6e 63 ed 1b a4 1e b0 33 b1 20 f7 ea 52 12 ae 21 a9 8f bc 16 ``` -------------------------------- ### Example Public Key (Hexadecimal) Source: https://github.com/weidai11/cryptopp/blob/master/TestVectors/dlies.txt A hexadecimal representation of a public key, likely used for encryption or verification within cryptographic operations. ```Hexadecimal 308201a43082011806072a8648ce3804013082010b028181015dd7980807a15e557e3a39466eb2987828c536a871d4fc7f3723d52f8145a0d10d99629564aca54fd567c0509ef3c428fac68d916551e77a5ca0ed6d9f12cc96262b1f1149f398ef9f0f17fc0ed92bb917f890d1e6a4f62b91a7978d0aa1bf53b89805c106ebebd0924cb99a4168a38dad65238236d4d166d38a3dfd5359ec5f02818100aeebcc0403d0af2abf1d1ca337594c3c14629b5438ea7e3f9b91ea97c0a2d06886ccb14ab25652a7eab3e0284f79e2147d6346c8b2a8f3bd2e5076b6cf89664b13158f88a4f9cc77cf878bfe076c95dc8bfc4868f3527b15c8d3cbc68550dfa9dc4c02e08375f5e849265ccd20b451c6d6b291c11b6a68b369c51efea9acf62f020102038185000281810107143658b98a3725010d3631a3f4f7448cb967ac0118e4ca8fc8871eb4fb872d55c52d93a4f21eed98b6499db74315956a268f38a288958bf7c4d548662c668669d69375e0cb710ff3a1a9f43e49add1f7ae58b836b6444e419e40474c27066cb03aae8132e65f3fead0109307ab1c7f0254eb14e9d766391a66ca1ba442b425 ``` -------------------------------- ### Build Crypto++ with LLVM's libc++ Source: https://github.com/weidai11/cryptopp/blob/master/Install.txt This command configures the build to use LLVM's libc++ standard library, often required on OS X with XCode. It sets `CXXFLAGS` to include the necessary compiler flags. ```bash export CXXFLAGS="-std=c++11 -stdlib=libc++" make ``` -------------------------------- ### Build Crypto++ with Specter Resistance Flags Source: https://github.com/weidai11/cryptopp/blob/master/Install.txt This command adds specific compiler flags (`-mfunction-return=thunk -mindirect-branch=thunk`) to enable Specter resistance during the Crypto++ build process. Note that Crypto++ does not engage these remediations by default. ```bash CXXFLAGS="-DNDEBUG -g2 -O3 -mfunction-return=thunk -mindirect-branch=thunk" make ``` -------------------------------- ### RSA Key Pair Test Vector (1029-bit) Example 6 Source: https://github.com/weidai11/cryptopp/blob/master/TestVectors/rsa_pss.txt Provides hexadecimal test vectors for a 1029-bit RSA key pair. This example includes the modulus, public exponent, private exponent, and prime factors (Prime1, Prime2, ModPrime1PrivateExponent, ModPrime2PrivateExponent), useful for cryptographic library validation. ```Hexadecimal Modulus: 164ca31cff609f3a0e7101b039f2e4fe6dd37519ab98598d179e174996598071f47d3a04559158d7be373cf1aa53f0aa6ef09039e5678c2a4c63900514c8c4f8aaed5de12a5f10b09c311af8c0ffb5b7a297f2efc63b8d6b0510931f0b98e48bf5fc6ec4e7b8db1fffaeb08c38e02adb8f03a48229c99e969431f61cb8c4dc698d1 PublicExponent: 010001 PrivateExponent: 03b664ee3b7566723fc6eaf28abb430a3980f1126c81de8ad709eab39ac9dcd0b1550b3729d87068e952009df544534c1f50829a78f4591eb8fd57140426a6bb0405b6a6f51a57d9267b7bbbc653391a699a2a90dac8ae226bcc60fa8cd934c73c7b03b1f6b818158631838a8612e6e6ea92be24f8324faf5b1fd8587225267ba6f Prime1: 04f0548c9626ab1ebf1244934741d99a06220efa2a5856aa0e75730b2ec96adc86be894fa2803b53a5e85d276acbd29ab823f80a7391bb54a5051672fb04eeb543 Prime2: 0483e0ae47915587743ff345362b555d3962d98bb6f15f848b4c92b1771ca8ed107d8d3ee65ec44517dd0faa481a387e902f7a2e747c269e7ea44480bc538b8e5b ModPrime1PrivateExponent: 03a8e8aea9920c1aa3b2 ``` -------------------------------- ### Build and Test Crypto++ on Linux/Unix Source: https://github.com/weidai11/cryptopp/blob/master/Readme.txt Provides instructions for compiling Crypto++ using the provided makefile with GCC and compatible compilers on Linux/Unix-like systems. It also includes commands to run the validation suite and additional test vectors after compilation. ```Shell # Ensure you are using GNU Make and GNU ld. # After compilation (e.g., by running 'make'), # the process will produce libcryptopp.a and cryptest.exe. # Run the validation suite: ./cryptest.exe v # Run additional test vectors: ./cryptest.exe tv all ``` -------------------------------- ### RSASSA-PSS Signature Example 9.5 Test Vector Source: https://github.com/weidai11/cryptopp/blob/master/TestVectors/rsa_pss.txt This snippet provides a test vector for RSASSA-PSS signature verification, including the message, salt, and the expected signature in hexadecimal format. The 'Test: Verify' indicates that this signature should successfully verify against the corresponding public key and message, adhering to the specifications of Example 9.5. ```Hexadecimal Message: \ 3c 36 63 50 be ae 22 da 3a c2 c1 f5 07 70 96 fc\ b5 c4 bf 25 5f 75 74 35 1a e0 b1 e1 f0 36 32 81\ 7c 08 56 d4 a8 ba 97 af bd c8 b8 58 55 40 2b c5\ 69 26 fc ec 20 9f 9e a8 Salt: \ 70 f3 82 bd df 4d 5d 2d d8 8b 3b c7 b7 30 8b e6\ 32 b8 40 45 Signature: \ 84 eb eb 48 1b e5 98 45 b4 64 68 ba fb 47 1c 01\ 12 e0 2b 23 5d 84 b5 d9 11 cb d1 92 6e e5 07 4a\ e0 42 44 95 cb 20 e8 23 08 b8 eb b6 5f 41 9a 03\ fb 40 e7 2b 78 98 1d 88 aa d1 43 05 36 85 17 2c\ 97 b2 9c 8b 7b f0 ae 73 b5 b2 26 3c 40 3d a0 ed\ 2f 80 ff 74 50 af 78 28 eb 8b 86 f0 02 8b d2 a8\ b1 76 a4 d2 28 cc ce a1 83 94 f2 38 b0 9f f7 58\ cc 00 bc 04 30 11 52 35 57 42 f2 82 b5 4e 66 3a\ 91 9e 70 9d 8d a2 4a de 55 00 a7 b9 aa 50 22 6e\ 0c a5 29 23 e6 c2 d8 60 ec 50 ff 48 0f a5 74 77\ e8 2b 05 65 f4 37 9f 79 c7 72 d5 c2 da 80 af 9f\ bf 32 5e ce 6f c2 0b 00 96 16 14 be e8 9a 18 3e ``` -------------------------------- ### RSASSA-PSS Signature Example 8.1 - Key Pair Validation Source: https://github.com/weidai11/cryptopp/blob/master/TestVectors/rsa_pss.txt This test vector, labeled 'KeyPairValidAndConsistent', demonstrates an RSASSA-PSS signature using specific message, salt, and signature hexadecimal values. It corresponds to Example 8.1 from a cryptographic standard, likely for verifying the consistency and validity of an RSA key pair in the context of PSS. ```Hexadecimal Message: 81 33 2f 4b e6 29 48 41 5e a1 d8 99 79 2e ea cf 6c 6e 1d b1 da 8b e1 3b 5c ea 41 db 2f ed 46 70 92 e1 ff 39 89 14 c7 14 25 97 75 f5 95 f8 54 7f 73 56 92 a5 75 e6 92 3a f7 8f 22 c6 99 7d db 90 fb 6f 72 d7 bb 0d d5 74 4a 31 de cd 3d c3 68 58 49 83 6e d3 4a ec 59 63 04 ad 11 84 3c 4f 88 48 9f 20 97 35 f5 fb 7f da f7 ce c8 ad dc 58 18 16 8f 88 0a cb f4 90 d5 10 05 b7 a8 e8 4e 43 e5 42 87 97 75 71 dd 99 ee a4 b1 61 eb 2d f1 f5 10 8f 12 a4 14 2a 83 32 2e db 05 a7 54 87 a3 43 5c 9a 78 ce 53 ed 93 bc 55 08 57 d7 a9 fb ``` ```Hexadecimal Salt: 1d 65 49 1d 79 c8 64 b3 73 00 9b e6 f6 f2 46 7b ac 4c 78 fa ``` ```text ```