├── .gitignore ├── .gitattributes ├── .gitmodules ├── foundry.toml ├── script └── RsaVerify.s.sol ├── test ├── Suite.sol ├── RFC8017.sol ├── OpenSSL.sol ├── RsaVerify.t.sol ├── FIPS186_2.sol └── FIPS186_4.sol ├── .github └── workflows │ └── test.yml ├── README.md ├── src ├── RsaVerify.sol └── RsaVerifyOptimized.sol └── LICENSE /.gitignore: -------------------------------------------------------------------------------- 1 | out 2 | cache 3 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.sol linguist-language=Solidity 2 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "lib/forge-std"] 2 | path = lib/forge-std 3 | url = https://github.com/foundry-rs/forge-std 4 | -------------------------------------------------------------------------------- /foundry.toml: -------------------------------------------------------------------------------- 1 | [profile.default] 2 | src = "src" 3 | out = "out" 4 | libs = ["lib"] 5 | 6 | solc = "0.8.21" 7 | optimizer = true 8 | optimizer_runs = 100 9 | via_ir = true 10 | # See more config options https://github.com/foundry-rs/foundry/tree/master/config 11 | -------------------------------------------------------------------------------- /script/RsaVerify.s.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: UNLICENSED 2 | pragma solidity ^0.8.13; 3 | 4 | import "forge-std/Script.sol"; 5 | 6 | contract RsaVerifyScript is Script { 7 | function setUp() public {} 8 | 9 | function run() public { 10 | vm.broadcast(); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /test/Suite.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: UNLICENSED 2 | 3 | pragma solidity ^0.8.13; 4 | 5 | struct VectorTest { 6 | bytes e; 7 | bytes Msg; 8 | bytes S; 9 | bytes n; 10 | bool pass; 11 | } 12 | 13 | interface Suite { 14 | function suite() external returns (VectorTest[] memory); 15 | } 16 | -------------------------------------------------------------------------------- /.github/workflows/test.yml: -------------------------------------------------------------------------------- 1 | on: [push] 2 | 3 | name: test 4 | 5 | jobs: 6 | check: 7 | name: Foundry project 8 | runs-on: ubuntu-latest 9 | steps: 10 | - uses: actions/checkout@v3 11 | with: 12 | submodules: recursive 13 | 14 | - name: Install Foundry 15 | uses: foundry-rs/foundry-toolchain@v1 16 | 17 | - name: Run tests 18 | run: forge test -vvv 19 | 20 | - name: Run snapshot 21 | run: NO_COLOR=1 forge snapshot >> $GITHUB_STEP_SUMMARY -------------------------------------------------------------------------------- /test/RFC8017.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: UNLICENSED 2 | 3 | /* 4 | According to RFC4055, pg.5 and RFC8017, pg. 64, for SHA-1, and the SHA-2 family, 5 | the algorithm parameter has to be NULL and both explicit NULL parameter and implicit 6 | NULL parameter (ie, absent NULL parameter) are considered to be legal and equivalent. 7 | 8 | Reported by @yahyazadeh Daniel Yahyazadeh 9 | */ 10 | 11 | pragma solidity ^0.8.13; 12 | 13 | import "./Suite.sol"; 14 | 15 | contract RFC8017 is Suite { 16 | function suite() public pure returns (VectorTest[] memory) { 17 | VectorTest[] memory vt = new VectorTest[](1); 18 | uint256 i = 0; 19 | vt[i++] = test_rfc8017_implicit_null_parameter(); 20 | return vt; 21 | } 22 | 23 | function test_rfc8017_implicit_null_parameter() internal pure returns (VectorTest memory) { 24 | return VectorTest({ 25 | n: hex"E932AC92252F585B3A80A4DD76A897C8B7652952FE788F6EC8DD640587A1EE56" 26 | hex"47670A8AD4C2BE0F9FA6E49C605ADF77B5174230AF7BD50E5D6D6D6D28CCF0A8" 27 | hex"86A514CC72E51D209CC772A52EF419F6A953F3135929588EBE9B351FCA61CED7" 28 | hex"8F346FE00DBB6306E5C2A4C6DFC3779AF85AB417371CF34D8387B9B30AE46D7A" 29 | hex"5FF5A655B8D8455F1B94AE736989D60A6F2FD5CADBFFBD504C5A756A2E6BB5CE" 30 | hex"CC13BCA7503F6DF8B52ACE5C410997E98809DB4DC30D943DE4E812A47553DCE5" 31 | hex"4844A78E36401D13F77DC650619FED88D8B3926E3D8E319C80C744779AC5D6AB" 32 | hex"E252896950917476ECE5E8FC27D5F053D6018D91B502C4787558A002B9283DA7", 33 | e: hex"03", 34 | Msg: "hello world!", 35 | S: hex"a0073057133ff3758e7e111b4d7441f1d8cbe4b2dd5ee4316a14264290dee5ed" 36 | hex"7f175716639bd9bb43a14e4f9fcb9e84dedd35e2205caac04828b2c053f68176" 37 | hex"d971ea88534dd2eeec903043c3469fc69c206b2a8694fd262488441ed8852280" 38 | hex"c3d4994e9d42bd1d575c7024095f1a20665925c2175e089c0d731471f6cc1454" 39 | hex"04edf5559fd2276e45e448086f71c78d0cc6628fad394a34e51e8c10bc39bfe0" 40 | hex"9ed2f5f742cc68bee899d0a41e4c75b7b80afd1c321d89ccd9fe8197c44624d9" 41 | hex"1cc935dfa48de3c201099b5b417be748aef29248527e8bbb173cab76b48478d4" 42 | hex"177b338fe1f1244e64d7d23f07add560d5ad50b68d6649a49d7bc3db686daaa7", 43 | pass: true 44 | }); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | > [!IMPORTANT] 2 | > Since 2024/6/11 [OpenZeppelin supports PKCS#1 Verification](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4952), consider to use this well-audited library 3 | 4 | # SolRsaVerify 5 | 6 | [![test](https://github.com/adria0/SolRsaVerify/actions/workflows/test.yml/badge.svg)](https://github.com/adria0/SolRsaVerify/actions/workflows/test.yml) [![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) 7 | 8 | Verification of RSA Sha256 Pkcs1.5 Signatures 9 | 10 | This kind of signatures (with PSS) are standard in CryptoAPIs when generating RSA signatures. 11 | 12 | Checked results with FIPS test vectors https://csrc.nist.gov/CSRC/media/Projects/Cryptographic-Algorithm-Validation-Program/documents/dss/186-2rsatestvectors.zip file SigVer15_186-3.rsp 13 | 14 | # Usage with OpenSSL (OpenSSL 3.1.1) 15 | 16 | First you'll need an RSA private key. You can generate one using the 17 | `openssl` cli: 18 | 19 | 20 | $ openssl genrsa -out private.pem 1024 21 | Generating RSA private key, 1024 bit long modulus 22 | ................................................++++++ 23 | ..................................................++++++ 24 | e is 65537 (0x10001) 25 | 26 | Note: this is just an example, 1024 bits is unsafe, always use >= 2048! 27 | 28 | Next lets sign a message: 29 | 30 | 31 | $ echo -n "hello world" | openssl dgst -sha256 -sign private.pem | xxd -p | tr -d \\n 32 | 00d5380ea463dcb195e887bd900c2e25098401378d6da2e97e56ef1b984e6a67959f7adc662727e0c1e3ea3580caecba6a69925eec3704413e2192b0ff40f4711d424e4e1ecc6128534a2527c04bb1576c4582a589559a8ff9ad2bfd5f09f856dfefd90cd0464dee63f7b10d0b5ef69c389bc4ef4a9d35254fcad5ad246cc6a3% 33 | 34 | 35 | We pass the string "hello world" to openssl to sign it and then to `xxd` to 36 | convert from binary to hex and finally to `tr` to truncate newlines. 37 | 38 | Now let's extract the public key from the private key: 39 | 40 | 41 | $ openssl rsa -in private.pem -outform pem -pubout -out public.pem 42 | writing RSA key 43 | 44 | 45 | And finally we need to extract `n` (the modulus) from the public key: 46 | 47 | 48 | $ openssl asn1parse -inform PEM -i -in public.pem -strparse 18 49 | 0:d=0 hl=3 l= 137 cons: SEQUENCE 50 | 3:d=1 hl=3 l= 129 prim: INTEGER :B793F2F926170FAD768F8B1A5769A2243B4CDCAC4780194F59B39E1A2ABC3BB8EA42DB495D17BEC7F7072A11ED4FA510E75A7886A5DB6F71B7AFCA0090CA079889D18AF0669829ED29A8E21D0C09BD19CAAF2FE2CC8121BFC5687AC6698E3022F468A481426486CAD263BE1A119491E034A6E1AB78F19C066D4145A50F9ECFF7 51 | 135:d=1 hl=2 l= 3 prim: INTEGER :010001 52 | 53 | 54 | Now we can call `RsaVerify.pkcs1Sha256Raw` and verify the signature: 55 | 56 | ``` 57 | modulus = "0xB793F2F926170FAD768F8B1A5769A2243B4CDCAC4780194F59B39E1A2ABC3BB8EA42DB495D17BEC7F7072A11ED4FA510E75A7886A5DB6F71B7AFCA0090CA079889D18AF0669829ED29A8E21D0C09BD19CAAF2FE2CC8121BFC5687AC6698E3022F468A481426486CAD263BE1A119491E034A6E1AB78F19C066D4145A50F9ECFF7"; 58 | 59 | exponent= "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010001"; 60 | 61 | signature = "0x57a0d6a185924d9d579b3ab319fe512331cb0bc6ef2da7d5285cbd06844f5c44662cae2e41ee5020893d6690e34b50a369a78250ae81ba6d708560535ef7cff0299f2ba070b096a9a76e84cf9c902b5e367b341ee166f5fc325dd08a3d971d96d528937f617a1eaf2250c56c4edca80c65970d54fe2492a19468bd32166b3c32"; 62 | 63 | ok = contract.pkcs1Sha256Raw(message, signature, exponent, modulus); 64 | ```` 65 | -------------------------------------------------------------------------------- /test/OpenSSL.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: UNLICENSED 2 | 3 | pragma solidity ^0.8.13; 4 | 5 | import "./Suite.sol"; 6 | 7 | /* 8 | > openssl genrsa -out private.pem 1024 9 | 10 | > cat private.pem 11 | -----BEGIN RSA PRIVATE KEY----- 12 | MIICXAIBAAKBgQDfPt3gCblrxbA7SL1z/nCjrSDq9iTQ3BuhIaRcxzmJN0G3z4Ks 13 | 8ckVc+yCZlOJl8Zpl2AUjeV+VJgxkeygF29RjlR7hf4Lt9nhUN8Z7uc0z1M4IZx/ 14 | j3sTs59ThBefYsE15UTLcL51BXUfNFaOBpgQla7sTzqIdjlxij4R1IwkDQIDAQAB 15 | AoGAQEoBaThDrnaSpq/u5w158Ji15xQVTBRm3IMsqw8wUYSZJ07Z6eYDK2tjy7We 16 | DvynRdcy8xhd44CHB5dnVj8JbiBX26i05fkOy3vtWtWWPQi+lIBLPOYiJA3Jeu01 17 | KrRUKpDjDx9jz5bV3RQNIKhy6oWAmzqZw84w2H5Yu1GeNl0CQQD2NzMllvxh1b03 18 | 2CF0KNvEJo83VmpGoNNnljKaMwuDXeog+NGEkOL89iBZLmaErdaUIKXMi7rKBHTe 19 | zc4KoeMrAkEA6B388AOtofBiS0kLumLxW6S27cbjOiJ6kgi2QuoZeYjwP1Sd2vBJ 20 | d/0ooqwO2m2ZBMhHvfWJNsj97bX9d2VZpwJBAK9Ruv/HNUtM8QF0ys110pcnhc83 21 | n1FPb3lRQBMAye/uzapQwpAMwzSw5XPbUHClgCfV33l4/baf2cBU96QmhiUCQAqq 22 | 9ikBwkUjCyFypftW+MjBdTbQYTkWxJNZmybQI4OWa5Q9i1O4n2fIVsnDJpubVeEG 23 | Y2Wzly7RZfo61v9ZxRkCQDwTiiLUD7w6IE9CHhz6j1yI6P1Nn+wuymu7YMXG0zjs 24 | H6knPQhmeq6EXguCWPVvCIGbHZn16g+s9jkUEq48V+Y= 25 | -----END RSA PRIVATE KEY----- 26 | 27 | > openssl rsa -in private.pem -outform der -pubout -out public.pem 28 | 29 | # addd -n to echo to remove final carriage return 30 | > echo -n "hello world" | openssl dgst -sha256 -sign private.pem | xxd -p | tr -d \\n 31 | 32 | 079bed733b48d69bdb03076cb17d9809072a5a765460bc72072d687dba492afe951d75b814f561f253ee5cc0f3d703b6eab5b5df635b03a5437c0a5c179309812f5b5c97650361c645bc99f806054de21eb187bc0a704ed38d3d4c2871a117c19b6da7e9a3d808481c46b22652d15b899ad3792da5419e50ee38759560002388 33 | 34 | # extract the public n from the public key 35 | > openssl asn1parse -inform DER -i -in public.pem -strparse 18 36 | 0:d=0 hl=3 l= 137 cons: SEQUENCE 37 | 3:d=1 hl=3 l= 129 prim: INTEGER :DF3EDDE009B96BC5B03B48BD73FE70A3AD20EAF624D0DC1BA121A45CC739893741B7CF82ACF1C91573EC8266538997C6699760148DE57E54983191ECA0176F518E547B85FE0BB7D9E150DF19EEE734CF5338219C7F8F7B13B39F5384179F62C135E544CB70BE7505751F34568E06981095AEEC4F3A887639718A3E11D48C240D 38 | 135:d=1 hl=2 l= 3 prim: INTEGER :010001 39 | 40 | # get the `e`=010001 and `n` DF..0D 41 | */ 42 | 43 | contract OpenSSL is Suite { 44 | function suite() public pure returns (VectorTest[] memory) { 45 | VectorTest[] memory vt = new VectorTest[](1); 46 | uint256 i = 0; 47 | vt[i++] = ok(); 48 | return vt; 49 | } 50 | 51 | function ok() internal pure returns (VectorTest memory) { 52 | return VectorTest({ 53 | e: hex"0000000000000000000000000000000000000000000000000000000000000000" 54 | hex"0000000000000000000000000000000000000000000000000000000000000000" 55 | hex"0000000000000000000000000000000000000000000000000000000000000000" 56 | hex"0000000000000000000000000000000000000000000000000000000000010001", 57 | Msg: bytes("hello world"), 58 | S: hex"079bed733b48d69bdb03076cb17d9809072a5a765460bc72072d687dba492afe" 59 | hex"951d75b814f561f253ee5cc0f3d703b6eab5b5df635b03a5437c0a5c17930981" 60 | hex"2f5b5c97650361c645bc99f806054de21eb187bc0a704ed38d3d4c2871a117c1" 61 | hex"9b6da7e9a3d808481c46b22652d15b899ad3792da5419e50ee38759560002388", 62 | n: hex"DF3EDDE009B96BC5B03B48BD73FE70A3AD20EAF624D0DC1BA121A45CC7398937" 63 | hex"41B7CF82ACF1C91573EC8266538997C6699760148DE57E54983191ECA0176F51" 64 | hex"8E547B85FE0BB7D9E150DF19EEE734CF5338219C7F8F7B13B39F5384179F62C1" 65 | hex"35E544CB70BE7505751F34568E06981095AEEC4F3A887639718A3E11D48C240D", 66 | pass: true 67 | }); 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /test/RsaVerify.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: UNLICENSED 2 | 3 | pragma solidity ^0.8.13; 4 | 5 | import "forge-std/Test.sol"; 6 | import "../src/RsaVerify.sol"; 7 | import "../src/RsaVerifyOptimized.sol"; 8 | 9 | import "./FIPS186_2.sol"; 10 | import "./FIPS186_4.sol"; 11 | import "./OpenSSL.sol"; 12 | import "./RFC8017.sol"; 13 | 14 | contract RsaVerifyTest is Test { 15 | function test_suites(function(bytes memory, bytes memory, bytes memory, bytes memory) returns (bool) _verifier) 16 | internal 17 | { 18 | { 19 | VectorTest[] memory vt = new FIPS186_2().suite(); 20 | for (uint256 i = 0; i < vt.length; i++) { 21 | assertEq(_verifier(vt[i].Msg, vt[i].S, vt[i].e, vt[i].n), vt[i].pass); 22 | } 23 | } 24 | { 25 | VectorTest[] memory vt = new FIPS186_4().suite(); 26 | for (uint256 i = 0; i < vt.length; i++) { 27 | assertEq(_verifier(vt[i].Msg, vt[i].S, vt[i].e, vt[i].n), vt[i].pass); 28 | } 29 | } 30 | { 31 | VectorTest[] memory vt = new OpenSSL().suite(); 32 | for (uint256 i = 0; i < vt.length; i++) { 33 | assertEq(_verifier(vt[i].Msg, vt[i].S, vt[i].e, vt[i].n), vt[i].pass); 34 | } 35 | } 36 | { 37 | VectorTest[] memory vt = new RFC8017().suite(); 38 | for (uint256 i = 0; i < vt.length; i++) { 39 | assertEq(_verifier(vt[i].Msg, vt[i].S, vt[i].e, vt[i].n), vt[i].pass); 40 | } 41 | } 42 | } 43 | 44 | function pkcs1Sha256Raw_original(bytes memory Msg, bytes memory S, bytes memory e, bytes memory n) 45 | internal 46 | view 47 | returns (bool) 48 | { 49 | return RsaVerify.pkcs1Sha256Raw(Msg, S, e, n); 50 | } 51 | 52 | function pkcs1Sha256Raw_optimized(bytes memory Msg, bytes memory S, bytes memory e, bytes memory n) 53 | internal 54 | view 55 | returns (bool) 56 | { 57 | return RsaVerifyOptimized.pkcs1Sha256Raw(Msg, S, e, n); 58 | } 59 | 60 | function test_suites_original() public { 61 | test_suites(pkcs1Sha256Raw_original); 62 | } 63 | 64 | function test_suites_optimized() public { 65 | test_suites(pkcs1Sha256Raw_optimized); 66 | } 67 | 68 | function test_gas_original() public { 69 | bytes memory e = hex"0000000000000000000000000000000000000000000000000000000000000000" 70 | hex"0000000000000000000000000000000000000000000000000000000000000000" 71 | hex"0000000000000000000000000000000000000000000000000000000000000000" 72 | hex"0000000000000000000000000000000000000000000000000000000000010001"; 73 | 74 | bytes memory Msg = bytes("hello world"); 75 | 76 | bytes memory S = hex"079bed733b48d69bdb03076cb17d9809072a5a765460bc72072d687dba492afe" 77 | hex"951d75b814f561f253ee5cc0f3d703b6eab5b5df635b03a5437c0a5c17930981" 78 | hex"2f5b5c97650361c645bc99f806054de21eb187bc0a704ed38d3d4c2871a117c1" 79 | hex"9b6da7e9a3d808481c46b22652d15b899ad3792da5419e50ee38759560002388"; 80 | 81 | bytes memory n = hex"DF3EDDE009B96BC5B03B48BD73FE70A3AD20EAF624D0DC1BA121A45CC7398937" 82 | hex"41B7CF82ACF1C91573EC8266538997C6699760148DE57E54983191ECA0176F51" 83 | hex"8E547B85FE0BB7D9E150DF19EEE734CF5338219C7F8F7B13B39F5384179F62C1" 84 | hex"35E544CB70BE7505751F34568E06981095AEEC4F3A887639718A3E11D48C240D"; 85 | 86 | assertEq(RsaVerify.pkcs1Sha256Raw(Msg, S, e, n), true); 87 | } 88 | 89 | function test_gas_optimized() public { 90 | bytes memory e = hex"0000000000000000000000000000000000000000000000000000000000000000" 91 | hex"0000000000000000000000000000000000000000000000000000000000000000" 92 | hex"0000000000000000000000000000000000000000000000000000000000000000" 93 | hex"0000000000000000000000000000000000000000000000000000000000010001"; 94 | 95 | bytes memory Msg = bytes("hello world"); 96 | 97 | bytes memory S = hex"079bed733b48d69bdb03076cb17d9809072a5a765460bc72072d687dba492afe" 98 | hex"951d75b814f561f253ee5cc0f3d703b6eab5b5df635b03a5437c0a5c17930981" 99 | hex"2f5b5c97650361c645bc99f806054de21eb187bc0a704ed38d3d4c2871a117c1" 100 | hex"9b6da7e9a3d808481c46b22652d15b899ad3792da5419e50ee38759560002388"; 101 | 102 | bytes memory n = hex"DF3EDDE009B96BC5B03B48BD73FE70A3AD20EAF624D0DC1BA121A45CC7398937" 103 | hex"41B7CF82ACF1C91573EC8266538997C6699760148DE57E54983191ECA0176F51" 104 | hex"8E547B85FE0BB7D9E150DF19EEE734CF5338219C7F8F7B13B39F5384179F62C1" 105 | hex"35E544CB70BE7505751F34568E06981095AEEC4F3A887639718A3E11D48C240D"; 106 | 107 | assertEq(RsaVerifyOptimized.pkcs1Sha256Raw(Msg, S, e, n), true); 108 | } 109 | } 110 | -------------------------------------------------------------------------------- /src/RsaVerify.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0-or-later 2 | pragma solidity ^0.8.0; 3 | 4 | /* 5 | Copyright 2016, Adrià Massanet 6 | 7 | This program is free software: you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation, either version 3 of the License, or 10 | (at your option) any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program. If not, see . 19 | 20 | Checked results with FIPS test vectors 21 | https://csrc.nist.gov/CSRC/media/Projects/Cryptographic-Algorithm-Validation-Program/documents/dss/186-2rsatestvectors.zip 22 | file SigVer15_186-3.rsp 23 | 24 | */ 25 | 26 | library RsaVerify { 27 | /** 28 | * @dev Verifies a PKCSv1.5 SHA256 signature 29 | * @param _sha256 is the sha256 of the data 30 | * @param _s is the signature 31 | * @param _e is the exponent 32 | * @param _m is the modulus 33 | * @return true if success, false otherwise 34 | */ 35 | function pkcs1Sha256(bytes32 _sha256, bytes memory _s, bytes memory _e, bytes memory _m) 36 | public 37 | view 38 | returns (bool) 39 | { 40 | uint8[17] memory sha256ExplicitNullParam = 41 | [0x30, 0x31, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01, 0x05, 0x00]; 42 | 43 | uint8[15] memory sha256ImplicitNullParam = 44 | [0x30, 0x2f, 0x30, 0x0b, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01]; 45 | 46 | // decipher 47 | 48 | bytes memory input = bytes.concat(bytes32(_s.length), bytes32(_e.length), bytes32(_m.length), _s, _e, _m); 49 | uint256 inputlen = input.length; 50 | 51 | uint256 decipherlen = _m.length; 52 | bytes memory decipher = new bytes(decipherlen); 53 | assembly { 54 | pop(staticcall(sub(gas(), 2000), 5, add(input, 0x20), inputlen, add(decipher, 0x20), decipherlen)) 55 | } 56 | 57 | // Check that is well encoded: 58 | // 59 | // 0x00 || 0x01 || PS || 0x00 || DigestInfo 60 | // PS is padding filled with 0xff 61 | // DigestInfo ::= SEQUENCE { 62 | // digestAlgorithm AlgorithmIdentifier, 63 | // [optional algorithm parameters] 64 | // digest OCTET STRING 65 | // } 66 | 67 | bool hasNullParam; 68 | uint256 digestAlgoWithParamLen; 69 | 70 | if (uint8(decipher[decipherlen - 50]) == 0x31) { 71 | hasNullParam = true; 72 | digestAlgoWithParamLen = sha256ExplicitNullParam.length; 73 | } else if (uint8(decipher[decipherlen - 48]) == 0x2f) { 74 | hasNullParam = false; 75 | digestAlgoWithParamLen = sha256ImplicitNullParam.length; 76 | } else { 77 | return false; 78 | } 79 | 80 | uint256 paddingLen = decipherlen - 5 - digestAlgoWithParamLen - 32; 81 | 82 | if (decipher[0] != 0 || decipher[1] != 0x01) { 83 | return false; 84 | } 85 | for (uint256 i = 2; i < 2 + paddingLen; i++) { 86 | if (decipher[i] != 0xff) { 87 | return false; 88 | } 89 | } 90 | if (decipher[2 + paddingLen] != 0) { 91 | return false; 92 | } 93 | 94 | // check digest algorithm 95 | 96 | if (digestAlgoWithParamLen == sha256ExplicitNullParam.length) { 97 | for (uint256 i = 0; i < digestAlgoWithParamLen; i++) { 98 | if (decipher[3 + paddingLen + i] != bytes1(sha256ExplicitNullParam[i])) { 99 | return false; 100 | } 101 | } 102 | } else { 103 | for (uint256 i = 0; i < digestAlgoWithParamLen; i++) { 104 | if (decipher[3 + paddingLen + i] != bytes1(sha256ImplicitNullParam[i])) { 105 | return false; 106 | } 107 | } 108 | } 109 | 110 | // check digest 111 | 112 | if ( 113 | decipher[3 + paddingLen + digestAlgoWithParamLen] != 0x04 114 | || decipher[4 + paddingLen + digestAlgoWithParamLen] != 0x20 115 | ) { 116 | return false; 117 | } 118 | 119 | for (uint256 i = 0; i < _sha256.length; i++) { 120 | if (decipher[5 + paddingLen + digestAlgoWithParamLen + i] != _sha256[i]) { 121 | return false; 122 | } 123 | } 124 | 125 | return true; 126 | } 127 | 128 | /** 129 | * @dev Verifies a PKCSv1.5 SHA256 signature 130 | * @param _data to verify 131 | * @param _s is the signature 132 | * @param _e is the exponent 133 | * @param _m is the modulus 134 | * @return 0 if success, >0 otherwise 135 | */ 136 | function pkcs1Sha256Raw(bytes memory _data, bytes memory _s, bytes memory _e, bytes memory _m) 137 | public 138 | view 139 | returns (bool) 140 | { 141 | return pkcs1Sha256(sha256(_data), _s, _e, _m); 142 | } 143 | } 144 | -------------------------------------------------------------------------------- /src/RsaVerifyOptimized.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0-or-later 2 | pragma solidity ^0.8.0; 3 | 4 | /* 5 | Copyright 2016, Adrià Massanet 6 | 7 | This program is free software: you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation, either version 3 of the License, or 10 | (at your option) any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program. If not, see . 19 | 20 | Checked results with FIPS test vectors 21 | https://csrc.nist.gov/CSRC/media/Projects/Cryptographic-Algorithm-Validation-Program/documents/dss/186-2rsatestvectors.zip 22 | file SigVer15_186-3.rsp 23 | 24 | */ 25 | 26 | library RsaVerifyOptimized { 27 | uint256 constant sha256ExplicitNullParamByteLen = 17; 28 | bytes32 constant sha256ExplicitNullParam = 0x3031300d06096086480165030402010500000000000000000000000000000000; 29 | bytes32 constant sha256ExplicitNullParamMask = 0xffffffffffffffffffffffffffffffffff000000000000000000000000000000; 30 | 31 | uint256 constant sha256ImplicitNullParamByteLen = 15; 32 | bytes32 constant sha256ImplicitNullParam = 0x302f300b06096086480165030402010000000000000000000000000000000000; 33 | bytes32 constant sha256ImplicitNullParamMask = 0xffffffffffffffffffffffffffffff0000000000000000000000000000000000; 34 | 35 | /** 36 | * @dev Verifies a PKCSv1.5 SHA256 signature 37 | * @param _sha256 is the sha256 of the data 38 | * @param _s is the signature 39 | * @param _e is the exponent 40 | * @param _m is the modulus 41 | * @return true if success, false otherwise 42 | */ 43 | function pkcs1Sha256(bytes32 _sha256, bytes memory _s, bytes memory _e, bytes memory _m) 44 | public 45 | view 46 | returns (bool) 47 | { 48 | // decipher 49 | uint256 decipherlen = _m.length; 50 | if (decipherlen < 64) { 51 | return false; 52 | } 53 | if (decipherlen != _s.length) { 54 | return false; 55 | } 56 | bytes memory input = bytes.concat(bytes32(decipherlen), bytes32(_e.length), bytes32(decipherlen), _s, _e, _m); 57 | uint256 inputlen = input.length; 58 | 59 | bytes memory decipher = new bytes(decipherlen); 60 | assembly ("memory-safe") { 61 | if iszero(staticcall(not(0), 0x05, add(input, 0x20), inputlen, add(decipher, 0x20), decipherlen)) { 62 | mstore(0x00, false) 63 | return(0x00, 0x20) 64 | } 65 | } 66 | 67 | // Check that is well encoded: 68 | // 69 | // 0x00 || 0x01 || PS || 0x00 || DigestInfo 70 | // PS is padding filled with 0xff 71 | // DigestInfo ::= SEQUENCE { 72 | // digestAlgorithm AlgorithmIdentifier, 73 | // [optional algorithm parameters] 74 | // digest OCTET STRING 75 | // } 76 | 77 | uint256 digestAlgoWithParamLen; 78 | uint256 paddingLen; 79 | assembly ("memory-safe") { 80 | // 81 | // Equivalent code: 82 | // if (uint8(decipher[decipherlen - 50]) == 0x31) { 83 | // hasNullParam = true; 84 | // digestAlgoWithParamLen = sha256ExplicitNullParamByteLen; 85 | // } else if (uint8(decipher[decipherlen - 48]) == 0x2f) { 86 | // hasNullParam = false; 87 | // digestAlgoWithParamLen = sha256ImplicitNullParamByteLen; 88 | // } else { 89 | // return false; 90 | // } 91 | 92 | // Note: `decipherlen` is at least 64, so we can safely access 93 | if eq(byte(0, mload(sub(add(decipher, decipherlen), 18 /* decipher+0x20+(decipherlen-50) */ ))), 0x31) { 94 | digestAlgoWithParamLen := sha256ExplicitNullParamByteLen 95 | } 96 | if iszero(digestAlgoWithParamLen) { 97 | if eq(byte(0, mload(sub(add(decipher, decipherlen), 16 /* decipher+0x20+(decipherlen-48) */ ))), 0x2f) { 98 | digestAlgoWithParamLen := sha256ImplicitNullParamByteLen 99 | } 100 | } 101 | if iszero(digestAlgoWithParamLen) { 102 | mstore(0x00, false) 103 | return(0x00, 0x20) 104 | } 105 | 106 | // paddingLen = decipherlen - 5 - digestAlgoWithParamLen - 32; 107 | // Note: `decipherlen` is at least 64, so we can safely access 108 | paddingLen := sub(sub(decipherlen, digestAlgoWithParamLen), 37) 109 | 110 | // 111 | // Equivalent code: 112 | // 113 | // if (decipher[0] != 0 || decipher[1] != 0x01) { 114 | // return false; 115 | // } 116 | // 117 | if sub( 118 | and( 119 | mload(add(decipher, 0x20)), 120 | 0xffff000000000000000000000000000000000000000000000000000000000000 /* 32bytes */ 121 | ), 122 | 0x0001000000000000000000000000000000000000000000000000000000000000 /* 32bytes */ /* 123 | 0: 0x00 124 | 1: 0x01 125 | */ 126 | ) { 127 | mstore(0x00, false) 128 | return(0x00, 0x20) 129 | } 130 | 131 | // 132 | // Equivalent code: 133 | // 134 | // for (uint256 i = 2; i < 2 + paddingLen; ) { 135 | // if (decipher[i] != 0xff) { 136 | // return false; 137 | // } 138 | // unchecked { 139 | // i++; 140 | // } 141 | // } 142 | // 143 | let _maxIndex := 144 | add( 145 | add(decipher, 34), 146 | /* 0x20+2 */ 147 | paddingLen 148 | ) 149 | for { let i := add(decipher, 34) } /* 0x20+2 */ lt(i, _maxIndex) { i := add(i, 1) } { 150 | if lt(byte(0, mload(i)), 0xff) { 151 | mstore(0x00, false) 152 | return(0x00, 0x20) 153 | } 154 | } 155 | 156 | // 157 | // Equivalent code: 158 | // 159 | // if (decipher[2 + paddingLen] != 0) { 160 | // return false; 161 | // } 162 | // 163 | if gt(byte(0, mload(_maxIndex)), 0) { 164 | mstore(0x00, false) 165 | return(0x00, 0x20) 166 | } 167 | } 168 | 169 | // check digest algorithm 170 | if (digestAlgoWithParamLen == sha256ExplicitNullParamByteLen) { 171 | assembly ("memory-safe") { 172 | // 173 | // Equivalent code: 174 | // 175 | // for (uint i = 0; i < digestAlgoWithParamLen; i++) { 176 | // if (decipher[3 + paddingLen + i] != bytes1(sha256ExplicitNullParam[i])) { 177 | // return false; 178 | // } 179 | // } 180 | // 181 | 182 | // load decipher[3 + paddingLen + 0] 183 | let _data := mload(add(add(decipher, 35 /* 0x20+3 */ ), paddingLen)) 184 | // ensure that only the first `sha256ImplicitNullParamByteLen` bytes have data 185 | _data := and(_data, sha256ExplicitNullParamMask) 186 | // check that the data is equal to `sha256ExplicitNullParam` 187 | _data := xor(_data, sha256ExplicitNullParam) 188 | if gt(_data, 0) { 189 | mstore(0x00, false) 190 | return(0x00, 0x20) 191 | } 192 | } 193 | } else { 194 | assembly ("memory-safe") { 195 | // 196 | // Equivalent code: 197 | // 198 | // for (uint i = 0; i < digestAlgoWithParamLen; i++) { 199 | // if (decipher[3 + paddingLen + i] != bytes1(sha256ImplicitNullParam[i])) { 200 | // return false; 201 | // } 202 | // } 203 | // 204 | 205 | // load decipher[3 + paddingLen + 0] 206 | let _data := mload(add(add(decipher, 35 /* 0x20+3 */ ), paddingLen)) 207 | // ensure that only the first `sha256ImplicitNullParamByteLen` bytes have data 208 | _data := and(_data, sha256ImplicitNullParamMask) 209 | // check that the data is equal to `sha256ImplicitNullParam` 210 | _data := xor(_data, sha256ImplicitNullParam) 211 | if gt(_data, 0) { 212 | mstore(0x00, false) 213 | return(0x00, 0x20) 214 | } 215 | } 216 | } 217 | 218 | // check digest 219 | assembly ("memory-safe") { 220 | // 221 | // Equivalent code: 222 | // if ( 223 | // decipher[3 + paddingLen + digestAlgoWithParamLen] != 0x04 || 224 | // decipher[4 + paddingLen + digestAlgoWithParamLen] != 0x20 225 | // ) { 226 | // return false; 227 | // } 228 | 229 | if sub( 230 | and( 231 | mload(add(add(add(decipher, 35 /* 0x20+3 */ ), paddingLen), digestAlgoWithParamLen)), 232 | 0xffff000000000000000000000000000000000000000000000000000000000000 /* 32bytes */ 233 | ), 234 | 0x0420000000000000000000000000000000000000000000000000000000000000 /* 32bytes */ /* 235 | 0: 0x04 236 | 1: 0x20 237 | */ 238 | ) { 239 | mstore(0x00, false) 240 | return(0x00, 0x20) 241 | } 242 | 243 | // 244 | // Equivalent code: 245 | // 246 | // for (uint i = 0;i<_sha256.length;i++) { 247 | // if (decipher[5+paddingLen+digestAlgoWithParamLen+i]!=_sha256[i]) { 248 | // return false; 249 | // } 250 | // } 251 | // 252 | // load decipher[5 + paddingLen + digestAlgoWithParamLen + 0] 253 | let _data := mload(add(add(add(add(decipher, 0x20), 5), paddingLen), digestAlgoWithParamLen)) 254 | // check that the data is equal to `_sha256` 255 | _data := xor(_data, _sha256) 256 | if gt(_data, 0) { 257 | mstore(0x00, false) 258 | return(0x00, 0x20) 259 | } 260 | } 261 | 262 | return true; 263 | } 264 | 265 | /** 266 | * @dev Verifies a PKCSv1.5 SHA256 signature 267 | * @param _data to verify 268 | * @param _s is the signature 269 | * @param _e is the exponent 270 | * @param _m is the modulus 271 | * @return 0 if success, >0 otherwise 272 | */ 273 | function pkcs1Sha256Raw(bytes memory _data, bytes memory _s, bytes memory _e, bytes memory _m) 274 | public 275 | view 276 | returns (bool) 277 | { 278 | return pkcs1Sha256(sha256(_data), _s, _e, _m); 279 | } 280 | } 281 | -------------------------------------------------------------------------------- /test/FIPS186_2.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: UNLICENSED 2 | 3 | pragma solidity ^0.8.13; 4 | 5 | import "./Suite.sol"; 6 | 7 | /* 8 | https://csrc.nist.gov/CSRC/media/Projects/Cryptographic-Algorithm-Validation-Program/documents/dss/186-2rsatestvectors.zip file SigVer15_186-3.rsp 9 | */ 10 | 11 | contract FIPS186_2 is Suite { 12 | bytes n = hex"a8d68acd413c5e195d5ef04e1b4faaf242365cb450196755e92e1215ba59802a" 13 | hex"afbadbf2564dd550956abb54f8b1c917844e5f36195d1088c600e07cada5c080" 14 | hex"ede679f50b3de32cf4026e514542495c54b1903768791aae9e36f082cd38e941" 15 | hex"ada89baecada61ab0dd37ad536bcb0a0946271594836e92ab5517301d45176b5"; 16 | 17 | function suite() public view returns (VectorTest[] memory) { 18 | VectorTest[] memory vt = new VectorTest[](7); 19 | uint256 i = 0; 20 | vt[i++] = ok(); 21 | vt[i++] = message_changed(); 22 | vt[i++] = signature_changed(); 23 | vt[i++] = public_key_e_changed(); 24 | vt[i++] = passed_ok(); 25 | vt[i++] = format_of_the_EM_is_incorrect_hash_moved_to_left(); 26 | vt[i++] = format_of_the_EM_is_incorrect_00_on_end_of_pad_removed(); 27 | return vt; 28 | } 29 | 30 | function ok() view internal returns (VectorTest memory) { 31 | return VectorTest({ 32 | e: hex"0000000000000000000000000000000000000000000000000000000000000000" 33 | hex"0000000000000000000000000000000000000000000000000000000000000000" 34 | hex"0000000000000000000000000000000000000000000000000000000000000000" 35 | hex"0000000000000000000000000000000000000000000000000000000000010001", 36 | Msg: hex"f56379c42e3ba856585ca28f7fb768f65d273a5fc546156142857b0afb7c72d2" 37 | hex"d97ecfceec71b4260bdc58c9bb42065f53af69805d9006233ec70a591aff463b" 38 | hex"f23d78200fb8cc14a4eba286afe8924120efad9e3d3f06f7452c725e53728b8f" 39 | hex"86c9fb245fbaf7086ab0092e215213830d1091212efc1ec59ddc3a83707d4ab8", 40 | S: hex"5f49d8dc4519d9520d6542eca08cafb2d99cdb97c5a8685df2476b40505a2f9e" 41 | hex"8d63d76516b83481e2d961a7e8dc5f9f46887e394776711b0f85e4303065c06d" 42 | hex"362456bc219fc6eb343ede6733f779f75853533bc9ab876188da8ad98f9ea2f3" 43 | hex"35d2ceec34ef9cb2782bb0f79cad309608ddc222e00ebcff9d14f6e6ed39638b", 44 | n: FIPS186_2.n, 45 | pass: true 46 | }); 47 | } 48 | 49 | /* 50 | SHAAlg = SHA256 51 | e = 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010001 52 | d = 252c4956ac328ba04789bfdc5e90819981a100f3b540069ba8719b8b3ba27980cc7c96710a75ec0da83c1ddf353b45845f3db7224cdecbe5653cebb01fb66305d42e617e8a51514c6d2fb6b3cbe3ad9478ab7acb575f854ec9c9576a70c63934921c39662b32b8c93fb660f64f50e5481892a8ef4b92a64774995f2a0fbd64b9 53 | Msg = ff23e00f819bae424e41d6b762ea6b88801e651c831c964af31de0c1d6dda4a7c8587d804ed12f526819da06650e7412fb627555979ed442f2663341e5fe57527e0ddaf453a124451674976a6a6e0a31f56a79f5b73dfac39af4f3ba4a5e8bb846cb5e333812756482d975ab1910162f96bfd7c58a02f113125189f5ac05291f 54 | S = 8b5a3675f397841c53a9021dad71a1efab91451c71ad7060ce85d75b306d6403ba23d3370b0695be87485cf6680204c68424bc7e442ef90ac01c4df420ef574294823250a000d56a5d00947800dcb2f4947f5b4eb18fa1dbdc6ab16be4b7131102d4dff98ddeac38554473964d29cdc521ee690cde5a8cd16889aa090c32c53e 55 | SaltVal = 00 56 | Result = F (1 - Message changed) 57 | */ 58 | 59 | function message_changed() public view returns (VectorTest memory) { 60 | return VectorTest({ 61 | e: hex"0000000000000000000000000000000000000000000000000000000000000000" 62 | hex"0000000000000000000000000000000000000000000000000000000000000000" 63 | hex"0000000000000000000000000000000000000000000000000000000000000000" 64 | hex"0000000000000000000000000000000000000000000000000000000000010001", 65 | Msg: hex"ff23e00f819bae424e41d6b762ea6b88801e651c831c964af31de0c1d6dda4a7" 66 | hex"c8587d804ed12f526819da06650e7412fb627555979ed442f2663341e5fe5752" 67 | hex"7e0ddaf453a124451674976a6a6e0a31f56a79f5b73dfac39af4f3ba4a5e8bb8" 68 | hex"46cb5e333812756482d975ab1910162f96bfd7c58a02f113125189f5ac05291f", 69 | S: hex"8b5a3675f397841c53a9021dad71a1efab91451c71ad7060ce85d75b306d6403" 70 | hex"ba23d3370b0695be87485cf6680204c68424bc7e442ef90ac01c4df420ef5742" 71 | hex"94823250a000d56a5d00947800dcb2f4947f5b4eb18fa1dbdc6ab16be4b71311" 72 | hex"02d4dff98ddeac38554473964d29cdc521ee690cde5a8cd16889aa090c32c53e", 73 | n: FIPS186_2.n, 74 | pass: false 75 | }); 76 | } 77 | 78 | /* 79 | SHAAlg = SHA256 80 | e = 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010001 81 | d = 252c4956ac328ba04789bfdc5e90819981a100f3b540069ba8719b8b3ba27980cc7c96710a75ec0da83c1ddf353b45845f3db7224cdecbe5653cebb01fb66305d42e617e8a51514c6d2fb6b3cbe3ad9478ab7acb575f854ec9c9576a70c63934921c39662b32b8c93fb660f64f50e5481892a8ef4b92a64774995f2a0fbd64b9 82 | Msg = a6ce108ff3100b953781496c3d081fe32b8cedaf6d14aab2ef2dc37d8f8d2613d2f599efd55c51498749c0961681ae4ea7e28bf14a8f044c2d4dd4f9102ddd25f86c7795289708eb4df2d526f91b176952eb52fd0c9de2989432d6e08e13022b82f95089d20a5704f0452f26cd1f83bc956ee7da99876c1f8da3723af388bead 83 | S = 750e59f29d2dfeedab2a3a09034904715957149126c63e6a2dc7a633a32c4c0561d54eeb1479cb65274bac37cac4751f4dffdfb7530171599b61d94862845f6cd12a5e0bd6adabc36f06d216a00b1942349710540555106aeb87f5cf3f78df918f36cf63291ef2a7064e31b84075d1c8b551225a25f59c721a3d77046078557f 84 | SaltVal = 00 85 | Result = F (3 - Signature changed ) 86 | */ 87 | 88 | function signature_changed() public view returns (VectorTest memory) { 89 | return VectorTest({ 90 | e: hex"0000000000000000000000000000000000000000000000000000000000000000" 91 | hex"0000000000000000000000000000000000000000000000000000000000000000" 92 | hex"0000000000000000000000000000000000000000000000000000000000000000" 93 | hex"0000000000000000000000000000000000000000000000000000000000010001", 94 | Msg: hex"a6ce108ff3100b953781496c3d081fe32b8cedaf6d14aab2ef2dc37d8f8d2613" 95 | hex"d2f599efd55c51498749c0961681ae4ea7e28bf14a8f044c2d4dd4f9102ddd25" 96 | hex"f86c7795289708eb4df2d526f91b176952eb52fd0c9de2989432d6e08e13022b" 97 | hex"82f95089d20a5704f0452f26cd1f83bc956ee7da99876c1f8da3723af388bead", 98 | S: hex"750e59f29d2dfeedab2a3a09034904715957149126c63e6a2dc7a633a32c4c05" 99 | hex"61d54eeb1479cb65274bac37cac4751f4dffdfb7530171599b61d94862845f6c" 100 | hex"d12a5e0bd6adabc36f06d216a00b1942349710540555106aeb87f5cf3f78df91" 101 | hex"8f36cf63291ef2a7064e31b84075d1c8b551225a25f59c721a3d77046078557f", 102 | n: FIPS186_2.n, 103 | pass: false 104 | }); 105 | } 106 | 107 | /* 108 | SHAAlg = SHA256 109 | e = 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003 110 | Msg = 9be28a4763c6665880c1c2a8a74494622be46de3c20e5b118cf70fee51d33b6d0b473e84a4200382004526a33eea59e13b07070e580937207ec7b2cc5fb76856fe6210a771150fa0e5da9baee4a6209ed3d4e2b3bfd2e5f6591b0ace3e657ad07c1b47d8520d5159386767f11fdfaf41fa3348fb7dd32d3c25da5d1d78433985 111 | S = 0ac6e41252383ee5d07f4fb08a22204f56440a8f3c8568d6e6bae46cfc9d39b65b2eae827164d716e9e465301d08fca7356ef447e0699feabbfac16ed19dc9233b457fe64d6fab38aca4464e5cd3eae3f43bab17856cdcc942e2cc848b7bf390fc53b3ed2e6f63c5d961bc83475ac200708f6e1d5be30cbe24fe4d3dad754269 112 | SaltVal = 00 113 | Result = F (2 - Public Key e changed ) 114 | */ 115 | 116 | function public_key_e_changed() public view returns (VectorTest memory) { 117 | return VectorTest({ 118 | e: hex"0000000000000000000000000000000000000000000000000000000000000000" 119 | hex"0000000000000000000000000000000000000000000000000000000000000000" 120 | hex"0000000000000000000000000000000000000000000000000000000000000000" 121 | hex"0000000000000000000000000000000000000000000000000000000000000003", 122 | Msg: hex"a6ce108ff3100b953781496c3d081fe32b8cedaf6d14aab2ef2dc37d8f8d2613" 123 | hex"d2f599efd55c51498749c0961681ae4ea7e28bf14a8f044c2d4dd4f9102ddd25" 124 | hex"f86c7795289708eb4df2d526f91b176952eb52fd0c9de2989432d6e08e13022b" 125 | hex"82f95089d20a5704f0452f26cd1f83bc956ee7da99876c1f8da3723af388bead", 126 | S: hex"750e59f29d2dfeedab2a3a09034904715957149126c63e6a2dc7a633a32c4c05" 127 | hex"61d54eeb1479cb65274bac37cac4751f4dffdfb7530171599b61d94862845f6c" 128 | hex"d12a5e0bd6adabc36f06d216a00b1942349710540555106aeb87f5cf3f78df91" 129 | hex"8f36cf63291ef2a7064e31b84075d1c8b551225a25f59c721a3d77046078557f", 130 | n: FIPS186_2.n, 131 | pass: false 132 | }); 133 | } 134 | 135 | /* 136 | SHAAlg = SHA256 137 | e = 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010001 138 | Msg = f56379c42e3ba856585ca28f7fb768f65d273a5fc546156142857b0afb7c72d2d97ecfceec71b4260bdc58c9bb42065f53af69805d9006233ec70a591aff463bf23d78200fb8cc14a4eba286afe8924120efad9e3d3f06f7452c725e53728b8f86c9fb245fbaf7086ab0092e215213830d1091212efc1ec59ddc3a83707d4ab8 139 | S = 5f49d8dc4519d9520d6542eca08cafb2d99cdb97c5a8685df2476b40505a2f9e8d63d76516b83481e2d961a7e8dc5f9f46887e394776711b0f85e4303065c06d362456bc219fc6eb343ede6733f779f75853533bc9ab876188da8ad98f9ea2f335d2ceec34ef9cb2782bb0f79cad309608ddc222e00ebcff9d14f6e6ed39638b 140 | SaltVal = 00 141 | Result = P 142 | */ 143 | 144 | function passed_ok() public view returns (VectorTest memory) { 145 | return VectorTest({ 146 | e: hex"0000000000000000000000000000000000000000000000000000000000000000" 147 | hex"0000000000000000000000000000000000000000000000000000000000000000" 148 | hex"0000000000000000000000000000000000000000000000000000000000000000" 149 | hex"0000000000000000000000000000000000000000000000000000000000010001", 150 | Msg: hex"f56379c42e3ba856585ca28f7fb768f65d273a5fc546156142857b0afb7c72d2" 151 | hex"d97ecfceec71b4260bdc58c9bb42065f53af69805d9006233ec70a591aff463b" 152 | hex"f23d78200fb8cc14a4eba286afe8924120efad9e3d3f06f7452c725e53728b8f" 153 | hex"86c9fb245fbaf7086ab0092e215213830d1091212efc1ec59ddc3a83707d4ab8", 154 | S: hex"5f49d8dc4519d9520d6542eca08cafb2d99cdb97c5a8685df2476b40505a2f9e" 155 | hex"8d63d76516b83481e2d961a7e8dc5f9f46887e394776711b0f85e4303065c06d" 156 | hex"362456bc219fc6eb343ede6733f779f75853533bc9ab876188da8ad98f9ea2f3" 157 | hex"35d2ceec34ef9cb2782bb0f79cad309608ddc222e00ebcff9d14f6e6ed39638b", 158 | n: FIPS186_2.n, 159 | pass: true 160 | }); 161 | } 162 | 163 | /* 164 | SHAAlg = SHA256 165 | e = 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010001 166 | d = 252c4956ac328ba04789bfdc5e90819981a100f3b540069ba8719b8b3ba27980cc7c96710a75ec0da83c1ddf353b45845f3db7224cdecbe5653cebb01fb66305d42e617e8a51514c6d2fb6b3cbe3ad9478ab7acb575f854ec9c9576a70c63934921c39662b32b8c93fb660f64f50e5481892a8ef4b92a64774995f2a0fbd64b9 167 | Msg = 399b54f756514628f32ce8f1cf391d77047af55f3d43804923e5e09a188aa27f28604f2f3cfa3d7091f3ab5c69d40d650137a597c22d531dbbdeae074f6f534a2b297e087cd7d7125e6f8eac97f5a990859d9d3555301c5076b02f9c4d3f84d62b3d090c7cb1ba1841eab668c066990079f206c15d1383eb3ba58ae17bc2dc2c 168 | S = a62e4b688bb3c4c2e11a3a0b1ef81ff4bbaa110c9b830d02bda2d364dadb2345a8c5dca58c611515f0c09732ee6a6642d5c5c339460a9d15022f48c36e9bc2fb8b2b0ff99005273287b8c3bed87993baf52f0e9d079281bc25a8694ed9692446127c26c34f21e610a84f3617247ecfb3b5337fe59d1239dfb7fdac8694dbef0b 169 | SaltVal = 00 170 | EM with hash moved = 0001ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff003031300d060960864801650304020105000420be1f73a059cec568dcdfddf1daff4201e79273653f88ef8f16be7e9ee660335aefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefef 171 | Result = F (4 - Format of the EM is incorrect - hash moved to left ) 172 | */ 173 | 174 | function format_of_the_EM_is_incorrect_hash_moved_to_left() public view returns (VectorTest memory) { 175 | return VectorTest({ 176 | e: hex"0000000000000000000000000000000000000000000000000000000000000000" 177 | hex"0000000000000000000000000000000000000000000000000000000000000000" 178 | hex"0000000000000000000000000000000000000000000000000000000000000000" 179 | hex"0000000000000000000000000000000000000000000000000000000000010001", 180 | Msg: hex"399b54f756514628f32ce8f1cf391d77047af55f3d43804923e5e09a188aa27f" 181 | hex"28604f2f3cfa3d7091f3ab5c69d40d650137a597c22d531dbbdeae074f6f534a" 182 | hex"2b297e087cd7d7125e6f8eac97f5a990859d9d3555301c5076b02f9c4d3f84d6" 183 | hex"2b3d090c7cb1ba1841eab668c066990079f206c15d1383eb3ba58ae17bc2dc2c", 184 | S: hex"a62e4b688bb3c4c2e11a3a0b1ef81ff4bbaa110c9b830d02bda2d364dadb2345" 185 | hex"a8c5dca58c611515f0c09732ee6a6642d5c5c339460a9d15022f48c36e9bc2fb" 186 | hex"8b2b0ff99005273287b8c3bed87993baf52f0e9d079281bc25a8694ed9692446" 187 | hex"127c26c34f21e610a84f3617247ecfb3b5337fe59d1239dfb7fdac8694dbef0b", 188 | n: FIPS186_2.n, 189 | pass: false 190 | }); 191 | } 192 | 193 | /* 194 | SHAAlg = SHA256 195 | e = 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010001 196 | d = 252c4956ac328ba04789bfdc5e90819981a100f3b540069ba8719b8b3ba27980cc7c96710a75ec0da83c1ddf353b45845f3db7224cdecbe5653cebb01fb66305d42e617e8a51514c6d2fb6b3cbe3ad9478ab7acb575f854ec9c9576a70c63934921c39662b32b8c93fb660f64f50e5481892a8ef4b92a64774995f2a0fbd64b9 197 | Msg = b8518b80a55b365eb1850e18f88da2941c99543c2f865df3d37d114d9fc764ffc5e2ae94f2d4ab6276bfc6bda5b6976a7dcfaa56897982880410dd5542af3ad34c469990cbec828327764842ef488f767c6b0c8cd1e08caec63438f2665517d195a4d4daf64bc2a70bd11d119eec93a060960245d162844c5f11a98cd26003e1 198 | S = 06317d3df0fa7ae350729ae2096b050dcec8909d36681ccca09a7a527b90767f8c2318c49e09483b48df77ddb632d6ca721155165389f7795d3ede70465678649399242aed6d984ca74fc6c2eb4dd4bb2cd7bf2125ec853f2bf757d665b29487bc5b63df0d0b03b18608d3d9a7576ea0954aef3d3303f7d8fd7e7f9725c114e2 199 | SaltVal = 00 200 | EM with trailer wrong =0001ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff443031300d060960864801650304020105000420a51c139e5ff91509eb0bd542bebfb9a4baa9399a5535d9168942298ce69c4f5b 201 | Result = F (5 - Format of the EM is incorrect - 00 on end of pad removed ) 202 | */ 203 | 204 | function format_of_the_EM_is_incorrect_00_on_end_of_pad_removed() public view returns (VectorTest memory) { 205 | return VectorTest({ 206 | e: hex"0000000000000000000000000000000000000000000000000000000000000000" 207 | hex"0000000000000000000000000000000000000000000000000000000000000000" 208 | hex"0000000000000000000000000000000000000000000000000000000000000000" 209 | hex"0000000000000000000000000000000000000000000000000000000000010001", 210 | Msg: hex"b8518b80a55b365eb1850e18f88da2941c99543c2f865df3d37d114d9fc764ff" 211 | hex"c5e2ae94f2d4ab6276bfc6bda5b6976a7dcfaa56897982880410dd5542af3ad3" 212 | hex"4c469990cbec828327764842ef488f767c6b0c8cd1e08caec63438f2665517d1" 213 | hex"95a4d4daf64bc2a70bd11d119eec93a060960245d162844c5f11a98cd26003e1", 214 | S: hex"06317d3df0fa7ae350729ae2096b050dcec8909d36681ccca09a7a527b90767f" 215 | hex"8c2318c49e09483b48df77ddb632d6ca721155165389f7795d3ede7046567864" 216 | hex"9399242aed6d984ca74fc6c2eb4dd4bb2cd7bf2125ec853f2bf757d665b29487" 217 | hex"bc5b63df0d0b03b18608d3d9a7576ea0954aef3d3303f7d8fd7e7f9725c114e2", 218 | n: FIPS186_2.n, 219 | pass: false 220 | }); 221 | } 222 | } 223 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /test/FIPS186_4.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: UNLICENSED 2 | 3 | pragma solidity ^0.8.13; 4 | 5 | import "./Suite.sol"; 6 | 7 | /* 8 | https://csrc.nist.gov/CSRC/media/Projects/Cryptographic-Algorithm-Validation-Program/documents/dss/186-3rsatestvectors.zip 9 | */ 10 | 11 | contract FIPS186_4 is Suite { 12 | function suite() public pure returns (VectorTest[] memory) { 13 | VectorTest[] memory vt = new VectorTest[](54); 14 | uint256 i = 0; 15 | vt[i++] = rs256_0(); 16 | vt[i++] = rs256_1(); 17 | vt[i++] = rs256_2(); 18 | vt[i++] = rs256_3(); 19 | vt[i++] = rs256_4(); 20 | vt[i++] = rs256_5(); 21 | vt[i++] = rs256_6(); 22 | vt[i++] = rs256_7(); 23 | vt[i++] = rs256_8(); 24 | vt[i++] = rs256_9(); 25 | vt[i++] = rs256_10(); 26 | vt[i++] = rs256_11(); 27 | vt[i++] = rs256_12(); 28 | vt[i++] = rs256_13(); 29 | vt[i++] = rs256_14(); 30 | vt[i++] = rs256_15(); 31 | vt[i++] = rs256_16(); 32 | vt[i++] = rs256_17(); 33 | vt[i++] = rs256_18(); 34 | vt[i++] = rs256_19(); 35 | vt[i++] = rs256_20(); 36 | vt[i++] = rs256_21(); 37 | vt[i++] = rs256_22(); 38 | vt[i++] = rs256_23(); 39 | vt[i++] = rs256_24(); 40 | vt[i++] = rs256_25(); 41 | vt[i++] = rs256_26(); 42 | vt[i++] = rs256_27(); 43 | vt[i++] = rs256_28(); 44 | vt[i++] = rs256_29(); 45 | vt[i++] = rs256_30(); 46 | vt[i++] = rs256_31(); 47 | vt[i++] = rs256_32(); 48 | vt[i++] = rs256_33(); 49 | vt[i++] = rs256_34(); 50 | vt[i++] = rs256_35(); 51 | vt[i++] = rs256_36(); 52 | vt[i++] = rs256_37(); 53 | vt[i++] = rs256_38(); 54 | vt[i++] = rs256_39(); 55 | vt[i++] = rs256_40(); 56 | vt[i++] = rs256_41(); 57 | vt[i++] = rs256_42(); 58 | vt[i++] = rs256_43(); 59 | vt[i++] = rs256_44(); 60 | vt[i++] = rs256_45(); 61 | vt[i++] = rs256_46(); 62 | vt[i++] = rs256_47(); 63 | vt[i++] = rs256_48(); 64 | vt[i++] = rs256_49(); 65 | vt[i++] = rs256_50(); 66 | vt[i++] = rs256_51(); 67 | vt[i++] = rs256_52(); 68 | vt[i++] = rs256_53(); 69 | return vt; 70 | } 71 | 72 | function rs256_0() public pure returns (VectorTest memory) { 73 | return VectorTest({ 74 | // mod = 1024 75 | e: hex"0000000000000000000000000000000000000000000000000000000000eef211", 76 | Msg: hex"23d29062797ec367d664542872324b63a72305caed23d04b0834b594801095d7521078cae54c21f33f04e622793fbe3f70b19c45bee2fb8fe98dba53d9462b6c9060675c150ee491b1c849e75ef1806f7db60d6fc7399fa986efe5e00546a399458c051ff10c33c9947a257f0a91b97b35fa034df170e4224922de45eb5826e6", 77 | S: hex"02d07177f91c0db0b74e34b532aa18673d27fdee370b7aa9094ef765c9a8278b7128f1bd24fd3992e6376f83bdea9e505be10de15163286a7c9d9873bdbcffe0535f9f8cb0dd99ba34e24ec462e4ad03618258b66894daeac9415545e030bd963f2beb8d089183ec7ff1be67e6f94e6871d42fb7d7c694682a9f4af599bfdf81", 78 | n: hex"8592b5850b9ba96e7faecbdd67e50ed5fb2018fda0bc6a09ab6345910fc445ac6bdb0e7a4c6b72c9441649c9e78109bbaa1d79f9fafb8794a1a06cb638bd8f3c3416d44c43cf862b8ac1d5006310b05a7760d341d07077ae775f1695061d3c7297dd3ab8fc5d03d09ed1602a1bb69891bb377fd0aad6cd90f8b207467db36279", 79 | pass: false 80 | }); 81 | } 82 | 83 | function rs256_1() public pure returns (VectorTest memory) { 84 | return VectorTest({ 85 | // mod = 1024 86 | e: hex"0000000000000000000000000000000000000000000000000000000000eef211", 87 | Msg: hex"1e422f898ff258a99bc53648541709b3a3bba5828d36d070b42bec6a2117d6e6403f0d762ce6179d2dc220e180b1e52156a9d0291eed64840787dc91c1f20fda841797a0547b32bb83b668a177276fc4aee64b21fefa391522cc4e7372dc5cd5f2b3152f8e1973aaa48757afc3df7041b35b5e91b5c317cc0be48a38bb3d837f", 88 | S: hex"2e37c8221597f7e2b1970c40a50db5fefde31b1dff1e9b9d6a70b023acb014971580eddf1d67f15d9fbbddfcdf49cda14ccb7516c33b787a3a3fd43d005d02de10f93ffc99585ae5dfaa766c0f1f5bfa62e50e76a059a4a1e814c1ee9836e01595731dce48f94aa1ae36d9c5165a3eb28013fac271e091f7018fe96ec26009c1", 89 | n: hex"8592b5850b9ba96e7faecbdd67e50ed5fb2018fda0bc6a09ab6345910fc445ac6bdb0e7a4c6b72c9441649c9e78109bbaa1d79f9fafb8794a1a06cb638bd8f3c3416d44c43cf862b8ac1d5006310b05a7760d341d07077ae775f1695061d3c7297dd3ab8fc5d03d09ed1602a1bb69891bb377fd0aad6cd90f8b207467db36279", 90 | pass: true 91 | }); 92 | } 93 | 94 | function rs256_2() public pure returns (VectorTest memory) { 95 | return VectorTest({ 96 | // mod = 1024 97 | e: hex"0000000000000000000000000000000000000000000000000000000000eef211", 98 | Msg: hex"084e3b56d68ea7c99068489e2c8080b9d3eb5ffea1e67eaea9c82af33935c5b960956ac0aec4d0ef3b0b71ecea50ebe9ef89a6c18f77b743279004cd703da91e01459b6516898b9d8ff30e1d3ca9fa6b5786135252cae734d410f6a1fe811627f248166c9645a27b9506665ca7f377e713c8eed97249d628b5314894696bd47f", 99 | S: hex"1b7dfda3e6da9e67ee9f207a9e03559fb5d7ec88f0310ac051e1e0612119214bcb11d1003bb5fbea088354c2a9c3318baa0264f67f0860f17528bfa63ee35f22908caf0e8e57c0ce63b334b747cc1a31ff90cdd550b27a34b05695a39d48e900a5e1ab4ce3f5030d903315a5dadbdbb0ffae04134a74cde2b99b8f8b5305759c", 100 | n: hex"8592b5850b9ba96e7faecbdd67e50ed5fb2018fda0bc6a09ab6345910fc445ac6bdb0e7a4c6b72c9441649c9e78109bbaa1d79f9fafb8794a1a06cb638bd8f3c3416d44c43cf862b8ac1d5006310b05a7760d341d07077ae775f1695061d3c7297dd3ab8fc5d03d09ed1602a1bb69891bb377fd0aad6cd90f8b207467db36279", 101 | pass: false 102 | }); 103 | } 104 | 105 | function rs256_3() public pure returns (VectorTest memory) { 106 | return VectorTest({ 107 | // mod = 1024 108 | e: hex"0000000000000000000000000000000000000000000000000000000000990d05", 109 | Msg: hex"c65f67c4843110ad555134fa8b9ec51dd9c93ff9ad5d96febffd6c95eaed88be3cd584f749c1c561c46bb11e50bd1bfd939202598cbd7c3e274cedce0f0e7ce3c452c8f6edf2d640ef904f1ebe20e8baf4a621e82041324e606942c83275db0b87609b8819cc2c93ff4776c47ece129d238f026e0ef3a07691dcd54bfa2c8b7c", 110 | S: hex"116b58e45693d6c80065cef13ab2f33ed6c4d3b6c5048ca2fac4c793b962c1d8315f6a76e379a0b4daa8e1ffe096291aa9c18b9a182d6f4c5b5bb6ed02b4a0fd39388e4ca5772165538aad34313696fa2a303ff024e25a301997f94860080783d87c7fd24f4eb7791a3b6be09c3f3ad0221ef8268444c40fd845617416119761", 111 | n: hex"8592b5850b9ba96e7faecbdd67e50ed5fb2018fda0bc6a09ab6345910fc445ac6bdb0e7a4c6b72c9441649c9e78109bbaa1d79f9fafb8794a1a06cb638bd8f3c3416d44c43cf862b8ac1d5006310b05a7760d341d07077ae775f1695061d3c7297dd3ab8fc5d03d09ed1602a1bb69891bb377fd0aad6cd90f8b207467db36279", 112 | pass: false 113 | }); 114 | } 115 | 116 | function rs256_4() public pure returns (VectorTest memory) { 117 | return VectorTest({ 118 | // mod = 1024 119 | e: hex"0000000000000000000000000000000000000000000000000000000000eef211", 120 | Msg: hex"edf40a32aed24e14439d8db48e80d92c4c11035dedd30d90a4ffde5dba8439cd274cf0bb63c155807a90f2cf5fac7add8297ffc5a4dd642ceae1162031dbf746a2229b3586a7b71d5bc2d6ac27324e320c5f73031de10a1d7046010a74105d0885fe7368be8d5b340fbda2148f183f7213f1c8ddffeae6ab5cb907e32b2b525a", 121 | S: hex"4e6e6482b8f163fb3c32ff454703a037b9882eec1f82dbd675c94accd79a476e12a347d2e9b4745d30164ce8484635aeddf1116df40b516e6b2af497d27f2194cceb801922aa6d55c935ad166bc477c8e54ab29c07f432b0aa3808e17d28254a0431fd0267e389a6b852f10df0f9a2f317c6a6e762c7395e743b38341828ac10", 122 | n: hex"8592b5850b9ba96e7faecbdd67e50ed5fb2018fda0bc6a09ab6345910fc445ac6bdb0e7a4c6b72c9441649c9e78109bbaa1d79f9fafb8794a1a06cb638bd8f3c3416d44c43cf862b8ac1d5006310b05a7760d341d07077ae775f1695061d3c7297dd3ab8fc5d03d09ed1602a1bb69891bb377fd0aad6cd90f8b207467db36279", 123 | pass: false 124 | }); 125 | } 126 | 127 | function rs256_5() public pure returns (VectorTest memory) { 128 | return VectorTest({ 129 | // mod = 1024 130 | e: hex"0000000000000000000000000000000000000000000000000000000000eef211", 131 | Msg: hex"b1bd4eedcbef7c57ecab2aed92cbd60052ddeb201181969a7713d53fa18ad16716a06d36fd341f1e8decffa5c41e1d695cf11861fbbfec65aabe0cf188e0b126bff77111b81d13308b53a232ba68c0ff1e1d3df82186e8802eb3a5bb6690c095950a810764730196d0283b1cda7166ca80a8836eed9e32f2ed3ac925a363a7bf", 132 | S: hex"7a0225a29a5f3e4592843c5c4d543d14ac544a3eeee9dd5e795ffa87c4e16dabaf07ef75363d773d89ca712df7c32010d3ca024ed84a954ff9625390e498d04e2c676f3c51ebf0a46fe22ccbffa53c52f9a292886e6a8b64efe5717c527dfaed41d2290c79c18ab28a96ab5afd2f071689653550a64be24fdb5f90a8014df659", 133 | n: hex"8592b5850b9ba96e7faecbdd67e50ed5fb2018fda0bc6a09ab6345910fc445ac6bdb0e7a4c6b72c9441649c9e78109bbaa1d79f9fafb8794a1a06cb638bd8f3c3416d44c43cf862b8ac1d5006310b05a7760d341d07077ae775f1695061d3c7297dd3ab8fc5d03d09ed1602a1bb69891bb377fd0aad6cd90f8b207467db36279", 134 | pass: false 135 | }); 136 | } 137 | 138 | function rs256_6() public pure returns (VectorTest memory) { 139 | return VectorTest({ 140 | // mod = 1024 141 | e: hex"0000000000000000000000000000000000000000000000000000000000d90b53", 142 | Msg: hex"10c21d2d4afdf3502dac1a791216d0c240b6b12061e0cf3033a7043380fd8756501cbe385d2553a6c7078aa909a3d2c22c2e9a743bd66503f6a8217ccab1b4f50163d916373b2ad80da17d8d211074213d76509fcede06f6984c95fea9e896b68b5f15d0be879f6f65429c2f40a4e066da587ca9043fda92815b09c103ec5521", 143 | S: hex"0411589c7d0860d41c7d4fef4d604b4dca0b160529209e762d5fc73df911e7bfdbe16feb0def70993e64eeb66888e47b3613256dfe04e75142ff2b325fd86b8e02eb01e4cd05b05cc788f014c170d584d092b7220a66133d4f0e949457eddc567eda792abe49b8a8fdfe177c6b6e0d7ac4262e95fa87c1277c46a759f9723cc6", 144 | n: hex"8f705d5529b5bf74600abc485bc4bb76deb9627088e51fdd26dd0f37bb3b98a9da4094d275d55011a844884122daf8b4abe99d43d918eb50d9642436647f60577c5f60fb9b810147a910dd7dd610318392dffa3fcc41f89f461bb5be85bf885b672cecf00da3af4d7d90074c4c0144c4bcd2d49145f8097648ec7230747f7033", 145 | pass: false 146 | }); 147 | } 148 | 149 | function rs256_7() public pure returns (VectorTest memory) { 150 | return VectorTest({ 151 | // mod = 1024 152 | e: hex"000000000000000000000000000000000000000000000000000000000009ffbd", 153 | Msg: hex"393f6cd3c89e67def9579e586c945fe97d567bae23c54a2e18c5f0903bc9df0b32ec9d9d533ec800c55b57dae2432234e065a52db1fd00ef27a043e35c15e9215167a22bd53856daa9586698e19735d08dd7e7a3996568ddf289b027ea5b467eded903e316371954ec7654fc31389fa7ccd3c978a4a489dec1a6c0c4ae42ff08", 154 | S: hex"327269d1d4d871a8be4ee49be39c5a51482fbe89d522c0d6cfb0ea6bf0c6f0b343a94222ef65058e27f5107e4f8d0ce20a064f19ac39189f221c5e62ad4fd7006eb1de620052bd35c268d5c1c6ee0f81e8b3f7f2977d2449167caaee2ca54d458108645268749651de6f7acaff09591d19ac99dc17d480ef3531ed4c14eb85bf", 155 | n: hex"8f705d5529b5bf74600abc485bc4bb76deb9627088e51fdd26dd0f37bb3b98a9da4094d275d55011a844884122daf8b4abe99d43d918eb50d9642436647f60577c5f60fb9b810147a910dd7dd610318392dffa3fcc41f89f461bb5be85bf885b672cecf00da3af4d7d90074c4c0144c4bcd2d49145f8097648ec7230747f7033", 156 | pass: true 157 | }); 158 | } 159 | 160 | function rs256_8() public pure returns (VectorTest memory) { 161 | return VectorTest({ 162 | // mod = 1024 163 | e: hex"000000000000000000000000000000000000000000000000000000000009ffbd", 164 | Msg: hex"036f62daacf68776f409d0595509a596a544b085ec7649687390324e1db78538fa90ea7b1abb0d659f9d50231663bde208433e35cb0510b79ec375f1f6eda97e128f186cd5d7cee6d5d22f10b076e8339fe5251a4df005bce9da4a1b795f566b72f553778652b141be2ed5e8c84a0fcf92b1cdfc183e0fbe7a5e1b9351177248", 165 | S: hex"56c4af89728a322066b8c291b4f03da5a038e4a44ffd9b49be9ee5d1a800da1c58e7a852218eaee853f9695dd308e1a5fd95b41a441c2a6bd124088868fa26f384c9ce87849b2eb5edac55cb95d5dcda7bfffea621b3fa66e6b200ce755b947e778fbae07490410509f5036a07280f943b7300562926cdca3b20097f1ffc24e2", 166 | n: hex"8f705d5529b5bf74600abc485bc4bb76deb9627088e51fdd26dd0f37bb3b98a9da4094d275d55011a844884122daf8b4abe99d43d918eb50d9642436647f60577c5f60fb9b810147a910dd7dd610318392dffa3fcc41f89f461bb5be85bf885b672cecf00da3af4d7d90074c4c0144c4bcd2d49145f8097648ec7230747f7033", 167 | pass: false 168 | }); 169 | } 170 | 171 | function rs256_9() public pure returns (VectorTest memory) { 172 | return VectorTest({ 173 | // mod = 1024 174 | e: hex"000000000000000000000000000000000000000000000000000000000009ffbd", 175 | Msg: hex"8c25bd2bed75a33ac134f9c1d445245fd8e580d6148fae11591c2b65382f271772d0941eb0577d2b748c99e7500c207b56efdd56cfa7852a302b47384956a4cec089810ebe987af0e8e47a8b91c488902d2ae4170983539e3adeb74ed451e2815c98ac827f0043930384c335ff3507a347dfbea02be9c172617da42f3fe98a37", 176 | S: hex"56254367f71f6f1fc6944ebd29f8a5592095ebc73ff5222bd815da17bac7f12290f747deaeb29b98c98d31a3ea32508d7683a67d449c59a0d6c16b4855aaa7d6f170c02c5cef61c9b6889207ad021017094d24246c4c90a0de055f02a5984efb67481684667eea36ad6373c36712625fa18d3ed41b1dec22f3bfb0d534e52da6", 177 | n: hex"8f705d5529b5bf74600abc485bc4bb76deb9627088e51fdd26dd0f37bb3b98a9da4094d275d55011a844884122daf8b4abe99d43d918eb50d9642436647f60577c5f60fb9b810147a910dd7dd610318392dffa3fcc41f89f461bb5be85bf885b672cecf00da3af4d7d90074c4c0144c4bcd2d49145f8097648ec7230747f7033", 178 | pass: false 179 | }); 180 | } 181 | 182 | function rs256_10() public pure returns (VectorTest memory) { 183 | return VectorTest({ 184 | // mod = 1024 185 | e: hex"000000000000000000000000000000000000000000000000000000000009ffbd", 186 | Msg: hex"2cb9740e0c1b8867866aa81c64122295854ed681e8eceabf0651bf7a65bc23996acfc8566f4bf42c151b7bf7db94eb57f0fb065546477549e829bafb8d4a67086dd48d87533378edf41d992e7fcfc425759a9c36bb9f4b32eed7767af6566f68ded0adeae25c7a70ca78ec09774d16c8bc357f6d6f7bd441bf62d942c768a580", 187 | S: hex"156747b263be659661e5e35e363d0523303ded9eec1e751575ab3a43156773a056acfd0daaa68625b1cc068458ff9e40ae167594bac846cca2b98bf6e5a4a01e961adfcd70206c05d66e3903a64b61afcbd17391ad0db529944fc2d0d7be3a4da8091cb75910f670d9515ee4f8ff3d62307eb54657e03a330e3cb0661e6fb796", 188 | n: hex"8f705d5529b5bf74600abc485bc4bb76deb9627088e51fdd26dd0f37bb3b98a9da4094d275d55011a844884122daf8b4abe99d43d918eb50d9642436647f60577c5f60fb9b810147a910dd7dd610318392dffa3fcc41f89f461bb5be85bf885b672cecf00da3af4d7d90074c4c0144c4bcd2d49145f8097648ec7230747f7033", 189 | pass: false 190 | }); 191 | } 192 | 193 | function rs256_11() public pure returns (VectorTest memory) { 194 | return VectorTest({ 195 | // mod = 1024 196 | e: hex"000000000000000000000000000000000000000000000000000000000009ffbd", 197 | Msg: hex"127498bf44b97a4a4ed7ad4bbc7c3781e2f83a53149fc95c1a6efa27def23d376866ec4b0c1c23e0e21ed1f677140f17c268b1965aa91b15e62d5749d4fb64024ee7d06569ff897ca026f0f282ff2f17a70dcc2ae8187fd8cfd241004dbaa6b9ab416c96c32b5429703930c543053e88782db49928b39cafc0a4e2d3b1f8ac66", 198 | S: hex"1976fe18cf82bf6ba851626bf94509348f56866930c771c82a6e12c30735c283694a0eeac9337e407525e0a831ba7eff77299c6896a85050b960718a40d5e34b7bf71eae4cdfad0d91d8fa6dfe37f30679ef444ccd360971ddc47e038123b7eceb3072f370796122aaf0b9427563280222328fc0068ae1dbd39a033740789536", 199 | n: hex"8f705d5529b5bf74600abc485bc4bb76deb9627088e51fdd26dd0f37bb3b98a9da4094d275d55011a844884122daf8b4abe99d43d918eb50d9642436647f60577c5f60fb9b810147a910dd7dd610318392dffa3fcc41f89f461bb5be85bf885b672cecf00da3af4d7d90074c4c0144c4bcd2d49145f8097648ec7230747f7033", 200 | pass: false 201 | }); 202 | } 203 | 204 | function rs256_12() public pure returns (VectorTest memory) { 205 | return VectorTest({ 206 | // mod = 1024 207 | e: hex"0000000000000000000000000000000000000000000000000000000000681201", 208 | Msg: hex"e24695128cc0f0e9905a6dcc1c54e481ef431c0426a13e2a51888984ccbb48864de601e8b927f04d3cccb323985f47cabde033f89b51035c3478f881f5e0fef64621deac6061b59f5e1ba5b8971fcaf22cda70bdddd883a021874621753e48e9f47d95242877292720cdaa55c29d564363bb3a1a953ea43d403fdc2cf5dd0fa9", 209 | S: hex"88b9604e95ccc993514a258d5a6785836b3c0ceda1f9a8359b1ec9592100c9b47572fb17d2c24dbd6b99ab46c408b7bd4b8094a44d05c2cde1145ab516b36926358f980ce1eb2e92793f65f34f09a4053f8deb77025052e12922e3f14823859d7e49aa54b7a7f0b20c1672e1a278ec631f955b4c19da05dd9c1f4487a0e08f31", 210 | n: hex"a16c7fcbb8d6fc602277e9cebb1790bd14999ef7670400c0bd0ea6116fc72e29b868c8b62ada0e7b4cd351b5a76c177f158b4f724f1d287d66df114eabd68e3e8d12409b69f96e334c0daff79392d184b9102ea5c4ec13052bfc509d9ae76851e8557a417b86e9d37687d243cf48812ce621c5f39404cd6b22a60beef744a42f", 211 | pass: false 212 | }); 213 | } 214 | 215 | function rs256_13() public pure returns (VectorTest memory) { 216 | return VectorTest({ 217 | // mod = 1024 218 | e: hex"0000000000000000000000000000000000000000000000000000000000681201", 219 | Msg: hex"820e27d35ad139ca305e9eb26c128ff59dcac86f05522e7e5721b458bf437fa22396493ea93903647942bef4c4afcb0a05a021d386c300a0260fd4395bb55c7473530b061f6baf983115501ea5f05b64de5e00e933f1d8f1aa20cbd6033f319ff9ae37d3c4508490e23e1dd717bd862ab36e2b5913c5fe996abc60d6c2c945", 220 | S: hex"519c717e336e7a28d648acf178931f6cb958684979b23e1d53ad32aa242e327699ca1a1f294feeb8b6ad8668b75a3e42ca4ce08a91c3fcae06c7974e6d9e23e622363cae4cdcd1914d31f38f95002b1a6da863e70c244411cb1be90ffea30ca4e345429e58eb751f676ea7ebee4363c552aa5bda5d57908fd5a87142db8d9821", 221 | n: hex"a16c7fcbb8d6fc602277e9cebb1790bd14999ef7670400c0bd0ea6116fc72e29b868c8b62ada0e7b4cd351b5a76c177f158b4f724f1d287d66df114eabd68e3e8d12409b69f96e334c0daff79392d184b9102ea5c4ec13052bfc509d9ae76851e8557a417b86e9d37687d243cf48812ce621c5f39404cd6b22a60beef744a42f", 222 | pass: false 223 | }); 224 | } 225 | 226 | function rs256_14() public pure returns (VectorTest memory) { 227 | return VectorTest({ 228 | // mod = 1024 229 | e: hex"0000000000000000000000000000000000000000000000000000000000681201", 230 | Msg: hex"d8330fa49a0a75f27470a2898ec1134666515fb467ad6b74be23dde26984d3f59028d467193307167717a2abc25aa6790d9acaa8f4ceb49274ce6f6d00161a2bd0c6dd9e7dee22e0cb0901f2c5c7fba31010ecb379453b39d0c95442f9c058bb40161291edc32e16184ea5a7bf907c8c16bbae1f1e9b6730791b72a97d0af56e", 231 | S: hex"5a692ebff6a43c5e63602018577fcac17415fcec4087e4c41065da33dbd7d87862de2e0c003bef2ebd0a411884811c7fbfa893590ea885acfb023857b904b0aff0e5061f2fe3376be5ae4de0510b2c34be6e0192722e63dd6f3fa9a7f8a191b7160997c463d7f7d46577e6cce534da08d1e5245b3a03b780f8144070cb66e6ff", 232 | n: hex"a16c7fcbb8d6fc602277e9cebb1790bd14999ef7670400c0bd0ea6116fc72e29b868c8b62ada0e7b4cd351b5a76c177f158b4f724f1d287d66df114eabd68e3e8d12409b69f96e334c0daff79392d184b9102ea5c4ec13052bfc509d9ae76851e8557a417b86e9d37687d243cf48812ce621c5f39404cd6b22a60beef744a42f", 233 | pass: false 234 | }); 235 | } 236 | 237 | function rs256_15() public pure returns (VectorTest memory) { 238 | return VectorTest({ 239 | // mod = 1024 240 | e: hex"0000000000000000000000000000000000000000000000000000000000681201", 241 | Msg: hex"243db9a1c203c792db3204bbfb3cea400d6e5efec0c935092f0df759c016e3c04c6b331f8115a1da85ad2989dcb911f18c3927327f7c4a4128382b996ada552eb51b6ba372d4b1bca113ce16c06ed116ef97711f53319908b8e224cd7aaae584a573ea935be90121768b7cca6f0232977fb2c62d03902c442533685bb92d99aa", 242 | S: hex"8d1a40fbd8186e3cd1dfbb529e1ee9ab13a6c8e6cf04e663a4de2349c05334f0ab3c694ea89397ca3e70a2a1957ac75a6544842af88cbe3ebf641f68cbce75638da1c953c3f594f8ee8b3825ab4aaafb9fb152f05bb7dcc07e3b666ca8626e69bb262bc240398007b871b7790eca96512d64f3ff94470224fa075ce3164cb1e1", 243 | n: hex"a16c7fcbb8d6fc602277e9cebb1790bd14999ef7670400c0bd0ea6116fc72e29b868c8b62ada0e7b4cd351b5a76c177f158b4f724f1d287d66df114eabd68e3e8d12409b69f96e334c0daff79392d184b9102ea5c4ec13052bfc509d9ae76851e8557a417b86e9d37687d243cf48812ce621c5f39404cd6b22a60beef744a42f", 244 | pass: true 245 | }); 246 | } 247 | 248 | function rs256_16() public pure returns (VectorTest memory) { 249 | return VectorTest({ 250 | // mod = 1024 251 | e: hex"0000000000000000000000000000000000000000000000000000000000eefc9f", 252 | Msg: hex"186594f37c9ff1fe3ef55bbb511dfebdcf5b64723cacddf80f4425326e3b411c3a84aa5b4b1ead19fd8e120feb8cfce3fafd10b59a21d9f5480e6b77575d47c9f1237fc459231b617241bace853a7dc13f93200df9cf6a733de5c8ba85f13501452a5c552c14017fa7f79d1fa88f48ffa505dca1e31e581af4b382237f61d16e", 253 | S: hex"9301ae4d76e84df108b70d94400c0b2dbf0b024fd5cdd5821c408ca2f52b7d4466a43abcbd8f40e9c07c4e4e56ad1ff471327e2e997d4e372d82c3e9f9db4d40d4d6308b4f7e5ac91c4ee2c194c038f8275dff82b9cce56ccbbd2ac3d12550f184b1cf938cefc85afc588c45c1ea055da0d4dadda266895cb4b84b846d8fac13", 254 | n: hex"a16c7fcbb8d6fc602277e9cebb1790bd14999ef7670400c0bd0ea6116fc72e29b868c8b62ada0e7b4cd351b5a76c177f158b4f724f1d287d66df114eabd68e3e8d12409b69f96e334c0daff79392d184b9102ea5c4ec13052bfc509d9ae76851e8557a417b86e9d37687d243cf48812ce621c5f39404cd6b22a60beef744a42f", 255 | pass: false 256 | }); 257 | } 258 | 259 | function rs256_17() public pure returns (VectorTest memory) { 260 | return VectorTest({ 261 | // mod = 1024 262 | e: hex"0000000000000000000000000000000000000000000000000000000000681201", 263 | Msg: hex"2ab6c6ad26e227177b6458a1caf18bc083c162a1f18b0fbc77b0baac19b7223e3df988c8b39dc9bcf4c7ca7ca70d18706a2bd057cef7bddaa397c16777f1763c596314c2e3b4961d774b1801c89f84c79cef6dc0d1333bc99e52891f1c95cb75055c3444bb10d7638c580cd7349015eca37701850127d1b0f04bda7d118c6a11", 264 | S: hex"8a270d2b49cd2897df192e12121ba6b92304e89a429753727e8cd7fd8395ee72788ecd58d91ab99b4385778fb8f9a5458a79790def0c05de8b5646c16f2f8f67652708573216f13335fbac257e4f6e46119fe5b50c309a7c01731c8f8fc240fc68f08f25879a32156dcded375c6ecaf0bf861066de3a034bbc00844dc74b8b6f", 265 | n: hex"a16c7fcbb8d6fc602277e9cebb1790bd14999ef7670400c0bd0ea6116fc72e29b868c8b62ada0e7b4cd351b5a76c177f158b4f724f1d287d66df114eabd68e3e8d12409b69f96e334c0daff79392d184b9102ea5c4ec13052bfc509d9ae76851e8557a417b86e9d37687d243cf48812ce621c5f39404cd6b22a60beef744a42f", 266 | pass: false 267 | }); 268 | } 269 | 270 | function rs256_18() public pure returns (VectorTest memory) { 271 | return VectorTest({ 272 | // mod = 2048 273 | e: hex"000000000000000000000000000000000000000000000000000000000049d2a1", 274 | Msg: hex"95123c8d1b236540b86976a11cea31f8bd4e6c54c235147d20ce722b03a6ad756fbd918c27df8ea9ce3104444c0bbe877305bc02e35535a02a58dcda306e632ad30b3dc3ce0ba97fdf46ec192965dd9cd7f4a71b02b8cba3d442646eeec4af590824ca98d74fbca934d0b6867aa1991f3040b707e806de6e66b5934f05509bea", 275 | S: hex"51265d96f11ab338762891cb29bf3f1d2b3305107063f5f3245af376dfcc7027d39365de70a31db05e9e10eb6148cb7f6425f0c93c4fb0e2291adbd22c77656afc196858a11e1c670d9eeb592613e69eb4f3aa501730743ac4464486c7ae68fd509e896f63884e9424f69c1c5397959f1e52a368667a598a1fc90125273d9341295d2f8e1cc4969bf228c860e07a3546be2eeda1cde48ee94d062801fe666e4a7ae8cb9cd79262c017b081af874ff00453ca43e34efdb43fffb0bb42a4e2d32a5e5cc9e8546a221fe930250e5f5333e0efe58ffebf19369a3b8ae5a67f6a048bc9ef915bda25160729b508667ada84a0c27e7e26cf2abca413e5e4693f4a9405", 276 | n: hex"c47abacc2a84d56f3614d92fd62ed36ddde459664b9301dcd1d61781cfcc026bcb2399bee7e75681a80b7bf500e2d08ceae1c42ec0b707927f2b2fe92ae852087d25f1d260cc74905ee5f9b254ed05494a9fe06732c3680992dd6f0dc634568d11542a705f83ae96d2a49763d5fbb24398edf3702bc94bc168190166492b8671de874bb9cecb058c6c8344aa8c93754d6effcd44a41ed7de0a9dcd9144437f212b18881d042d331a4618a9e630ef9bb66305e4fdf8f0391b3b2313fe549f0189ff968b92f33c266a4bc2cffc897d1937eeb9e406f5d0eaa7a14782e76af3fce98f54ed237b4a04a4159a5f6250a296a902880204e61d891c4da29f2d65f34cbb", 277 | pass: true 278 | }); 279 | } 280 | 281 | function rs256_19() public pure returns (VectorTest memory) { 282 | return VectorTest({ 283 | // mod = 2048 284 | e: hex"000000000000000000000000000000000000000000000000000000000049d2a1", 285 | Msg: hex"f89fd2f6c45a8b5066a651410b8e534bfec0d9a36f3e2b887457afd44dd651d1ec79274db5a455f182572fceea5e9e39c3c7c5d9e599e4fe31c37c34d253b419c3e8fb6b916aef6563f87d4c37224a456e5952698ba3d01b38945d998a795bd285d69478e3131f55117284e27b441f16095dca7ce9c5b68890b09a2bfbb010a5", 286 | S: hex"ba48538708512d45c0edcac57a9b4fb637e9721f72003c60f13f5c9a36c968cef9be8f54665418141c3d9ecc02a5bf952cfc055fb51e18705e9d8850f4e1f5a344af550de84ffd0805e27e557f6aa50d2645314c64c1c71aa6bb44faf8f29ca6578e2441d4510e36052f46551df341b2dcf43f761f08b946ca0b7081dadbb88e955e820fd7f657c4dd9f4554d167dd7c9a487ed41ced2b40068098deedc951060faf7e15b1f0f80ae67ff2ee28a238d80bf72dd71c8d95c79bc156114ece8ec837573a4b66898d45b45a5eacd0b0e41447d8fa08a367f437645e50c9920b88a16bc0880147acfb9a79de9e351b3fa00b3f4e9f182f45553dffca55e393c5eab6", 287 | n: hex"c47abacc2a84d56f3614d92fd62ed36ddde459664b9301dcd1d61781cfcc026bcb2399bee7e75681a80b7bf500e2d08ceae1c42ec0b707927f2b2fe92ae852087d25f1d260cc74905ee5f9b254ed05494a9fe06732c3680992dd6f0dc634568d11542a705f83ae96d2a49763d5fbb24398edf3702bc94bc168190166492b8671de874bb9cecb058c6c8344aa8c93754d6effcd44a41ed7de0a9dcd9144437f212b18881d042d331a4618a9e630ef9bb66305e4fdf8f0391b3b2313fe549f0189ff968b92f33c266a4bc2cffc897d1937eeb9e406f5d0eaa7a14782e76af3fce98f54ed237b4a04a4159a5f6250a296a902880204e61d891c4da29f2d65f34cbb", 288 | pass: false 289 | }); 290 | } 291 | 292 | function rs256_20() public pure returns (VectorTest memory) { 293 | return VectorTest({ 294 | // mod = 2048 295 | e: hex"000000000000000000000000000000000000000000000000000000000049d2a1", 296 | Msg: hex"915c5e4c16acfa0f49de43d6491f0060a944034475ba518572c08366a8d36c7f1e6afc11e5e4649757bf7b9da10a61d57f1d626847871d8a2948e551b54167c79de88d3ebd40a3e35809b996a53348f98a9918c7a7ec606896ed30c271e00c51953dd97aa6a8fe1cd423c3695c83fcf45120ec0a9cd1644642182b60e599a246", 297 | S: hex"3d57ea5961db8fc144301ca4278f799911229d865ea3e992c7fbc4d03c6551729e26034e95dd71da312340e4051c9dd9b12f7700a821fe3b7c37785d5106350b667ac255a57c13da5842d90bcadea9e6b1f720c607d6893a2caa3c5f3c4074e914451a45380a767c291a67cac3f1cab1fbd05adc37036856a8404e7cea3654019466de449ad6e92b27254f3d25949b1b860065406455a13db7c5fe25d1af7a84cddf7792c64e16260c950d60bd86d005924148ad097c126b84947ab6e89d48f61e711d62522b6e48f16186d1339e6ab3f58c359eb24cb68043737591cd7d9390a468c0022b3b253be52f1a7fc408f84e9ffb4c34fa9e01605851d6583aa13032", 298 | n: hex"c47abacc2a84d56f3614d92fd62ed36ddde459664b9301dcd1d61781cfcc026bcb2399bee7e75681a80b7bf500e2d08ceae1c42ec0b707927f2b2fe92ae852087d25f1d260cc74905ee5f9b254ed05494a9fe06732c3680992dd6f0dc634568d11542a705f83ae96d2a49763d5fbb24398edf3702bc94bc168190166492b8671de874bb9cecb058c6c8344aa8c93754d6effcd44a41ed7de0a9dcd9144437f212b18881d042d331a4618a9e630ef9bb66305e4fdf8f0391b3b2313fe549f0189ff968b92f33c266a4bc2cffc897d1937eeb9e406f5d0eaa7a14782e76af3fce98f54ed237b4a04a4159a5f6250a296a902880204e61d891c4da29f2d65f34cbb", 299 | pass: false 300 | }); 301 | } 302 | 303 | function rs256_21() public pure returns (VectorTest memory) { 304 | return VectorTest({ 305 | // mod = 2048 306 | e: hex"000000000000000000000000000000000000000000000000000000000007485b", 307 | Msg: hex"03d2f0693517cffb2b724c1f30502c5359c051c1bcd88dc1dd54b89e6981009d275a813b2bf016b74d0f6ed0d91e62d0884785c9afd8fd1fb7e99246cd4005cdda71a39cb649197a996d8ad2d23fdfb6bb015f24ec3d7f88af64fb83b4b525eb06607d133eec834cf7d6c9ab817b4c0dda370459d9cfba05ad0c1adc86a909fe", 308 | S: hex"511abd82218cab344979b2887b02600d2427f1eb12ac01d97684c2a443a9272834c3f79cded07a39dbee3770dde827a74dc994b17bfd8a26d07b239d26d58c42f79d560264c31b7e1c3dddef6d7556f228c394414f4cec561c3da2686a8eebec7702f32850809a93deeb84b2a02fcdba224d2fd9efb8e056e796f49b57d56e9f3e90d0b49b08bdee93a2e12e676fb4d4fa838c5bd88eda008f1b592a72465587be0ae17d9b156b904f44a7e04d3b58d24ad67b71b0f4c699fa51639546b62b9f83597ff03d465f1bb396ae15e92d0e92e85647d5df113e2c7518d0e3ad2e7aa7dac720c98347aa151e4f37fea081dbed350cc9c93f606b38f21a3e5de6d140d2", 309 | n: hex"c47abacc2a84d56f3614d92fd62ed36ddde459664b9301dcd1d61781cfcc026bcb2399bee7e75681a80b7bf500e2d08ceae1c42ec0b707927f2b2fe92ae852087d25f1d260cc74905ee5f9b254ed05494a9fe06732c3680992dd6f0dc634568d11542a705f83ae96d2a49763d5fbb24398edf3702bc94bc168190166492b8671de874bb9cecb058c6c8344aa8c93754d6effcd44a41ed7de0a9dcd9144437f212b18881d042d331a4618a9e630ef9bb66305e4fdf8f0391b3b2313fe549f0189ff968b92f33c266a4bc2cffc897d1937eeb9e406f5d0eaa7a14782e76af3fce98f54ed237b4a04a4159a5f6250a296a902880204e61d891c4da29f2d65f34cbb", 310 | pass: false 311 | }); 312 | } 313 | 314 | function rs256_22() public pure returns (VectorTest memory) { 315 | return VectorTest({ 316 | // mod = 2048 317 | e: hex"000000000000000000000000000000000000000000000000000000000049d2a1", 318 | Msg: hex"dffe42bfda886e1a73fe8a8dfcf71c9fb44deb054588a9bb9199d554aecce08f2ff88f2aa6f8a0fb675fb03c8e685c27432ca7c33c189bfd849d34fa7b2979ac1f57eca389632426bae0b98398ad60a3342557e14e96041c1bf4d90b46cf7ad1348322d28caf43c4f7e86c0924ae703c109ec50a84ea2a43df078c3015a52b28", 319 | S: hex"8f4dd479239f2d08dc05d7d40539288b67c4d77210ecb16be76f0b1925e8b088570831e361a1ca57893135f8af64b8e2996b8d635899da4e04c68acb9b1b3813697d57da90c57f18509e0ab6705c704feb448cca5c07d258ecd884ab93f508cefdb25f2bc3061c4006099e2e33b27972c3edb0a0a33114d381c82ab506d041ff680af595ef3400a8bb6774030d2e38dd304272092bd32a553017f7bda4b998b27aa8aca12def327b1f11063a5342b0d55738183417d321c5682fc4ab64e79174216feebb989521e1e3d827647068003be34fe1d093964d28f4877c49b4065672448597a89b91919cfb55ca13836e7e6f3b3fd04f417cf1c16d9872538bf4e87a", 320 | n: hex"c47abacc2a84d56f3614d92fd62ed36ddde459664b9301dcd1d61781cfcc026bcb2399bee7e75681a80b7bf500e2d08ceae1c42ec0b707927f2b2fe92ae852087d25f1d260cc74905ee5f9b254ed05494a9fe06732c3680992dd6f0dc634568d11542a705f83ae96d2a49763d5fbb24398edf3702bc94bc168190166492b8671de874bb9cecb058c6c8344aa8c93754d6effcd44a41ed7de0a9dcd9144437f212b18881d042d331a4618a9e630ef9bb66305e4fdf8f0391b3b2313fe549f0189ff968b92f33c266a4bc2cffc897d1937eeb9e406f5d0eaa7a14782e76af3fce98f54ed237b4a04a4159a5f6250a296a902880204e61d891c4da29f2d65f34cbb", 321 | pass: false 322 | }); 323 | } 324 | 325 | function rs256_23() public pure returns (VectorTest memory) { 326 | return VectorTest({ 327 | // mod = 2048 328 | e: hex"000000000000000000000000000000000000000000000000000000000049d2a1", 329 | Msg: hex"cfe99788f55ec6944942bd0a187d51b80fd8bd4051bd4f07c73e614eb75a8b9f997b176b2642b5f1b1877061ba9ce142c1d2a311583f072b7cbe08ed253681191c209d7b0d438fcdddc284d93d59d6dd80e48333a921dd31c9b6834f88768f8701e01102d3e8bdf074fbe0b8c93d9951f41545ef6eeb3be35530babc079f1fb3", 330 | S: hex"9fd6f6107e838107f906c26cb2910704599f175b6a84db485fbc30776eb7fd53bfe20c38c537b154a3e519b662bd9fdc8e3045e21f6e5ae97d0ff6a9d8632825544525d84f99f80e3ed4e69dc5e219d59ccfbb37c23c84fe3b3e6fb22f402f94e5225c6387fdf8bcdb3508f8832908fe05771521e92234348004e8fe19a8f24bebcab9f074327c88d066bc12081748d696be6135c6aea32220ea786ebd7800e6936365ff25831c28cb6c8a59237ff84f5cf89036cff188ee0f9a6195f2b1aca2e4442af8369f1b49322fa2f891b83a14a97b60c6aeafd6c2928047affda9c8d869ff5294bb5943ad14a6d64e784d126c469d51e292b9ce33e1d8371ba5f467b3", 331 | n: hex"c47abacc2a84d56f3614d92fd62ed36ddde459664b9301dcd1d61781cfcc026bcb2399bee7e75681a80b7bf500e2d08ceae1c42ec0b707927f2b2fe92ae852087d25f1d260cc74905ee5f9b254ed05494a9fe06732c3680992dd6f0dc634568d11542a705f83ae96d2a49763d5fbb24398edf3702bc94bc168190166492b8671de874bb9cecb058c6c8344aa8c93754d6effcd44a41ed7de0a9dcd9144437f212b18881d042d331a4618a9e630ef9bb66305e4fdf8f0391b3b2313fe549f0189ff968b92f33c266a4bc2cffc897d1937eeb9e406f5d0eaa7a14782e76af3fce98f54ed237b4a04a4159a5f6250a296a902880204e61d891c4da29f2d65f34cbb", 332 | pass: false 333 | }); 334 | } 335 | 336 | function rs256_24() public pure returns (VectorTest memory) { 337 | return VectorTest({ 338 | // mod = 2048 339 | e: hex"000000000000000000000000000000000000000000000000000000000066a13d", 340 | Msg: hex"41c00eae64f3e330222e114541eeb5eae1a705ca0c0687a68e7982fa07f1b3de3ee7402ab89df2dd8aa69ec06ba8e4460d611cb7aee88e8dea35e11fd3e4d77c4336379a71590ab0c3e909e0e3b6571915c86c3cc8a0517d6ac1130d816f72f6f8b7d946b6af936f76ff3beed2a0742ba0e4dba082b73a3eb924ff0c3a1bec12", 341 | S: hex"13165444a1f039da049b998e332cf7655149975713b5378ac5772f2e176ddbf338a25e297d873cca5f19eb4e4157c532d06249d1e99c2857f8d74bb74cc7593bc872daf5b45541a373aadc43a0711b3b2f27ccfed06d9578b2a3c7d10a12e398d0302f86e05f154e3cfd2a0e072aae157cae529bd5688fd0ccea22f58181d069eaa0957a5b0eaa2e3f5a4aeaf3d1512a43dd2f8434579eb57e23852d7323c5dd22359e9dfec59dd75ee3b8e234a41863fe0a68c46f777a9f48887a786cfaa40db1c7d9e04efb8a882d8169764b47a013b5d1d15f4cbf758adc83c53e9548e77de20f14b3b5f064465beaaa32ee41755aa48264a14df837ce5fb85a5ab91bf6eb", 342 | n: hex"a17a08272e656cf600f4650ef0952b15d568d9fb7f1b3f3559aa3792743f7d895e4e26dec2bf09996de8a99f7c434bc25b0c7d61e83fe5647c213b19902abfa053321a16048642cd3800de26172eb39ccab029130ceb82e5c25c676e89007cb00666a2d8f64e59fea64628cbec9c361abe25841551db01f58b80ab17f02a93cbaaffc2630ffb6f56f206b8a6f8e0f1e5790652e7c7227258dbcd5924e94876f983ed02e4e82272f5d44967bc501d1515d80dc25d5c838d0357d0d1704b0253d6e78802c02931000fea2e865c90b266c8a0b472e8eb17456777973342da6978cb45d2100cf91ca6f6d69ff30ee8f3164bfb180de0b355c067bd8f1a8544b9aac9", 343 | pass: true 344 | }); 345 | } 346 | 347 | function rs256_25() public pure returns (VectorTest memory) { 348 | return VectorTest({ 349 | // mod = 2048 350 | e: hex"0000000000000000000000000000000000000000000000000000000000391c9d", 351 | Msg: hex"671ada018b6132b381978036f19cb9fa9cf7d07334642cbf718c59896113fe2d00d70f1c087743830a13c927be53379398abc3769bddb54772bf1c2abd3ec017a9a35939c315fe940e5fe0eb52f438e1b8307e5e94e1dc348206e203b4d77b5a8a05201e63424b30b4042f4a5786a62a25106bf3c67989d0c8ea13daefe4163c", 352 | S: hex"2942af5fb4e5230990bd20c2095fa29e9aefe6e6489111971f0dd397e8d461ab3f59c0f29b86d11ff187984c54c51b0bea35f479a4b83c33dcc8f149f56eb9859a71e45f3a33b83d30eca87bf19803eb5888ead3151d9b673546e2c0dbdb523c34331cbd3a83baae6b55dc465de20d40c5bca9647d74b8399d6e40404828772690afb93b314a55efb5149603c8421fd85ba5b61828c6f679b53f929398d87affb8929e4684631aa2e86d492d3d7c9a90c58e465080442f69623e4eb2080f7af2ed0442c0bb3f0eccf45d4f075e4474a2c058665f25164c457fd19e5852061af9b232cfd2eae7b60001364c013a1155a9af18cbc134d1ee8d30c157cde3a9ffbc", 353 | n: hex"a17a08272e656cf600f4650ef0952b15d568d9fb7f1b3f3559aa3792743f7d895e4e26dec2bf09996de8a99f7c434bc25b0c7d61e83fe5647c213b19902abfa053321a16048642cd3800de26172eb39ccab029130ceb82e5c25c676e89007cb00666a2d8f64e59fea64628cbec9c361abe25841551db01f58b80ab17f02a93cbaaffc2630ffb6f56f206b8a6f8e0f1e5790652e7c7227258dbcd5924e94876f983ed02e4e82272f5d44967bc501d1515d80dc25d5c838d0357d0d1704b0253d6e78802c02931000fea2e865c90b266c8a0b472e8eb17456777973342da6978cb45d2100cf91ca6f6d69ff30ee8f3164bfb180de0b355c067bd8f1a8544b9aac9", 354 | pass: false 355 | }); 356 | } 357 | 358 | function rs256_26() public pure returns (VectorTest memory) { 359 | return VectorTest({ 360 | // mod = 2048 361 | e: hex"000000000000000000000000000000000000000000000000000000000066a13d", 362 | Msg: hex"be91864d3728f895c689f09b28484138e0afa29589bba7486a68f0bf4b2ea1e287cc11f46344c7ba9e27a2e049125798d97921847ba3b3d6a7f672b6f875e1e43b875c9ec6fa0ac40b470d3a6c18fb8e510792da78a9a7ec8dcb60a5fbfba39f014bce120851a9f9347299703961166170e25e5f2ad46bd2446e2355fbc9d05c", 363 | S: hex"631529e0b149ee1528d514861cac711eab8c01c1c22c7ff6ccbc08783a1ccb2748c22e57a1deefa867dcb1ae74c40b1969db2cee64c0706af8daf4c9e91c12672d8f0849af4bd0c4c5f8e439a3ba7e3ddf38a9b38db545410dec0aa40522d6a3cbc2ab53a838298f0b93ae7d362158f04858fc33ec03fa6d3b7ff0f27d74cc4abcedd25642f4d259d41511456004c24385ec32553ae5d5728a8f68707ddd6bfa51c2f4574e1c96ef4db0715675fa4fbc57b9091759eda387e16057e9d89797f61df9196044b98667866e12c5132928eb735fa2d02c0ee7e08ed68d80fe1f76bd85756a3967c6d3e1378a754fecee72362928cb622731bb01231758ebcb805f5e", 364 | n: hex"a17a08272e656cf600f4650ef0952b15d568d9fb7f1b3f3559aa3792743f7d895e4e26dec2bf09996de8a99f7c434bc25b0c7d61e83fe5647c213b19902abfa053321a16048642cd3800de26172eb39ccab029130ceb82e5c25c676e89007cb00666a2d8f64e59fea64628cbec9c361abe25841551db01f58b80ab17f02a93cbaaffc2630ffb6f56f206b8a6f8e0f1e5790652e7c7227258dbcd5924e94876f983ed02e4e82272f5d44967bc501d1515d80dc25d5c838d0357d0d1704b0253d6e78802c02931000fea2e865c90b266c8a0b472e8eb17456777973342da6978cb45d2100cf91ca6f6d69ff30ee8f3164bfb180de0b355c067bd8f1a8544b9aac9", 365 | pass: false 366 | }); 367 | } 368 | 369 | function rs256_27() public pure returns (VectorTest memory) { 370 | return VectorTest({ 371 | // mod = 2048 372 | e: hex"000000000000000000000000000000000000000000000000000000000066a13d", 373 | Msg: hex"4c2d1103c36e96d179291397b1238177d4af3b6fb9dc622d23ed80258b096be020346d970d7ea100fa7aa068d5f25d02d2d94e7fb081cdde3f0fbd861f2b7092cafcc86cd4539d9d72265fe33a41fd84293805e3eaa00c51557e502537009c0f516b6ca9a355524fea149831677627a6e2b3a7c4ef9fe82d7024812b5bf0b700", 374 | S: hex"4d8b5ba1f5409f476221b3527be6389c1ca3eb50cd62113ad2f712cb2142ceff3178948670c9cb7dccd44896ddec9c0eba228370cb23919610774e9d70d6eade95865042edca6e90cdc007234400591e1cce71bfbf5a546548d483e68905113693a3d1719ce376e72b180b7f3c7ecd13469b8edd7ef95d9e330d78cb36e37b50e87d161b1abdec433421a3a65b49b39cacde0678de41df894d6a2b0f171cf91052bf0f0bb7cc89889bed7699e33540b4ec8f93ca2c690783dc5d80fa5b815aab0feb3ef4f10c0cb46496aaf6dfd2e5b3a7dd64386ab9a4da0319bd927facaea80ba5f4b1d71e16fcc7550fd8211756c35935507a32f204858e2b475d28eb56c8", 375 | n: hex"a17a08272e656cf600f4650ef0952b15d568d9fb7f1b3f3559aa3792743f7d895e4e26dec2bf09996de8a99f7c434bc25b0c7d61e83fe5647c213b19902abfa053321a16048642cd3800de26172eb39ccab029130ceb82e5c25c676e89007cb00666a2d8f64e59fea64628cbec9c361abe25841551db01f58b80ab17f02a93cbaaffc2630ffb6f56f206b8a6f8e0f1e5790652e7c7227258dbcd5924e94876f983ed02e4e82272f5d44967bc501d1515d80dc25d5c838d0357d0d1704b0253d6e78802c02931000fea2e865c90b266c8a0b472e8eb17456777973342da6978cb45d2100cf91ca6f6d69ff30ee8f3164bfb180de0b355c067bd8f1a8544b9aac9", 376 | pass: false 377 | }); 378 | } 379 | 380 | function rs256_28() public pure returns (VectorTest memory) { 381 | return VectorTest({ 382 | // mod = 2048 383 | e: hex"000000000000000000000000000000000000000000000000000000000066a13d", 384 | Msg: hex"e896edb0455f372c01d222d40af9298bc17fdbf450b4d0923dd7e12d4095987752cde6ef079614061d83fc805526791e81d21c7adfa52132a5c6a148ddec09c97320caad8dc352ff1ad23c3eae69c3028d867de20610469602187959dc5e6791731701b27eedd860204848d4bdccef800b2364f66cfc26067b53d326e4f39b18", 385 | S: hex"6e21208ce42d4ec6512c300f6f9c0d43163eef7e05365448380ce3fec34913a701a5e30455556335101af1ba40ea69fc17b30c4192730336e8af2094d36873cc83617a3feebd2b09dccac1b31b9352c1db3c3dbb7ea1e774578e44c92ea925dafd9de71c46d3f25eb015199150e6e8c26ee612edc3fe2f0ca6acdca9274fcaa87d97e104112b1f85d1c3f3e92f0be7932613afe5a683c0e52f9234fd9ef979844e277e31d3c2b725bbebe97a9a8e619f8308c01a9b3ee48e5dfcca5b153e4890effb297ee0fecd30fd71b6dea0694530fbad6c65abc4621f23263ceaf2cfa21fcd19cb180812667e8b1ae108323ec289826412f124547ddd92024c0ea9784654", 386 | n: hex"a17a08272e656cf600f4650ef0952b15d568d9fb7f1b3f3559aa3792743f7d895e4e26dec2bf09996de8a99f7c434bc25b0c7d61e83fe5647c213b19902abfa053321a16048642cd3800de26172eb39ccab029130ceb82e5c25c676e89007cb00666a2d8f64e59fea64628cbec9c361abe25841551db01f58b80ab17f02a93cbaaffc2630ffb6f56f206b8a6f8e0f1e5790652e7c7227258dbcd5924e94876f983ed02e4e82272f5d44967bc501d1515d80dc25d5c838d0357d0d1704b0253d6e78802c02931000fea2e865c90b266c8a0b472e8eb17456777973342da6978cb45d2100cf91ca6f6d69ff30ee8f3164bfb180de0b355c067bd8f1a8544b9aac9", 387 | pass: false 388 | }); 389 | } 390 | 391 | function rs256_29() public pure returns (VectorTest memory) { 392 | return VectorTest({ 393 | // mod = 2048 394 | e: hex"000000000000000000000000000000000000000000000000000000000066a13d", 395 | Msg: hex"3f49b00ac1f9255907cc03f9b45dc787c250d9d6833fb389e2f746e1ede599d390cbb45ea3b7bc1b28365f16cdc573dcb988d9d5843fa8d4877587ed57fa5b878c9423b1c7f21fbaf3e138fbcac39cf89b3ca9a84b2e0c109be82a17a89abf95b80cc4ad3390975df0365653b23e8b02f3d30ff6e0f62864a4b8f506e9ac0c25", 396 | S: hex"90ac97a93a9f6c5c6e268e3464b6d547dc29bff8797d9f776e2f56fe1c30fefbb679ca9fafba40f400f08a5163d757e638aee083084581b760ab30071e075f90183db328e1ab519fedca1ed92a1e4e473b538e2470606b5379abd2e4b73f4c132e30c115bc34c73019880571c30fa6c6c1e320c13022317cd3acea8c520f87cf054e84be89a952202fc3f8d0d707cd8806b8b22bf2c0d7bf884688607a05b635210b9a7e2e1d2a28e324c1573d363d5a76ea0aaac70480671caa4969e5177448e62e76270197697fcaab720d811588c8ab540f053c8b23b7cefad205fd4c444bd5e73d80c62451158331face2b6f7ddb034dd5e61bec444f68d0c7e39d2df940", 397 | n: hex"a17a08272e656cf600f4650ef0952b15d568d9fb7f1b3f3559aa3792743f7d895e4e26dec2bf09996de8a99f7c434bc25b0c7d61e83fe5647c213b19902abfa053321a16048642cd3800de26172eb39ccab029130ceb82e5c25c676e89007cb00666a2d8f64e59fea64628cbec9c361abe25841551db01f58b80ab17f02a93cbaaffc2630ffb6f56f206b8a6f8e0f1e5790652e7c7227258dbcd5924e94876f983ed02e4e82272f5d44967bc501d1515d80dc25d5c838d0357d0d1704b0253d6e78802c02931000fea2e865c90b266c8a0b472e8eb17456777973342da6978cb45d2100cf91ca6f6d69ff30ee8f3164bfb180de0b355c067bd8f1a8544b9aac9", 398 | pass: false 399 | }); 400 | } 401 | 402 | function rs256_30() public pure returns (VectorTest memory) { 403 | return VectorTest({ 404 | // mod = 2048 405 | e: hex"00000000000000000000000000000000000000000000000000000000003c7bf9", 406 | Msg: hex"fc8e19e3b26bbf7c8c33a452b7ee02cbcf56fa94a58b7cee3e0866481fd6f013c7ff47d27e4678704d1590d74eb701be26c748c2cfe9cdb99bb80b4375fff0a16a2b87cb6900d4bc478c00110659b6d257e7cc905d5926b0b46fd706b2b48aa6edf921f6fd019b08837e3b276a3ce6b06c9dce24d8454d7a931613ba5d5f84c7", 407 | S: hex"058bcfa4b10ac6a73918a07b9f0a8db1ebab9a0ee5c7f0a2261b98efb3592eeb6bf45fceae24ff20c2683e1b33291f49a7f86d7fe239c58a45910a14748e10c25a4dfa693e5a77138de2fe5f61de0a09078cd0d3c61b1e740bca7a3d4048d4fa12fe69412438efa18216819be40733500acd8087f429da734fce6a97fcdc9c32991dc847e4d653260890304f378a10b7754cb4ac5efd7a3db23bd44b6542b81ae9fc33edca6eb1570b1a39a0b8976626c3892afc42e6fbfa8bfbc191c3d026a6248e7ee391f977ea5f0442306ce87702ced7b3f00bf0a6040604d0a663859737ec6c04dc84763d1cb63c4da8381a08cc52b370ba09515b93d9a6d3e47c5929aa", 408 | n: hex"c9548608087bed6be0a4623b9d849aa0b4b4b6114ad0a7d82578076ceefe26ce48d1448e16d69963510e1e5fc658f3cf8f32a489b62d93fec1cdea6e1dde3feba04bb6a034518d83fd6138ea999982ab95d6a03517688ab6f8411c4a96b3e79d4141b8f68338a9baa99f4e2c7845b573981061c5fd29d5fc21833ff1b030b2deb651e51a291168e2b45ab4202dcd97b891925c75338e0e648d9d9ad325c10884e1fcdccc1c547b4a9c36aef939e8802b62405d6e3d358ffa88f206b976b87f8b12b827b0ee7823f9d1955f47f8678f7843b4cd03777e46717060e82bf149b36d4cf3d0bc7e4d0effde51a72f4ced8e8e5b11bdb135825ff08873e2f776929abb", 409 | pass: false 410 | }); 411 | } 412 | 413 | function rs256_31() public pure returns (VectorTest memory) { 414 | return VectorTest({ 415 | // mod = 2048 416 | e: hex"00000000000000000000000000000000000000000000000000000000003c7bf9", 417 | Msg: hex"4c587ab2ddd6b13bf7a916b5d571d7613f24258201b1421b9de4dcfb3d8a99f7ebd5f37704024634ea38273ffab4f846be23b913634f21556dfeeea3a91779be63078d16da637990f1cf6487271ee111c9bbc483674733378483008c9171362f1db6f199464373d97334759445f8bb4acab3ebdaf4e09f494a3bb9bfdedef7d2", 418 | S: hex"052bc5efecb052b92821c405e6f22cf374dd1ce4bf691eb8abcc1cd01254a6e51fe9237cfb9cadfe32a8780135949399b048d26f5de49bb9d008d39b749527eadd13066baff87765eb255021517a2ea69e45bd35db1fba9219c94f944b2c9a33a37779505c8eae52d6061988d152f9f51f0002e545973402294dda7f7c7cc3135c37ced8cf723d4011d1ac16bc1d0bd670eb7f63f079f30dad8cf55c326a33bc1684ff17a91509f4ead4f93c3c0eb6679eab612e05fc71b936c99ca8579cdeb9f26200a4bce89e330fd5d84b1ec98cc1d758243001fb18bc325b630a58154c2d38a5a8ac2ae6cfa54a20f7580a745c206990c142e8a580eb36266a3a9602a8bf", 419 | n: hex"c9548608087bed6be0a4623b9d849aa0b4b4b6114ad0a7d82578076ceefe26ce48d1448e16d69963510e1e5fc658f3cf8f32a489b62d93fec1cdea6e1dde3feba04bb6a034518d83fd6138ea999982ab95d6a03517688ab6f8411c4a96b3e79d4141b8f68338a9baa99f4e2c7845b573981061c5fd29d5fc21833ff1b030b2deb651e51a291168e2b45ab4202dcd97b891925c75338e0e648d9d9ad325c10884e1fcdccc1c547b4a9c36aef939e8802b62405d6e3d358ffa88f206b976b87f8b12b827b0ee7823f9d1955f47f8678f7843b4cd03777e46717060e82bf149b36d4cf3d0bc7e4d0effde51a72f4ced8e8e5b11bdb135825ff08873e2f776929abb", 420 | pass: false 421 | }); 422 | } 423 | 424 | function rs256_32() public pure returns (VectorTest memory) { 425 | return VectorTest({ 426 | // mod = 2048 427 | e: hex"0000000000000000000000000000000000000000000000000000000000b53999", 428 | Msg: hex"425994d102a63f542766b12d5207ace27de9207630c2fdeaf741450413f1654f7061c563d7829e6665500cd33cb4647a78a9c7c9659ff749ef1c6a6b59a99d8532ecab1885121e54517005de386947d07b923602261467888852c27be6ccd5fd71436d77741f6825d20dc5d5b0ecfdeb6fea96a9ddeaf5adac2a74bb2322b4bd", 429 | S: hex"c1f91aa430083ad84ca80ffae2d1ac2bee9b22bd0947175ffd03bd294f6a3cbb5ac63afdacf02f7a6a274fbc33f8aa25cb08174c9c4aad0cb9cbaf02e6f72a8deb6ac52ba88da773b4fd07b33144b9a28a23a1db150cb095cf03b208e80dda3263806b6b0e8eeeedd624d4eb8028e6b98ef2a3e55f38f1b0041425cf7557c41d35d4b0383448c800076eea2c22ca2f333496bdf53564f39d76822f55cb767cc1c2d516a22b4c6fc1525608ba61eb42c04c788c7050a48b7f3a431b2553dbb52cc065a9869c49cc021d7e448dc7012842d3351f98820bccd4fb7640b85fb431fbccbfd4e2544b6f3c7c270326c8cbbd216333ac82260c5edb47a301acd05c7c7f", 430 | n: hex"c9548608087bed6be0a4623b9d849aa0b4b4b6114ad0a7d82578076ceefe26ce48d1448e16d69963510e1e5fc658f3cf8f32a489b62d93fec1cdea6e1dde3feba04bb6a034518d83fd6138ea999982ab95d6a03517688ab6f8411c4a96b3e79d4141b8f68338a9baa99f4e2c7845b573981061c5fd29d5fc21833ff1b030b2deb651e51a291168e2b45ab4202dcd97b891925c75338e0e648d9d9ad325c10884e1fcdccc1c547b4a9c36aef939e8802b62405d6e3d358ffa88f206b976b87f8b12b827b0ee7823f9d1955f47f8678f7843b4cd03777e46717060e82bf149b36d4cf3d0bc7e4d0effde51a72f4ced8e8e5b11bdb135825ff08873e2f776929abb", 431 | pass: false 432 | }); 433 | } 434 | 435 | function rs256_33() public pure returns (VectorTest memory) { 436 | return VectorTest({ 437 | // mod = 2048 438 | e: hex"00000000000000000000000000000000000000000000000000000000003c7bf9", 439 | Msg: hex"bf082fa4b79f32849e8fae692696fc978ccb648c6e278d9bde4338d7b4632e3228b477e6a0d2cd14c68d51abdeed7c8c577457ec9fa2eff93cbf03c019d4014e1dfb311502d82f9265689e2d19f91b61c17a701c9ef50a69a55aae4cd57e67edc763c3f987ba3e46a2a6ffb680c3c25df46716e61228c832419e9f43916a4959", 440 | S: hex"621120a71ff2a182dd2997beb2480f54be516b79a4c202d1d6f59270f8e4d4dbd625ac52fe0e49c5fd69dc0d15fb19ec58c9312a8161a61cb878abcb11399937f28ff0803877c239ce0b7c4cbc1e23eca22746b071b2716475424c12944660b929b6240aebe847fcb94f63d212f3aa538515dc061e9810fdb0adeb374d0f69d24fd52c94e42668a48fc0a57819952a40efb732cfa08b3d2b371780aea97be34efb5239994d7ee7c6ab9134b76711e76813ad5f5c3a5c95399e907650534dbfafec900c21be1308ddff6eda525f35e4fb3d275de46250ea1e4b96b60bd125b85f6c52b5419a725cd69b10cefd0901abe7f9e15940594cf811e34c60f38768244c", 441 | n: hex"c9548608087bed6be0a4623b9d849aa0b4b4b6114ad0a7d82578076ceefe26ce48d1448e16d69963510e1e5fc658f3cf8f32a489b62d93fec1cdea6e1dde3feba04bb6a034518d83fd6138ea999982ab95d6a03517688ab6f8411c4a96b3e79d4141b8f68338a9baa99f4e2c7845b573981061c5fd29d5fc21833ff1b030b2deb651e51a291168e2b45ab4202dcd97b891925c75338e0e648d9d9ad325c10884e1fcdccc1c547b4a9c36aef939e8802b62405d6e3d358ffa88f206b976b87f8b12b827b0ee7823f9d1955f47f8678f7843b4cd03777e46717060e82bf149b36d4cf3d0bc7e4d0effde51a72f4ced8e8e5b11bdb135825ff08873e2f776929abb", 442 | pass: true 443 | }); 444 | } 445 | 446 | function rs256_34() public pure returns (VectorTest memory) { 447 | return VectorTest({ 448 | // mod = 2048 449 | e: hex"00000000000000000000000000000000000000000000000000000000003c7bf9", 450 | Msg: hex"bb40a410b0183b32df12f739506643bdd2fa7e6aed83974918ecda402cfb09dd1932af4fd7f3b1b5a0e8269c5da268c25e806b204dd34e28653f304cdf6545bfadbe297f6bca7493936b8e91f08bc56455059c4c8ec36626972414ee0ca04c82e1aebba953e5ab531e62d823f16b7f2a1f51b9f6979b07cb16602e309bf545ad", 451 | S: hex"3f6909f674d4c9c2c26b66d8ee3d7702c560b193a8fbfd0ddb3a9dc909a6eb7aa74d446b7993cdd5b7e272d826281e4cfa08000d2291c2ebe3ee6a77a4e03a79248385359d0885c61c8ade8cf4de7c8e51e879cc1e6089a91a56dc58d2b239e185e9afebf733e2f0fd061270eee0670122c44fd17af6860b6f59690a1b2a91e16522e6a75903bf4e6c97237825f0b01e4c236052b173a8d91f910b0c903590e16d7104609ff9c0194ffe0c09dac1969ea08b01497c8169c7357e8b1f1040604dc0f8b967bfd075284736aa22b0822d3cd13c48a8169413e0b6b26af56c577c829b38e3fb5c4ff78949634d14ff3a40d0d43584d832d6b51d4065e0900ef197a5", 452 | n: hex"c9548608087bed6be0a4623b9d849aa0b4b4b6114ad0a7d82578076ceefe26ce48d1448e16d69963510e1e5fc658f3cf8f32a489b62d93fec1cdea6e1dde3feba04bb6a034518d83fd6138ea999982ab95d6a03517688ab6f8411c4a96b3e79d4141b8f68338a9baa99f4e2c7845b573981061c5fd29d5fc21833ff1b030b2deb651e51a291168e2b45ab4202dcd97b891925c75338e0e648d9d9ad325c10884e1fcdccc1c547b4a9c36aef939e8802b62405d6e3d358ffa88f206b976b87f8b12b827b0ee7823f9d1955f47f8678f7843b4cd03777e46717060e82bf149b36d4cf3d0bc7e4d0effde51a72f4ced8e8e5b11bdb135825ff08873e2f776929abb", 453 | pass: false 454 | }); 455 | } 456 | 457 | function rs256_35() public pure returns (VectorTest memory) { 458 | return VectorTest({ 459 | // mod = 2048 460 | e: hex"00000000000000000000000000000000000000000000000000000000003c7bf9", 461 | Msg: hex"56db10c78e9fab7c1c356bf8b38e4adcc464ebd1a3cedabfe812144016baca547aea625656f0bf2e3f1dc2c9c4d310c650e01672520a4bf79aebb5d00600af805ffce9847e62b086b35270d367a3770fff33fb28047b5f888167b28fad647940cabaae3a4d1c08ea3f7d7d00e326061f9906a2d902499dda652c1263520faffb", 462 | S: hex"8432cca3357f5ee765bd37dbe2b2d107dfd840f8f720cf4a80144740f96e47529c553fd503a25bfac61ad76a24386af72d81522e6f05b66299f6aea3b98b23838e7dde04db8f8b0f32ae393f6bc0bd7070e566ba1fea53ca871d680f70cc9585aeece672d7c64c228c49bf1ce877dae73f9d8756433f5edc4331415d51957d23e490d4f25317d09a3ad06ec9229dd706cf593915cb156d7f7a32d68e52ca27aea7087d4fd1e194b6029246694742dc70c5136a26cf41b3abf9cf9cb65cd2e37ade6b9fe5ef6160279871230f35758f02c3b37789c1d74df0dc0f97f28bd789755982dd249c0960e64739b3c74b9c55ab810650529e7243bdafda7edef76fc748", 463 | n: hex"c9548608087bed6be0a4623b9d849aa0b4b4b6114ad0a7d82578076ceefe26ce48d1448e16d69963510e1e5fc658f3cf8f32a489b62d93fec1cdea6e1dde3feba04bb6a034518d83fd6138ea999982ab95d6a03517688ab6f8411c4a96b3e79d4141b8f68338a9baa99f4e2c7845b573981061c5fd29d5fc21833ff1b030b2deb651e51a291168e2b45ab4202dcd97b891925c75338e0e648d9d9ad325c10884e1fcdccc1c547b4a9c36aef939e8802b62405d6e3d358ffa88f206b976b87f8b12b827b0ee7823f9d1955f47f8678f7843b4cd03777e46717060e82bf149b36d4cf3d0bc7e4d0effde51a72f4ced8e8e5b11bdb135825ff08873e2f776929abb", 464 | pass: false 465 | }); 466 | } 467 | 468 | function rs256_36() public pure returns (VectorTest memory) { 469 | return VectorTest({ 470 | // mod = 3072 471 | e: hex"0000000000000000000000000000000000000000000000000000000000ac6db1", 472 | Msg: hex"921961e184a5d9657697e3e65ceb1ed10204ec56e739df0e4f906ee194c9ed27bd9fbc0d514abe3a6e480cb3155debfcc8d9fc815719b334f7500a769488773b68e31b69cd273c824f79f58306692c0c232fc5c0c83415ef1dd59a73a063e9d7bc6ee7bf9e433c8344b3051ed616c9473a90afdde393ee88e9a5849e5f642b43", 473 | S: hex"55362a6854a7846c4d105dc8a358fd4c02931f117631968457f422939d266682fd705e2091bfd5d1bfb52b4bfad684914489ecdad9038b75c65916a9e967630b16c76656b58404ec11ac46d8684b3e72d4392fb6e7e6c929e43ad4fb6ce6198f241b39e8bcbbc058792dde31b195b91bb14236dcb82c28a5c24d633dd847d1548dd403b3a70149371f46432db1767a00c462758c2298fe9f1f04c2ff4b96858d084ffe5a624cb85c1f9be2a60fed40133b7c571c6c467f46a0f1e48ee6e2e6d65424bf8196b0d927e0fd4141264aa5df4129d52d2fb57b8dac9386a84ecd34ecb1feac3a2b99d055eda977ddf8027f1178348a30e4cb4ecef2291d7f520794018b39f5251fd46d97282ac21f6bce6539d19aa1c21c3c220a2ddb6feed262eceebd753eaf5e0eb98cb3eb7d324a3dac0a415a18b7f36170676e8b9d3e421a6f77046bee6d9591c93f7ef0242f464f15b63132a0aee80949709429b1e76d40d60f79b2a6ab362f12e2cdd0bc66868c80278043e179a36f2815e7916378b0fbdb8e", 474 | n: hex"9bbb099e1ec285594e73f9d11cbe81e7f1fa06fd34f3ec0b799394aed30fc2ed9de7b2a6866fde69846fb55a6ab98e552f9d20f05aa0d55c967817e4e04bdf9bf52fabcfcfa41265a7561b033ca3d56fb8e8a2e4de63e960cfb5a689129b188e5641f20dbf8908dab8e30e82f1d0e288e23869c7cac2b0318602610a776a19c1f93968c652b64f51406e7a4b2508d25b632606834a9638074e2633eb323324b8b30fdbd8e8fdad8602b11f25f3906439055afe947f9b9bcffb45dad88a1df5304c879bb4a6eddb4d3d1846bf907d2ca269845c790b2f0af8154aad9c4acb75e18a5d0e4f9f88137032b9964fe171dfa0d0f286090790f52157179a6734b5f9a64e3d2ed529722c3d3836d4501496f927a0f8e389ca35332b836d99e995f4a3e86f581bf9abdc7a10e06a6b31296ae3b43e6ddc9a0d9a7d0d9c4053af0875e851192d1de7b08d1beb7b857e227f8803a5620726a31920bcab922d3370a78033b315024a0fc1f6c276be565e58de77f294c8089ff4c43fb334d26006ab5757c65b", 475 | pass: false 476 | }); 477 | } 478 | 479 | function rs256_37() public pure returns (VectorTest memory) { 480 | return VectorTest({ 481 | // mod = 3072 482 | e: hex"00000000000000000000000000000000000000000000000000000000001ed02d", 483 | Msg: hex"8568ff68d40c9f240b5ff56d8919704a4819fb48b2f0741db6a3608a1aaddd861344d79813dd7f85e2f2f92bf00355adeadbc1d08b14fda5b5dd0f69c0fb37a9120e25a9ef166a0793352d9c7eb71fa3104fb11d55a38474220b205e6196ea04a94f506412be47f347b1f787dc3cb475e2fe31f6b9a6f0d026b6fd32a587dcdf", 484 | S: hex"191cae43b354617b1ebedb701c124e76339935835a3633b4f806fb835d0dc4b7e4abf00f8c575fad8467ca35bc0d37b58a90db835f4ecb9f1dbfdfaffffb6ef1e0b894dd65fbf8e36478adb673b116188d864f185be5fcfc17bf1e6cfccd499d632b3cb1722c75776cd4d8ec68d2512c1ca598b970f03f6fff5facb107c0e74d6aefffaac20f8e3aa6e825a1de1690a84c8ad1e766642f2a89d3032b58b8e6ec50ef6a8e69b6afd30a2755d42b55f9e21f69c8d9d993549d198ec6c17d12f09ab4be0209030dcb274afefa77fe461e6469ad51f56dc58ad2f06b620af36ba712fa798d9812d2b6ce8ff4554b58bd2a6a8abdd8d00920bc3ad3b61586e544eb073419a85bbc1dfaf775068dc004a7f0ae789d5023d013f3e6096ead893158ac4ba050b87f8186705179f531be573d9557744a70ee42a4b3eb89c824eb8ae1172212c177557267ef04157f9fcf003c2d1f6039671d3af71339c30fbf772f14b3d59e81739ef82d61ab61475e1b4c835fa50350da15610f45531ae85fae5ff9a31a", 485 | n: hex"9bbb099e1ec285594e73f9d11cbe81e7f1fa06fd34f3ec0b799394aed30fc2ed9de7b2a6866fde69846fb55a6ab98e552f9d20f05aa0d55c967817e4e04bdf9bf52fabcfcfa41265a7561b033ca3d56fb8e8a2e4de63e960cfb5a689129b188e5641f20dbf8908dab8e30e82f1d0e288e23869c7cac2b0318602610a776a19c1f93968c652b64f51406e7a4b2508d25b632606834a9638074e2633eb323324b8b30fdbd8e8fdad8602b11f25f3906439055afe947f9b9bcffb45dad88a1df5304c879bb4a6eddb4d3d1846bf907d2ca269845c790b2f0af8154aad9c4acb75e18a5d0e4f9f88137032b9964fe171dfa0d0f286090790f52157179a6734b5f9a64e3d2ed529722c3d3836d4501496f927a0f8e389ca35332b836d99e995f4a3e86f581bf9abdc7a10e06a6b31296ae3b43e6ddc9a0d9a7d0d9c4053af0875e851192d1de7b08d1beb7b857e227f8803a5620726a31920bcab922d3370a78033b315024a0fc1f6c276be565e58de77f294c8089ff4c43fb334d26006ab5757c65b", 486 | pass: false 487 | }); 488 | } 489 | 490 | function rs256_38() public pure returns (VectorTest memory) { 491 | return VectorTest({ 492 | // mod = 3072 493 | e: hex"0000000000000000000000000000000000000000000000000000000000ac6db1", 494 | Msg: hex"88902b37b0db4246c41b50f180eb1350b1b6dac0477a3dd1accb0c5f541a85fe9637ca9cba15926153ce1edacfe66f574cd4b691adbe0c90ed8563ccb401bc93288e9baa06c7b837f191f8de0a5c9b2bc0a5b730eabfe56f13d43afa142779d8e99b86abbd791e90476ec64759d30194b631c6e425053134c3c0792f9d122296", 495 | S: hex"9d64c3b9a4ba78889747aef7c8565eb075e5bd92a55f9d34d3df6a2d740cd863ff98a04be4866e9f906cc6d99270d208a3dc2e53201cac9f4f758eecbe8a44db0243a3e40400cac37856079f2fe02d54d9748754331d9935595c35b22cc6c45686ea964642ec4ca7e0a88e4a4c0a6166733e361c46a592469cad7009ca3170cf3fbe485b1c8726e23a6e35f9691d9bf4029d82756c64a4d31ad0b8ef57a0ba2d55419d7cfabbab1a23c8baa4bf043a444b127920250551467d7d528425dc7c903c2c824e6b9b65f543ad9d7055300f19500356100411271e15b939d496b4bd4cc3ba4b6aa2ce65f4825275404cb19512ae27cc986b0af6fddff35980c2cc0e96829ecbd9ee19944838e4c83b1eadb6f78669890f556781c4e97d8ede9664080e47b3adaf2f5e04bd42d46012aeace3078f9068d870fee02b088f9674fdc0ca0064e9f0f63205836d7a8771264c553c945eb7c87df2a13d8efd3cdc8409843e7a246089970abd43526f3cc9cf993d419a6beaaaf6830208686a1fde4733f078ac", 496 | n: hex"9bbb099e1ec285594e73f9d11cbe81e7f1fa06fd34f3ec0b799394aed30fc2ed9de7b2a6866fde69846fb55a6ab98e552f9d20f05aa0d55c967817e4e04bdf9bf52fabcfcfa41265a7561b033ca3d56fb8e8a2e4de63e960cfb5a689129b188e5641f20dbf8908dab8e30e82f1d0e288e23869c7cac2b0318602610a776a19c1f93968c652b64f51406e7a4b2508d25b632606834a9638074e2633eb323324b8b30fdbd8e8fdad8602b11f25f3906439055afe947f9b9bcffb45dad88a1df5304c879bb4a6eddb4d3d1846bf907d2ca269845c790b2f0af8154aad9c4acb75e18a5d0e4f9f88137032b9964fe171dfa0d0f286090790f52157179a6734b5f9a64e3d2ed529722c3d3836d4501496f927a0f8e389ca35332b836d99e995f4a3e86f581bf9abdc7a10e06a6b31296ae3b43e6ddc9a0d9a7d0d9c4053af0875e851192d1de7b08d1beb7b857e227f8803a5620726a31920bcab922d3370a78033b315024a0fc1f6c276be565e58de77f294c8089ff4c43fb334d26006ab5757c65b", 497 | pass: false 498 | }); 499 | } 500 | 501 | function rs256_39() public pure returns (VectorTest memory) { 502 | return VectorTest({ 503 | // mod = 3072 504 | e: hex"0000000000000000000000000000000000000000000000000000000000ac6db1", 505 | Msg: hex"973606b2c7e5658a9d8f264b8f5a266d0992cfbd6e9d3ff95c31a69a32c4f0f1cf44a5759d090d5ccf089768e6497b047a9b9f8f3786b8f82681b18b2d65500ada2217005cb06852d249ed17c9d637a9ffa7a5fc6d66882f854e8461b9983ac63c3623fa0cc4bf9530bcf0ff3ee9a086211eaaad1927f8c70300e9c5db45f54d", 506 | S: hex"355644f5a26a4ffc638c44ab4d0b7359f37845235bfb994d28e63b114c0e0f97d2e29f448da8b12eb804792ccc686dd807f44211d6af410bdca1196df84016b3cdae180bbb59133aeac5928560ad2cf6be61392dc9e28d7ada11658cf4a873bd2626ca839e697c79a5c4bb3ed4c9b8f48f83f2800e1907376f2e8874c23f1dff8bbf3b3f98bed7895d486079a92557a553a71e18cfafdc155775f39a77455b432b0c2c4f09990d130060143e7310b9d9e1ae6f2b1b83b90b36c6581473f60c3c61a10e286557f84e5d04cc36e12cbce835234d2d773221313ad7287c9957d94a1cda8c1fccd3eec45dd84a5d075d6bf823123fcdc7d549286142ab514db6d998e377429494f07041387de3ab31b02ac1606e590572bd9003e5a62b90b95b00c0eca73c744ccf4eae44374e26ba6033dd2baede95e19cecc840a045bf995a3250ce7b08e0c3267de822616f93a4dd9e629eb38b479bd31071b48976cf73ce52c3734abd93249300dd5c40635842dd2a290276190737a123008a4f0be557ca6628", 507 | n: hex"9bbb099e1ec285594e73f9d11cbe81e7f1fa06fd34f3ec0b799394aed30fc2ed9de7b2a6866fde69846fb55a6ab98e552f9d20f05aa0d55c967817e4e04bdf9bf52fabcfcfa41265a7561b033ca3d56fb8e8a2e4de63e960cfb5a689129b188e5641f20dbf8908dab8e30e82f1d0e288e23869c7cac2b0318602610a776a19c1f93968c652b64f51406e7a4b2508d25b632606834a9638074e2633eb323324b8b30fdbd8e8fdad8602b11f25f3906439055afe947f9b9bcffb45dad88a1df5304c879bb4a6eddb4d3d1846bf907d2ca269845c790b2f0af8154aad9c4acb75e18a5d0e4f9f88137032b9964fe171dfa0d0f286090790f52157179a6734b5f9a64e3d2ed529722c3d3836d4501496f927a0f8e389ca35332b836d99e995f4a3e86f581bf9abdc7a10e06a6b31296ae3b43e6ddc9a0d9a7d0d9c4053af0875e851192d1de7b08d1beb7b857e227f8803a5620726a31920bcab922d3370a78033b315024a0fc1f6c276be565e58de77f294c8089ff4c43fb334d26006ab5757c65b", 508 | pass: false 509 | }); 510 | } 511 | 512 | function rs256_40() public pure returns (VectorTest memory) { 513 | return VectorTest({ 514 | // mod = 3072 515 | e: hex"0000000000000000000000000000000000000000000000000000000000ac6db1", 516 | Msg: hex"170dcd5458adfbdccc757e0b5abc19278112f24b418b995d395b46410da3624c0a8b49fc0d914fe6a02101ef6765adbfbb5e24739434be92acca9f43e19639bddbb012fef028c7c0449d52a9350b88c2f6e5e52a79648c0c931e8ace5bda5b8bd3a3afc4ca1b6e520012f99f8c57b3167bcec0d8bac30cb1367e8f4a4118d0a0", 517 | S: hex"6a4db2e6c13ee8ec6174bf57ae5bb7555e66dc2e3b618f259d913b5b8b6c16b9760290c9c576b563316f510ad2461cd5086b6d9670551ec74b8a9d15ebd43ccdfdcd74cad660a3fe3f36992c86559cd8e9e4d3568924b1f7e55bc5d8df4cf53f240fb3b945a08d24f205d5a7081410ea3e8136ca282fc99e6be0b1fa2faa742c9d682d08a77b791bb0421241e6a82f84605dda359e4f8475cef346c9f6a54a085492fc4bbb30b1047c66f5fc529ecb6aa9ece561e5a3a62f9a19eca2badbfa32a2aa205713b16081519c2cde2f8e8261726fad49145dce0d9e24f6e085e44bd86f670a114ba98d54389f0ed683d062735cd495e6a8a6eef9fd70355b92b4cf6cf0c24e898b6d3f7fe51dcd1548a1adc67ba585e2d18809ea658d6ec4bb5e33e8501d11a266f5e0928ecb58547e72c27db8b07aae31eefef865bcf6a08485675d3037f432c157e5ee428d292bfc24c654d8fca7a60107dc18461251906521e1e9965fc80c7b5f582ac3dc3798a0a2937e76d7e7fd7122d3fd9083feeb9a44ad7c", 518 | n: hex"9bbb099e1ec285594e73f9d11cbe81e7f1fa06fd34f3ec0b799394aed30fc2ed9de7b2a6866fde69846fb55a6ab98e552f9d20f05aa0d55c967817e4e04bdf9bf52fabcfcfa41265a7561b033ca3d56fb8e8a2e4de63e960cfb5a689129b188e5641f20dbf8908dab8e30e82f1d0e288e23869c7cac2b0318602610a776a19c1f93968c652b64f51406e7a4b2508d25b632606834a9638074e2633eb323324b8b30fdbd8e8fdad8602b11f25f3906439055afe947f9b9bcffb45dad88a1df5304c879bb4a6eddb4d3d1846bf907d2ca269845c790b2f0af8154aad9c4acb75e18a5d0e4f9f88137032b9964fe171dfa0d0f286090790f52157179a6734b5f9a64e3d2ed529722c3d3836d4501496f927a0f8e389ca35332b836d99e995f4a3e86f581bf9abdc7a10e06a6b31296ae3b43e6ddc9a0d9a7d0d9c4053af0875e851192d1de7b08d1beb7b857e227f8803a5620726a31920bcab922d3370a78033b315024a0fc1f6c276be565e58de77f294c8089ff4c43fb334d26006ab5757c65b", 519 | pass: true 520 | }); 521 | } 522 | 523 | function rs256_41() public pure returns (VectorTest memory) { 524 | return VectorTest({ 525 | // mod = 3072 526 | e: hex"0000000000000000000000000000000000000000000000000000000000ac6db1", 527 | Msg: hex"b2f72cef31be4b7439191d9b342065e62513792826f950481486dd4289429b6e0ae86a05820c99e1ef0144845cfae05c0f6f144603c3ca50992387c38ab1f76120e2cdeba624cae61dc51a9f3010e76d6ab92936a77bbb34c8ffb4f9ab00f4b15badfda8834e050c292b49f398a9a39f9eb75f01f8684b7d0be10dedd576b9e8", 528 | S: hex"8ca52a9040ac49ec2415054ee86379f297832a2a33892c9dec09de778982fb1bbff68b3787ef43ad15f9aa0c518847ba1b3075613bf187a6fc8a7fd7f0b43a6a24086c1d6c5fcb1db18c93bc508e609396ba019fa43dd19f95194c47003d6092303be35477a3137aa2adaa51b22618db29fce98b5bf791ac70be7e238c558f0fb42a40bcfe0e9c07e178afe7a2db74fcb03693ed46719d54d69d5de43ad6a93b0a5b7da6e05ebf7c4b02da42c7ac1f8997da7c4de00c7747361bbef534461bebc23477e93a48558b3ade7d09dce6fa6a378e68e7204ab35283c58148df0cf9444e5f91ad31cd0474815895555cfd7f9cef9164b91db4f98816d194f85bad581f410a655273e5d14491793141f9d928cb30a322c513935dfd830dfc75030b8b2ba1f46b763ec303bef32b4dbeb01781bc1f2bf2ceba27750082661558cf3d42f03d50409b7db521299009753c25926e3e6502bb1763ab68dd5c19dc0265b16a2d438c3ed23b74e60ecff88708e5601a478986dd1b607a2db0fe049664d136517f", 529 | n: hex"9bbb099e1ec285594e73f9d11cbe81e7f1fa06fd34f3ec0b799394aed30fc2ed9de7b2a6866fde69846fb55a6ab98e552f9d20f05aa0d55c967817e4e04bdf9bf52fabcfcfa41265a7561b033ca3d56fb8e8a2e4de63e960cfb5a689129b188e5641f20dbf8908dab8e30e82f1d0e288e23869c7cac2b0318602610a776a19c1f93968c652b64f51406e7a4b2508d25b632606834a9638074e2633eb323324b8b30fdbd8e8fdad8602b11f25f3906439055afe947f9b9bcffb45dad88a1df5304c879bb4a6eddb4d3d1846bf907d2ca269845c790b2f0af8154aad9c4acb75e18a5d0e4f9f88137032b9964fe171dfa0d0f286090790f52157179a6734b5f9a64e3d2ed529722c3d3836d4501496f927a0f8e389ca35332b836d99e995f4a3e86f581bf9abdc7a10e06a6b31296ae3b43e6ddc9a0d9a7d0d9c4053af0875e851192d1de7b08d1beb7b857e227f8803a5620726a31920bcab922d3370a78033b315024a0fc1f6c276be565e58de77f294c8089ff4c43fb334d26006ab5757c65b", 530 | pass: false 531 | }); 532 | } 533 | 534 | function rs256_42() public pure returns (VectorTest memory) { 535 | return VectorTest({ 536 | // mod = 3072 537 | e: hex"000000000000000000000000000000000000000000000000000000000074ef0b", 538 | Msg: hex"1d15d87fe7045f2a6650659acf23faeedc28b1bbd64a54f8f3bed617e3438975a6a891f4a08f99e6ef72c52efce3e7a15018f5b3aaa6bb4f4e8dcd069f75c06cf03799bf989f86ca4471cc0992a9010edb077b234fcb083148bedfe1d871d700a4c9d728f6bb8e9d0d556475b8feb0fc23fe2b56f041a5668957f6efb5c038f9", 539 | S: hex"1f1563cbb8650b8a7ff7f71aba6c06ea20643e4620f29e8d1aeb4a1be6f665ff9779ca9303437aad3264aeb0f2b250af32054585edeb44b0a913175e6006d31b43eeb9c97bbd679e5434e8f645b6e096320a5906a64264abdb9cdeefabd5ff61ee3f851484ec6bb0c7957d6db38942be1b3412aeaa7b0700028fac765cc4f03bd7157122420f1acd4828ea01cd32e0cacc55f43fd9bf58ac71961031f72024832191598ae69dc96b458a237cae0e3a81784a98a1b012530936529efe73d073eaf974f8e1680706581e0accb3a189d80dc71b051474e50cd9d8eaaf9e7be4108be1e7d8e6a89709c50c2d85034f0e158b208a205fc4b30922d0e19ca58e15e46384ec15650ff56b6eaef908b44c4f9d71250fd050ce96acc204d68c09493596ab2bf3052792226d60b684e516e92fa0b1585dffbc309fac46457c07a901e901dd659e4fbe4ec0b327f88b8b8bc689c3f678aac3519ec1f7392936a726b7fe4be534b27bac5a35a55e18fdeb08857850940476c14fa12102014872b81bc5dcf292", 540 | n: hex"8aa12846ecb9d8b954d2ca0fd3f60826c76d2a98ae615f38f5a662cb6158f17f29050dc6a1bc2f60f3a9db2da6c9b27b8cabe25cfc25d005ad60ce298f6da3415ee0a0a00cd2fbaf1eb67d4fffbe03b2570ab56c10dfee9f4da86c05920993c92c4ac33a246f5102113a258e17736897f981b8b29ae695802fa1bcf9b41a5f1053bd77400a153d1d6efdf4e4c14703a34380da2921deac003b4a7246568527d9e37d0da956766f155d3b9a38ddb747f2706a72268542f594c90e0d2f0ef755f4aa67aa6a25004548c73861c0333597337a944c42f762ca2b54821425477e4e0e2a9b1842ed3f16d68ed31318dc396071b90e1e514cff975d198a581723cc98cb784d18cf197a14dd7b9d5036bd7724b9301f514236bf7c8b290dc5bd93ebb6bb2d18d3fc4f4d480b8d1b62ffa3de1224607976a27d40f912e50b46b915f19556781b2ac88e16c14982a0718bdb4cec77127165bd7151f0181cf56efa1ea345fee075a7b36a02e74a6f3eb035b608cdd2ceda4d738876fbd7ffb009019581685f", 541 | pass: false 542 | }); 543 | } 544 | 545 | function rs256_43() public pure returns (VectorTest memory) { 546 | return VectorTest({ 547 | // mod = 3072 548 | e: hex"000000000000000000000000000000000000000000000000000000000074ef0b", 549 | Msg: hex"50930141564ac38dfef23056b5cfd10efcf3bb8823fa6f5254f8ff45d4b0725a86076ac0b1b8042b0248006ed53d224cb08bd78b104f1c4b69bf9c96686118387b7c0cd193cd9028297a7cc27f4ccfb4281852b5ca7e787723d689384a68ff9437db319d86f12e2d7871ec7b3b64a2ed6b83722dd8f14b7f8a260e52022bef14", 550 | S: hex"65862ec1d10c408e4278ee1421e773f49ad426e368a48136d6f77d5a6de96ef4643ef3b8f7b451f9ef9ab4d8590752dd7adf1d78ce23411f3586564b67172ef718e8824d357b37f105dd0e38c0578df14220dbd83588c56c4cc658b5d4b07337ba3e40b40aa6d877aeb3cb95256d25e55b702bdb23026bcf05387d58ce020d359348536f9f108d111bf69c3823aca8655bd73a64789d258bc90b5006ad01c0640118e17aacedbc0545c543df8e05f254fb7d8846703723fadbd4179d4a1a5a7c371e980309d33b2d79061f741aae529d4e84c686a4077d3ffc66a8b18fab2f72ed06a3372efee4507425610d317c74d5566f4829b079012e2e066bacde53e43dd702fae3861eaf2721e3fc5818de552b5a9d084b5f03a451527fce2d3a608028163befb91ccecdcaaaf5cc357bfb698f0860350136b71b4b087b50e2d97a9a6765a6077f1b26e168b5d60b7a91330c3e1769adc479ffd866351eea4cae92609c0431511b91b6683d0d8d4d2a72be8622c7dd969d5977127ca5a6c3d0ef7ff77a", 551 | n: hex"8aa12846ecb9d8b954d2ca0fd3f60826c76d2a98ae615f38f5a662cb6158f17f29050dc6a1bc2f60f3a9db2da6c9b27b8cabe25cfc25d005ad60ce298f6da3415ee0a0a00cd2fbaf1eb67d4fffbe03b2570ab56c10dfee9f4da86c05920993c92c4ac33a246f5102113a258e17736897f981b8b29ae695802fa1bcf9b41a5f1053bd77400a153d1d6efdf4e4c14703a34380da2921deac003b4a7246568527d9e37d0da956766f155d3b9a38ddb747f2706a72268542f594c90e0d2f0ef755f4aa67aa6a25004548c73861c0333597337a944c42f762ca2b54821425477e4e0e2a9b1842ed3f16d68ed31318dc396071b90e1e514cff975d198a581723cc98cb784d18cf197a14dd7b9d5036bd7724b9301f514236bf7c8b290dc5bd93ebb6bb2d18d3fc4f4d480b8d1b62ffa3de1224607976a27d40f912e50b46b915f19556781b2ac88e16c14982a0718bdb4cec77127165bd7151f0181cf56efa1ea345fee075a7b36a02e74a6f3eb035b608cdd2ceda4d738876fbd7ffb009019581685f", 552 | pass: true 553 | }); 554 | } 555 | 556 | function rs256_44() public pure returns (VectorTest memory) { 557 | return VectorTest({ 558 | // mod = 3072 559 | e: hex"0000000000000000000000000000000000000000000000000000000000f1d0f1", 560 | Msg: hex"b1fe0c7145b1e35a8062ed24ab82e862a0d695a53a1cc7430af1b9574bf2a40918229110dd8c6c750c295b9911034e79879bd631ac883abf1262c80a98de6923993a78ca63dcd434eb36340bbfecbbb73b39cddc008f2023a27d163ea1d64a269b1068a7bfea431f855121839c8559a2247821ae1e77a1f8210b4cfb4e226f9c", 561 | S: hex"43333cc1b7da9710ad7f58a595078672be48dbedafab37dda0e1328e2f2b8b91dc88d2c33e0d8e06fdfa3dbc43e24d827f3ed31a994bf662225e1f0827a205cd638c16f38d664752d73db2c84f26d12a955e237f7a4d171a14d720b43dda3fa728d69ee0ed95869fc231d8f6fffe93b1acb81692ab9ff0f926073280a3bdd4472cba3b84541f1f9cd4508bf780e96c80b4a705c9893639f127969343a1ff9aab2b98d154c7f929fc55a5fe9485d1d9ca411131e5c0ff3fbaef353d49a9f13583cf1ebeea6209c123df32abcb311edc94c04e5eb3e1389e5011499e7d0d5bf66bb69ba7a06586d414b1d7cedd0106259406235fee1cf0b2bb2ce679f247741baecccff27c6e2a3a514d7aaebed281cb6381e7fa8d8a092ef1051b5418fd9886747c9194feab56eb975fe193076b474c2056d20a818a5b4ea56648ab5e7d4ddfdca1238d95da14dbb51e0a72b6df8d4e4d708a18e1828619c999525772400a9ca91c20229b1a979d30fa7bf7e33129abcc8d91f61ff0b8f2042345c27a928b7865", 562 | n: hex"8aa12846ecb9d8b954d2ca0fd3f60826c76d2a98ae615f38f5a662cb6158f17f29050dc6a1bc2f60f3a9db2da6c9b27b8cabe25cfc25d005ad60ce298f6da3415ee0a0a00cd2fbaf1eb67d4fffbe03b2570ab56c10dfee9f4da86c05920993c92c4ac33a246f5102113a258e17736897f981b8b29ae695802fa1bcf9b41a5f1053bd77400a153d1d6efdf4e4c14703a34380da2921deac003b4a7246568527d9e37d0da956766f155d3b9a38ddb747f2706a72268542f594c90e0d2f0ef755f4aa67aa6a25004548c73861c0333597337a944c42f762ca2b54821425477e4e0e2a9b1842ed3f16d68ed31318dc396071b90e1e514cff975d198a581723cc98cb784d18cf197a14dd7b9d5036bd7724b9301f514236bf7c8b290dc5bd93ebb6bb2d18d3fc4f4d480b8d1b62ffa3de1224607976a27d40f912e50b46b915f19556781b2ac88e16c14982a0718bdb4cec77127165bd7151f0181cf56efa1ea345fee075a7b36a02e74a6f3eb035b608cdd2ceda4d738876fbd7ffb009019581685f", 563 | pass: false 564 | }); 565 | } 566 | 567 | function rs256_45() public pure returns (VectorTest memory) { 568 | return VectorTest({ 569 | // mod = 3072 570 | e: hex"000000000000000000000000000000000000000000000000000000000074ef0b", 571 | Msg: hex"89574c2f705f32cafde26824389468218712eae98268588f02d683f17ad494df8b53457fd24651ef0561282d3e20e834960c8968f63a57342a14a6f2375bc10bef6d235fc2c4eae7d7c088985ca6bc8b1ae8c15c4ca7c5d0b1769cbae061b61fdc2e4e98e8e2e5f89c87ef2f392dcc6e3a2ff98c2bb788a9be84cd111ceb5b62", 572 | S: hex"45c1da7fa6d790ac28f54716f23b2d594a637c5f6785e37fec8350e5d5334edceb66c263197702e5e5d543a2a9a6893cec3608512503ca26831d8847c2563c326bbdf3aa5edf7a583d8252e2cf35bb16cf30a0736ccdddd41af4b54729c843b9c675ab33d3ba1e1f7f63d2aa2ec94da2a9fe4eab9036b0561d5ddeb6d3dfecd1e243381de0eed5d41b8fd6023826d3bf4ffece8570e800c1689a57c2987a0f5629dac772c5f40b475ac61524c0308dd7de872d2f2d68c6017992ee060c607826db6f263f3276f330b7d267defe6eb91f9e9ca63e552531869f0b36784813991da6aa930736858146a42eac2b17c3ed2fac55ae3e0c6370b5302e693f84615e4174576150c6454a5c5f7a4f72d03630e899363db71eeb8e4e919ab6d15e87306c626dbcc18bfe62bfb1878a5105cef0f5b4f06cc4b6d7fc12f29e687ea9d0e16b7ca009356a2cda1f7b48b22e43883582cc770803f6c75892174168ac6954c76a475f0bdda4dce703e5d7737f7019a43ac72447b524a6132dde51f925fcbb9485", 573 | n: hex"8aa12846ecb9d8b954d2ca0fd3f60826c76d2a98ae615f38f5a662cb6158f17f29050dc6a1bc2f60f3a9db2da6c9b27b8cabe25cfc25d005ad60ce298f6da3415ee0a0a00cd2fbaf1eb67d4fffbe03b2570ab56c10dfee9f4da86c05920993c92c4ac33a246f5102113a258e17736897f981b8b29ae695802fa1bcf9b41a5f1053bd77400a153d1d6efdf4e4c14703a34380da2921deac003b4a7246568527d9e37d0da956766f155d3b9a38ddb747f2706a72268542f594c90e0d2f0ef755f4aa67aa6a25004548c73861c0333597337a944c42f762ca2b54821425477e4e0e2a9b1842ed3f16d68ed31318dc396071b90e1e514cff975d198a581723cc98cb784d18cf197a14dd7b9d5036bd7724b9301f514236bf7c8b290dc5bd93ebb6bb2d18d3fc4f4d480b8d1b62ffa3de1224607976a27d40f912e50b46b915f19556781b2ac88e16c14982a0718bdb4cec77127165bd7151f0181cf56efa1ea345fee075a7b36a02e74a6f3eb035b608cdd2ceda4d738876fbd7ffb009019581685f", 574 | pass: false 575 | }); 576 | } 577 | 578 | function rs256_46() public pure returns (VectorTest memory) { 579 | return VectorTest({ 580 | // mod = 3072 581 | e: hex"000000000000000000000000000000000000000000000000000000000074ef0b", 582 | Msg: hex"a8d283d3e616fcdabe06076c3368e022884108cf569bf363db860010955dafab0f4a0f54fc0c755982f87358d83e08a4136e15ea3d3b1015a87efc6e817e9908a86ed85bbf37912f827878bc56cb4e0f244b54af67530581848804e95b1954321b45c7305a1eb923658dfddfd497182a62dead66fc6b397018aa01c748b648f1", 583 | S: hex"5961403c27cac4677ccde42cb807477e004b7cc795f8e14049e78326769803f852175ad36d6cc08232c168a34e33eeadb7aaee642b6a75928ad303fb4140eebbfc2fdff5a990f8bea12311529cc4575594a56f6d362a6cf8623cf6580eae79525e502c7be1ae71699e2b7916cde5ab5149840ce8db96e839d0d507bcc3d6184ec68a99c30a1b562959d7873027aa491a9dee9094249e7e3e1913f263e05b6d892a8787686baa7ecb9a88e3bdb52a7e45fdf49bb73588173c722c5503bb5864917410da43ff55e85e4df1af4bdd3b913ee5ef8b9f0293ef36641a775dd4f70df95f157569899df3b7f2cf54a5e34575ff9f6ef5b93d00699586a247c2b42ddccffa5c88294b7bfb686970e0fb9a1e7a823a8b16ffa9b5e45726dd3bb015c88307062aab622fcdac7ed30b7c773793d3f7ce326d30535f4bc289918aace1feaa02c620be6cdcde24d694e7936c58c83f9e4bc3dcafbc542afa4daa7be014099173708452817dc1493d3306053e97fd1c258b062a982a5333925472eb004d82d8e4", 584 | n: hex"8aa12846ecb9d8b954d2ca0fd3f60826c76d2a98ae615f38f5a662cb6158f17f29050dc6a1bc2f60f3a9db2da6c9b27b8cabe25cfc25d005ad60ce298f6da3415ee0a0a00cd2fbaf1eb67d4fffbe03b2570ab56c10dfee9f4da86c05920993c92c4ac33a246f5102113a258e17736897f981b8b29ae695802fa1bcf9b41a5f1053bd77400a153d1d6efdf4e4c14703a34380da2921deac003b4a7246568527d9e37d0da956766f155d3b9a38ddb747f2706a72268542f594c90e0d2f0ef755f4aa67aa6a25004548c73861c0333597337a944c42f762ca2b54821425477e4e0e2a9b1842ed3f16d68ed31318dc396071b90e1e514cff975d198a581723cc98cb784d18cf197a14dd7b9d5036bd7724b9301f514236bf7c8b290dc5bd93ebb6bb2d18d3fc4f4d480b8d1b62ffa3de1224607976a27d40f912e50b46b915f19556781b2ac88e16c14982a0718bdb4cec77127165bd7151f0181cf56efa1ea345fee075a7b36a02e74a6f3eb035b608cdd2ceda4d738876fbd7ffb009019581685f", 585 | pass: false 586 | }); 587 | } 588 | 589 | function rs256_47() public pure returns (VectorTest memory) { 590 | return VectorTest({ 591 | // mod = 3072 592 | e: hex"000000000000000000000000000000000000000000000000000000000074ef0b", 593 | Msg: hex"b2a9f33308f84f8718e860ee4e439ba1541a985f355c5dabc3a8df343660c69515ff713e5aac3ab2d10ffbf4c163d13bcecc1fed1eebd6cbbbb0f46938704be2983884c96b6063633a634d1325ee0715cb36c06f6a8f5225473bc5ad517f14a201fc34bd843d53001c8d5e34c40bc596130082ce626f582031ee58e6c7b5aa3e", 594 | S: hex"6f443dabd187abfeb167c7a76954251cb017b40dcd3c0de81909993fbdd6c99f64613e73aecc29eeb29fc9aab9ec54b55bc3539e0d34095248b5536b35f1a079a4f09ca2e83f51b07ef005a7e0a915be137e1d94ff2b26eda29a337b5b8d8652cb9f98703648a4b0d8c759ba48c1c37b2b76c3bbe116574c1f6265cc19703ce489186e3951e97e0d26230a82cd0b2a24def62b8af8e4962cf4e1a693d0d0bebd6fe45966b3a4e890e0a6f535919661beb109eb6d11e73ee2b97a3dd20074711bd4b817f442866d11c3fbf62255e05e466b36b8ffd57c6abe5592d72061d96435dedc32a822aa342b159ab21a993703b5ee7bd6d55508800b67667188810e062be554244db902947bd2ebc7f9e6c899f6ca1d3ba3a5c2edca8bafca8a5b54426b04a5a16a3c752d18647b578904f60a5dac531c95b0bfc37b7aeddd3c3564d0581f1088e85ed85ca366ef94eeb8f8d06b060f73f20778ae83bb884527fe9bc1a04d6dca59fefdfb9e14d68f97d9fb5fb1045c9a229d3015a4867efe88791554f8", 595 | n: hex"8aa12846ecb9d8b954d2ca0fd3f60826c76d2a98ae615f38f5a662cb6158f17f29050dc6a1bc2f60f3a9db2da6c9b27b8cabe25cfc25d005ad60ce298f6da3415ee0a0a00cd2fbaf1eb67d4fffbe03b2570ab56c10dfee9f4da86c05920993c92c4ac33a246f5102113a258e17736897f981b8b29ae695802fa1bcf9b41a5f1053bd77400a153d1d6efdf4e4c14703a34380da2921deac003b4a7246568527d9e37d0da956766f155d3b9a38ddb747f2706a72268542f594c90e0d2f0ef755f4aa67aa6a25004548c73861c0333597337a944c42f762ca2b54821425477e4e0e2a9b1842ed3f16d68ed31318dc396071b90e1e514cff975d198a581723cc98cb784d18cf197a14dd7b9d5036bd7724b9301f514236bf7c8b290dc5bd93ebb6bb2d18d3fc4f4d480b8d1b62ffa3de1224607976a27d40f912e50b46b915f19556781b2ac88e16c14982a0718bdb4cec77127165bd7151f0181cf56efa1ea345fee075a7b36a02e74a6f3eb035b608cdd2ceda4d738876fbd7ffb009019581685f", 596 | pass: false 597 | }); 598 | } 599 | 600 | function rs256_48() public pure returns (VectorTest memory) { 601 | return VectorTest({ 602 | // mod = 3072 603 | e: hex"0000000000000000000000000000000000000000000000000000000000e5a4b3", 604 | Msg: hex"897bd083c89256d56a247c12e265f3390962eace1cef2f7504e197bfdb7ea144ab3256f2798473a48247caf6c415e658c0f9ee627f6ccb68d3838d4ddf660b9cd904cad40f05210428009a98adef9a73c8e0453e4bed9cfff36de8edef6c5c839c59f6d393ffa61de5b7b2a0a5db59b0a77db7098859e863ee0970461178da20", 605 | S: hex"7a172ef111b0f2f9ec43bad8f6e8fa11e19222ed9575571716e55fe46b43aacee433447632849e0f486744054e70bdd98863f5f015b94ddd1571e64f6b9a26302e151d4865423791d596063bfad7e3b5c5494f4a3c5ed994c53b6d915824a1f1e8e3639f8873f9095a7842d88817a93bc2651e6ba94acce93830735654fcb5a4a01cccc090ede15ff5ed745a92d92d8186a746a693a94db4fae34db26c6ad0b4904c63001600947ee994e24da490a3de240e500b31b8be8b1b415599aa684c77116f12e3cb218cf388424e3276b1a3622f1c4115125f5af47d581b78b609a067ef5f33549fadbdadd098dd2c337897f113c8eca9a20f3da69aee2fe4a89bd3ff73eb4e8da271065a9013935731addb3480f52d07fb3a91261d8a030ee2cd9e0ab342b3bd62db62e359475ee9a36971ba37f5c3ae1f1939c276980140961e9542be9e0a4739fce668549fb606ae18774bbe62b20148dee0379f0f38fe982b25bae164785d3410c337b2f11ea74558d79991760847109dc0c77272a55afb0d3f58", 606 | n: hex"8c4b17ab9a0da366f67416075ce284ff69a2c1112a8b7d821f66e8bc5386cd1abfe499fb9a09523f1095729f61433cc17fed78789cde81145ba02d22ddb560332ec795ea6a764b9fb380f44ac63d64225772aa4503df2fdd20e7c1d17115d3c56176f49432b2930d417b84f997ed4e50cd557e2786e0275be8025f6f039a7a3b8ed421b4c224527c01c1a1bef6becda193eac7f484ab0a24da31d4bc8bb6f2d4a5f3817a246bd5a9c81dfbf55e8c5b18a8a63bebdcd245726ba5b6ed4f8981ab83933c00714064985d69a17ed017e3cfd7fd5d2c6e932a2e021d226013126e6272231ce8bf626121710cd19d0ff21227e4c4255be507809aeb0aa548f42749bae8e1a3e3b312d08f0226c5245c45b5d96eb8eaecd1b8a1dd3f9f908191325a02cb4ca57b25155447584749e2db23360233d9068195daebb7ca943311b58dedc6c809a5981ff1b66a803a4135fbddf1f4f2478559f9d2ba17d2da77b0f0b6b08662eb50495a16c301759cbf7281f4fa985800c14386e0db6df0422bbda9a26441", 607 | pass: false 608 | }); 609 | } 610 | 611 | function rs256_49() public pure returns (VectorTest memory) { 612 | return VectorTest({ 613 | // mod = 3072 614 | e: hex"0000000000000000000000000000000000000000000000000000000000e5a4b3", 615 | Msg: hex"77ba90225f3ba1722312f52b1a07c3f659aee2a085e939c3e5ae77a3bb0a0456d56637285f0ac93dfbdf89781479529c6e543ab1025e0daa0ab6fa4458b48b31eb29db76c4e80312f685d5e0fd5ccdbe50d544ef3ae7e7bee5db6864b853732ce28ae4d537dd37383c8b3f2b7db91ba427b96722d28baf489fa429cb83efa38f", 616 | S: hex"1f442887263f403f6ff9b20fd2780937596e99e3c9e640def7de2006f14026de1e140e0cd5d45d7fcb1f42a9127a661c87cbaa4f9b600d8ad7fde5beed5c125294ad7b211d550bc35429c71f84a837eca906a580aaf3e301b46deb59ebfa4b66323f6e136d178f7ecd8440d891eeed5c91ed785ffefcc725f2792868e296a8eb03c5683ce791b554636a787d579e3db81177b45aee1ac6bbd90d84144a706196d557b48d7fa8b551c3bf638ce93a6425eac03232256f4cca758ab2c427d996702b522eca24b0781f33aa2b61e1256fdb94b166f98cacea3d5da205f818d19b432d50309d8265eef151b0f40fceba927fd6b5ec9d1c2ba54eb9af22aa354299ffad07da5071a1fb4314c69399a5aa16c3b4ff3b61937debf6e55b5f44e91855ff0a64ab59f549c3b4dcbad5c4306b08be4b1be99d000ea52665e9bd1983fbfaecb15ba18adb3e88bb9429d6d1aa85f7f6304c253692ea0ae579123703f9d89f69669fdd4c12607d8c1b7a28f814e75a45122956c21cae47bba9e4ec1afb707e5f", 617 | n: hex"8c4b17ab9a0da366f67416075ce284ff69a2c1112a8b7d821f66e8bc5386cd1abfe499fb9a09523f1095729f61433cc17fed78789cde81145ba02d22ddb560332ec795ea6a764b9fb380f44ac63d64225772aa4503df2fdd20e7c1d17115d3c56176f49432b2930d417b84f997ed4e50cd557e2786e0275be8025f6f039a7a3b8ed421b4c224527c01c1a1bef6becda193eac7f484ab0a24da31d4bc8bb6f2d4a5f3817a246bd5a9c81dfbf55e8c5b18a8a63bebdcd245726ba5b6ed4f8981ab83933c00714064985d69a17ed017e3cfd7fd5d2c6e932a2e021d226013126e6272231ce8bf626121710cd19d0ff21227e4c4255be507809aeb0aa548f42749bae8e1a3e3b312d08f0226c5245c45b5d96eb8eaecd1b8a1dd3f9f908191325a02cb4ca57b25155447584749e2db23360233d9068195daebb7ca943311b58dedc6c809a5981ff1b66a803a4135fbddf1f4f2478559f9d2ba17d2da77b0f0b6b08662eb50495a16c301759cbf7281f4fa985800c14386e0db6df0422bbda9a26441", 618 | pass: true 619 | }); 620 | } 621 | 622 | function rs256_50() public pure returns (VectorTest memory) { 623 | return VectorTest({ 624 | // mod = 3072 625 | e: hex"0000000000000000000000000000000000000000000000000000000000c15efd", 626 | Msg: hex"34a83157520e0413bc2ec4b48034fe5cc3fd2f69fb7992f95e5437ad99d555aec606e1ee98155fb1d9faf94b175ace2b9aab8c18999a41bbada96e5e851d5ef3dc17b558a8014cd9942b3cf7b1b6396768b2225eb483d50c8e894866a800d6295d24d61ce8997295d50bb73eb612e819175818c2b4fdf7f5e93aed4f69456559", 627 | S: hex"7a1699fcecfd4d337bcc6f4904d2356fff44aa24fd4a0324945d4a4dd9a9a552c59239dc9268783067477dade944adf592495a3b1e5a6eea7f58762ec4d5b0f3515f3b1eaab1273476cb0cc3080fa8c7d2f2695f4417a6dc538b8b2c58bfb248b7c41485aeb668a0a39ffa324f25074c75c0ae1c70496a4a37c9332fd73ced1d2fe561ae120c6c19d1e526c211ce8869ce236d06a9dab8f9ef453f8854cb4451033960a62fe279830667845edd5883734e730e50e7bae3bbcc619e5c4211ebf741ad2526bf0226440b7d076faa02a30f2c79132443de9fe9e6bfc12c65d1ee703ea274c06ffd5cf945413cfe13d1ec63d48ea477ba8c60a7aacc078b988cdb58691911975f26e1b33c2c0ff3e5026d9b1d7a6293eb330ad5513efd19937193b796c40114dd1ff32a2875963020f26177ca1b6a7d0c6a40a6c0be44b03555c0f4598f91600a336c73099fab278271c46d96f16d6882c00d5b3ba59f2a0bcb98f39b152c55eaee62a4eba026234f15963d7e7395de927e94893a8a175c65f0dd43", 628 | n: hex"8c4b17ab9a0da366f67416075ce284ff69a2c1112a8b7d821f66e8bc5386cd1abfe499fb9a09523f1095729f61433cc17fed78789cde81145ba02d22ddb560332ec795ea6a764b9fb380f44ac63d64225772aa4503df2fdd20e7c1d17115d3c56176f49432b2930d417b84f997ed4e50cd557e2786e0275be8025f6f039a7a3b8ed421b4c224527c01c1a1bef6becda193eac7f484ab0a24da31d4bc8bb6f2d4a5f3817a246bd5a9c81dfbf55e8c5b18a8a63bebdcd245726ba5b6ed4f8981ab83933c00714064985d69a17ed017e3cfd7fd5d2c6e932a2e021d226013126e6272231ce8bf626121710cd19d0ff21227e4c4255be507809aeb0aa548f42749bae8e1a3e3b312d08f0226c5245c45b5d96eb8eaecd1b8a1dd3f9f908191325a02cb4ca57b25155447584749e2db23360233d9068195daebb7ca943311b58dedc6c809a5981ff1b66a803a4135fbddf1f4f2478559f9d2ba17d2da77b0f0b6b08662eb50495a16c301759cbf7281f4fa985800c14386e0db6df0422bbda9a26441", 629 | pass: false 630 | }); 631 | } 632 | 633 | function rs256_51() public pure returns (VectorTest memory) { 634 | return VectorTest({ 635 | // mod = 3072 636 | e: hex"0000000000000000000000000000000000000000000000000000000000e5a4b3", 637 | Msg: hex"72e970c5fbeccfb254bb1313e33470e3074dd8d3fc60093fffc7c960b2a970c3c113a8fac64b71916a616844cd06486e29a1b1c5b2a02845c00c606a2f61b7a2069c040258959038688f62c1100ec05c64e9f2be929f49870dee6075eaa2a2d78aac0c457973348f966f8bf374f3df93014a2426650673ed2d9553e8a915384b", 638 | S: hex"6ce37157a92a7eda47c16b5b2d961c564ef7df9d5886043c07abbd1e74ec7f549c78b07e2140207e6b93e89ae69a74a5a76184e00ec03f1dd36c0699535e0bedb4f28634b194fcebe13d2c4955e01e4ef459244a7497fd647d5e6dd5f7ec156929d0e2f1e146d3397d3636726bbea13b38d7d38d4a5e4ebe68df7ff86c62c3802e18250a2cab3d200363c577895a33dc69c18d15309e7117ebf47b3b98c893785c99dd0077982ee084b4ac08913de46415e5abdbd223aca6ac5574ff4a61f5fd7631b776113f12044e5e53960a5af3867c8366e3367a20de73e6c4e0f7b9075a1a79374aee0232d06280c53bc6a148026e1686059d652d96c99ac41f909e278b3c408568adfe35cc55800caa58d03ce9f1cf533018ec4fcb5d66a50758229716c2abebe4b3e3c6ac778fc008db8985e5032d7825fa333fa4d7468504cd0785000f92833d5cdd61880bf40f803ac298343d75e18c003a8471e06449406bf1bafd988e162b0b8c62eee5795d957f1fe5d7abc6e7c8b3b43759f212d01def9151dc", 639 | n: hex"8c4b17ab9a0da366f67416075ce284ff69a2c1112a8b7d821f66e8bc5386cd1abfe499fb9a09523f1095729f61433cc17fed78789cde81145ba02d22ddb560332ec795ea6a764b9fb380f44ac63d64225772aa4503df2fdd20e7c1d17115d3c56176f49432b2930d417b84f997ed4e50cd557e2786e0275be8025f6f039a7a3b8ed421b4c224527c01c1a1bef6becda193eac7f484ab0a24da31d4bc8bb6f2d4a5f3817a246bd5a9c81dfbf55e8c5b18a8a63bebdcd245726ba5b6ed4f8981ab83933c00714064985d69a17ed017e3cfd7fd5d2c6e932a2e021d226013126e6272231ce8bf626121710cd19d0ff21227e4c4255be507809aeb0aa548f42749bae8e1a3e3b312d08f0226c5245c45b5d96eb8eaecd1b8a1dd3f9f908191325a02cb4ca57b25155447584749e2db23360233d9068195daebb7ca943311b58dedc6c809a5981ff1b66a803a4135fbddf1f4f2478559f9d2ba17d2da77b0f0b6b08662eb50495a16c301759cbf7281f4fa985800c14386e0db6df0422bbda9a26441", 640 | pass: false 641 | }); 642 | } 643 | 644 | function rs256_52() public pure returns (VectorTest memory) { 645 | return VectorTest({ 646 | // mod = 3072 647 | e: hex"0000000000000000000000000000000000000000000000000000000000e5a4b3", 648 | Msg: hex"6147121ced1b5f1d73306e4a22c31669b76c20764fa4b4467d86126a9ad283565c378ec3aad26e51aff2c4712e1e8a821559483a54a48a48efc5913752474996e6c27b56e15c44736290c6d7bd2e1d7b13a394cf277b195c6c24efa763f5a359236e419e39c2c7cbb392da4378fcb89bdbd46efc6f314bc91c2c948272e479e9", 649 | S: hex"8b5320215e2133754a182f38444a68fe9f3cfdbb7ea9d8e55d006789fb1d75c0fbe5e94201b15c97613a35c3ab54d61dcc62b978a8fab0ae3183fb7463814ec498eb0f4b0f5403044f33368afcf692b1b3ee3ef0ec1492c5c2ec370d75163b777705a0675252908bff8010e819bbde67b86b33a35e1fc43cb8da167691b6d69ecc19ae094a5461cadb0e977ea6b7ef6f3f639e4571a073d6033cf464e5eb17323447ac079e4e69caa7966d3083ecf616394fa25d2e30ef4e5b7e558c8c46802c2e35db02b7884b53b89f041037bf10ff30f291003323112dcc6b8eeebde3bf97e373305eab433061e3a634df865642743908ef822df62cedde8f4af403e7a924e22e667734e91a29d4b6c8f1c12da7023a1b22e6a3dd33e878efbab31220f4f2c923c88f1bb0d7b7497a9c687fbf59f9eb4625e6f92d7285bca5db93ae63213e3fe1333801fc3eca1d3a1ffa75319752a5aaac461d7a799659ad31569230266c1a62e787c25fa635b0d3aa248d047d9cee43fb12342a4c066dc971b893a7dbcf", 650 | n: hex"8c4b17ab9a0da366f67416075ce284ff69a2c1112a8b7d821f66e8bc5386cd1abfe499fb9a09523f1095729f61433cc17fed78789cde81145ba02d22ddb560332ec795ea6a764b9fb380f44ac63d64225772aa4503df2fdd20e7c1d17115d3c56176f49432b2930d417b84f997ed4e50cd557e2786e0275be8025f6f039a7a3b8ed421b4c224527c01c1a1bef6becda193eac7f484ab0a24da31d4bc8bb6f2d4a5f3817a246bd5a9c81dfbf55e8c5b18a8a63bebdcd245726ba5b6ed4f8981ab83933c00714064985d69a17ed017e3cfd7fd5d2c6e932a2e021d226013126e6272231ce8bf626121710cd19d0ff21227e4c4255be507809aeb0aa548f42749bae8e1a3e3b312d08f0226c5245c45b5d96eb8eaecd1b8a1dd3f9f908191325a02cb4ca57b25155447584749e2db23360233d9068195daebb7ca943311b58dedc6c809a5981ff1b66a803a4135fbddf1f4f2478559f9d2ba17d2da77b0f0b6b08662eb50495a16c301759cbf7281f4fa985800c14386e0db6df0422bbda9a26441", 651 | pass: false 652 | }); 653 | } 654 | 655 | function rs256_53() public pure returns (VectorTest memory) { 656 | return VectorTest({ 657 | // mod = 3072 658 | e: hex"0000000000000000000000000000000000000000000000000000000000e5a4b3", 659 | Msg: hex"e9ba77e32581fb11b3d44a885ce8184207a00b5835016418cfe6e25921f4e30b26d1cd120691ac55dd711d11bec86a74f83af667972fdcab2e83d327d48055806d0900eb2b173c3f546a1e4f45788c76b7aaa27341c755771eb0567d314f39da46cad7159bfcf1f89f2516e7f9e0c671cc56d72539b218a726d535033e4ada40", 660 | S: hex"17c273523709d84746ae546c8f58086a5ab385aade0707b5b39adbeb507670453a56bd356a9b549fb0112eb3be73466294c0180a9061b04128a001f62025867277e28508fd1c94109061184f6acac575737ec4f93c58ee452089e6714c4dd9f23833278dc66332a914ac8e1b0ec33472061bab9c29cd8d7a0c1778c71fb973c851b6c9bbb7b7dfd24a16f146eef248d1aa81e4f62cafce2ea146314b2a8d5711de6625011ee7ffe7ac49b03a5b7e2d842e9b35969a934c75d16b6cb890f8d4ebeb6f74a08059e70e90ee39816cab34c4702ccd4e14718a8ab5c981f9c8f7cb3e91bf066ba387824c1b27e33b27a06d9eb3ff3fcace0b285f51cf83b117005bcc12da946b5a36e9308ac98e9103becc8ec5dbb048df722e5c8e6cbeaad8f2e27af33648c9ce5d7940013146f5d3cb8c30849ea75b209c36b745dc3179617933e22dc25af5169f784d6128af2c8694b5caf19fbc0585ca1780181150e8f8bbd8d12ea8b0d41f86b1b3b27771b3f36d3cf5ac6a2702b8711d52edc1cc96ce071eab", 661 | n: hex"8c4b17ab9a0da366f67416075ce284ff69a2c1112a8b7d821f66e8bc5386cd1abfe499fb9a09523f1095729f61433cc17fed78789cde81145ba02d22ddb560332ec795ea6a764b9fb380f44ac63d64225772aa4503df2fdd20e7c1d17115d3c56176f49432b2930d417b84f997ed4e50cd557e2786e0275be8025f6f039a7a3b8ed421b4c224527c01c1a1bef6becda193eac7f484ab0a24da31d4bc8bb6f2d4a5f3817a246bd5a9c81dfbf55e8c5b18a8a63bebdcd245726ba5b6ed4f8981ab83933c00714064985d69a17ed017e3cfd7fd5d2c6e932a2e021d226013126e6272231ce8bf626121710cd19d0ff21227e4c4255be507809aeb0aa548f42749bae8e1a3e3b312d08f0226c5245c45b5d96eb8eaecd1b8a1dd3f9f908191325a02cb4ca57b25155447584749e2db23360233d9068195daebb7ca943311b58dedc6c809a5981ff1b66a803a4135fbddf1f4f2478559f9d2ba17d2da77b0f0b6b08662eb50495a16c301759cbf7281f4fa985800c14386e0db6df0422bbda9a26441", 662 | pass: false 663 | }); 664 | } 665 | } 666 | --------------------------------------------------------------------------------