Repository: randombit/botan
Pull request #2790 (2021-08-03 22:23:39)

Avoid using short exponents with ElGamal
Some off-brand PGP implementation generates keys where p - 1 is smooth, as a result short exponents can leak enough information about k to allow decryption.

Needs backport for 2.x

cc @ronaldtse 


Patch:
diff --git a/src/lib/pubkey/elgamal/elgamal.cpp b/src/lib/pubkey/elgamal/elgamal.cpp
index b3ec6df2c..0e33c2ca5 100644
--- a/src/lib/pubkey/elgamal/elgamal.cpp
+++ b/src/lib/pubkey/elgamal/elgamal.cpp
@@ -113,8 +113,12 @@ ElGamal_Encryption_Operation::raw_encrypt(const uint8_t msg[], size_t msg_len,
    if(m >= m_group.get_p())
       throw Invalid_Argument("ElGamal encryption: Input is too large");
 
-   const size_t k_bits = m_group.exponent_bits();
-   const BigInt k(rng, k_bits);
+   /*
+   Some ElGamal implementations foolishly use prime fields where p - 1 is
+   smooth, as a result it is unsafe to use short exponents.
+   */
+   const size_t k_bits = m_group.p_bits() - 1;
+   const BigInt k(rng, k_bits, false);
 
    const BigInt a = m_group.power_g_p(k, k_bits);
    const BigInt b = m_group.multiply_mod_p(m, monty_execute(*m_monty_y_p, k, k_bits));


Test patch:
diff --git a/src/tests/data/pubkey/elgamal_decrypt.vec b/src/tests/data/pubkey/elgamal_decrypt.vec
index f676be50e..a9d9dd167 100644
--- a/src/tests/data/pubkey/elgamal_decrypt.vec
+++ b/src/tests/data/pubkey/elgamal_decrypt.vec
@@ -58,3 +58,48 @@ G = 4956716650468111499852968442558584961751486202697832959709919208796153871740
 X = 4304232149632055597449717737864742436448127103739097
 Msg = F73BB7E5C8A5619380
 Ciphertext = C9881464A37749949D66D75CD9B7A8ACAD33DD1FAC7561F684E9CB5343D2ED15969D7EDB4135518B50F0FEC9A9559C1D5E44DAB42C14BBDE2D2711EA4D02D7F27D1A9BCFEC9E8B73FA64BA3C54707FDDE7D5BE695E17FB9D259FB576FD4E57D66C8F727DC236E2A6E9FD01709D34B8D09F7DD3890F003EBE616042B4E0A8A00F6C3F34DE7E002FE72A84AF8D014D64E8CD08B9B56CC3A6BBE6F966B92105A92C5ABF4F2BF735670622F6213FE9739FAD65692E1C0EBF708A47E18600A22972A5A3DA0F22D11C581D46F734151A083FF757E961351EB183B467A859FBB9ED1DAC396FA405701FD6E3A62EB126E93648C3C6DFA9C4DBF3C005880F4799F66B310E
+
+P = 0xFFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE649286651ECE65381FFFFFFFFFFFFFFFF
+G = 0x02
+X = 0xCC13EE3533858E0F0024FFC935DC5BD297DEC9385AC8EF7E
+Msg = 1C
+Ciphertext = D73F6E5CEF558B92C924FEC2329774ACD75E7CEA04D2485F07920EF4E5B86E361E23E42AB6F3A97F5B1F46218BF3C00E93A2EA981B8BB48EDD020A3F96D61FDA0F3E4D26F5538B2179B7D7E333CE78414F18E6CD0AE74C3F44FBFAC9121A3A6CF80C85E89280F9BC476078F9FD686A6500590B1AD75616C0A92BC73838A6D4437368304638242BCD628A72EA432FE7C1892922136B3C19B39990980185328E5BBD35DE42549819C8E301348320BA80602E751172D9ACAA8E0B67FB97996310BC0C14B9E40626FE54138851E4BC4CA4CB2F0A1F3D3F042556A4942B2B03B4C2F75E50260365865FEE0050DAC3604E78708715549FF878F1B337D6ABF8B695462F
+
+P = 0xFFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3DC2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F83655D23DCA3AD961C62F356208552BB9ED529077096966D670C354E4ABC9804F1746C08CA237327FFFFFFFFFFFFFFFF
+G = 0x02
+X = 0x8D81343C4994DAF21AD0E6CB88C74F55529925EC953381470B72B3C8
+Msg = 7F0CCACA157707BF03
+Ciphertext = 2EDE1A9F975FCAF943AEEB51EB37EAEDF54C4D939D0DCF7C80874A3BF8601B511685B1FDE52E07D8894EA647C50E480DE7A48ACADD89F79EEB9411234507CE6AB8503BD47B284134E301A78BD7FAC8D8B15A5D1424B820FF3FE1F363FC88FF510183165F52EE022A55EC43D4DD75763297C13F9EE3BCD579ADBA6800348F0C6240F49744B385737926A770EDF67257E7F5654C478C614700B6D2D671A13B28006C11C499BEB29658EF10C3E2EEC390A972372EBF733BA6EE5F4D600AAE1DDDC87EFA6D9FB05CBC995F82C3EF47CF862715E17DF7CC948846E849661D5C82C6A120610D90BB2D373D189A0BF13175F551326ECACF2D349A4BD2D265FDAC716E4B0A5D850E7EDA92CF9F8863BF1CD31C3888BFD81500DA4C615575EE8FA27615EF8E4B9D23A53852B236057E15DA7FC5827668A7B8AA699D3F79201567F4F0DAF7D89919906486A66ABA689FFD9E3BB5F0D1C677CCC12EA29BBFE1083C4FC349EE7E236BC8DC02DEE063E7F7C7B719E3176739D55196A2B7E6C3AA2A543135AB8F
+
+P = 0xFFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3DC2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F83655D23DCA3AD961C62F356208552BB9ED529077096966D670C354E4ABC9804F1746C08CA18217C32905E462E36CE3BE39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9DE2BCBF6955817183995497CEA956AE515D2261898FA051015728E5A8AACAA68FFFFFFFFFFFFFFFF
+G = 0x02
+X = 0xA9F666E685F4F0BAFFF22C407B28461591CBF43F8DA1A8C3B1510BB6AA3BCD6C
+Msg = D830F02AA1AE9328CF3F2C6CB7D86875
+Ciphertext = E8AC61EE6EA9DCBEDF5DD10247240E0FF3A6D1B1D2C9832A73C5EF2F96FB23C6FA571F9E407089ADAB459086B4331DBCBB3E5FC69B996748131D0D499EFF4F3654CEF8ED3C14C97C4985E5E0D6E0714E789F9D926CB26A23ACB52D6308CDB3C4DBF92F7A701513B133A0512A0CC16E13BCC7F983BC181C71A42252D48B113BAB4B861430AC6157E3043BD861C44D0804CCBB0B9D5BA599650DABE9FA7BF286EB08A97D11D5F88CB0157A4522E2C9F4EF53EB9D7679974C5AD86554EED49736D0D7B39461B92C73CBBEBAD8E92A6501293AE9A5BF0FBDA11BC743E032F78740F96F8CD71D30EA0F17F42181783C908A6008E339620CCB80226E9CDD7E5D50DEF9310DF03C971955CCF70557C9816049C2137CB7554998BD90B81AD549E9B65347E4BC798039BF05929DED052EE816EA3A87014B0D25E2E279B7736446201F52E542AA6E494BDC6D02A9A0479E1F90D5F3898A36AF7BA03E8F0BCBBF891A1C1B0B300EA664349E765EA331841ABC7963012C623318EF9B681711461ECC83EDC88722DE5E16FF1AB57B23F285CC5E75F6FCB46EEC9F919D1C089E7C045535E64A97F16662DF9CEFFB0E6C9C6402A43E47D1D073A5555A470E2451809234ABFD463A013D70288BA4A093E51FCED6A434886ED70490D63DFD809F27A773CDAC3D848A21C2937CA194C4FFBF8E50C05AEB3A530A7AB8B39B91A72EA45034A2FF8F16B1
+
+P = 0xFFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3DC2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F83655D23DCA3AD961C62F356208552BB9ED529077096966D670C354E4ABC9804F1746C08CA18217C32905E462E36CE3BE39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9DE2BCBF6955817183995497CEA956AE515D2261898FA051015728E5A8AAAC42DAD33170D04507A33A85521ABDF1CBA64ECFB850458DBEF0A8AEA71575D060C7DB3970F85A6E1E4C7ABF5AE8CDB0933D71E8C94E04A25619DCEE3D2261AD2EE6BF12FFA06D98A0864D87602733EC86A64521F2B18177B200CBBE117577A615D6C770988C0BAD946E208E24FA074E5AB3143DB5BFCE0FD108E4B82D120A93AD2CAFFFFFFFFFFFFFFFF
+G = 0x02
+X = 0x981606068AE29B5B86E6F1E4E578010E43E1DBCB12504857CA6CDFC77913EFF0B3F563E1DDB40934B4F33099A6BF8EE8
+Msg = 0E738AF35B6AE8951E5C3BF8EB
+Ciphertext = 659C8E28BF6A26E5D55386E437F2B66282EB9F9ECA54522D8A1FDE6BC6C4D65E5412D030BDC9833F93E3653B7B58FFD66A2EBFB8AAF1F7BBB52C3CD43E08DDB3D2C73E26EEA988EEF9CFDC9C59872B4D2454A1F500911B4D3BD3EED99107FAF39D97A3302166AD5B0381ECAB769953406DD3FEB502D23587D9CF2C89F93FE6A73167E3734CD0676EE95F7C43A558A56E7B0264A6084875D1E7F2312FA7BA7145AAA5921F904EDDC7A6EC823C57AFE323E4368CD7D47CAF2F8A94D6D3117A8BE92BAF6F0392A20C7FCFE381789755B7B47B9C5496382FF26533EA7F911472F02E2F9E29CAC9CFF4AEB90C36E55A1AF5D0259B195E2824C7F6B40299D8A0858E162B3D9392E323F62B48DA629089902F16D01D1AB3DCFBAAB46F1E74ECA6560B3A97E85E9B88B8F11AA83F78E8E542B8A3B4C0E7B47220594979BC7DD12E97238EB4B91D23A8F2D5362CB8B08C1F07B3461AD0968FB3053F60ECC2B3C0E900A0A7C2924C3FA79CCB43B33B336B807C6F4B83A7AE0112BD72A13822E3CD0B2E2AF7717F2CB21BE02D8DB0EB3BCCF66836BD83C828C221569EFCAA53124D206CB51D3718BC1511799DEA0558DD6FDBFB06B3D96BAC451FE71A4244BD3CD6826BF27EA3CC7782C17DCAF52EAA944CEA734D011145F10A4132A271349A8BF1ED0D7F7EF2ABC7031475B4397574F8A7EC4F5480D85CF0CA1F7C69097A2A009FFD4927AA769FD821F64741812FE5DB996ECAD3265CE93DBA7B40532A2133FB8EE5066A0C5F91C7E0F3902B6CEA39D5BB4B59B2993B5DAA2B61FF589BF45613D1EF36D5F7D959E8255C0010EC439AAE1C9B682BAC92C2883ED279CD8C644A301150879EB8D37B217B36447CBAC37C132C0278AA8CB38A8596392E3A3CAA91573370ED44DF46311EEE878B63F947F2A28930133D343737502623D0C7D3EA5D8D8123D7963C70AD30CC865BCD68F96C1A13A3484AB4EF3828CE338BF8E087F2300B777D556974D5E23FAFD55AB54353BCA31BEC13003AC7258510578F96B8F1E2254E91768A78CF9FCC6D8CFB0493701D523F75EC25B37B623B5A73A28009DBC169A084E95D
+
+P = 0xFFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3DC2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F83655D23DCA3AD961C62F356208552BB9ED529077096966D670C354E4ABC9804F1746C08CA18217C32905E462E36CE3BE39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9DE2BCBF6955817183995497CEA956AE515D2261898FA051015728E5A8AAAC42DAD33170D04507A33A85521ABDF1CBA64ECFB850458DBEF0A8AEA71575D060C7DB3970F85A6E1E4C7ABF5AE8CDB0933D71E8C94E04A25619DCEE3D2261AD2EE6BF12FFA06D98A0864D87602733EC86A64521F2B18177B200CBBE117577A615D6C770988C0BAD946E208E24FA074E5AB3143DB5BFCE0FD108E4B82D120A92108011A723C12A787E6D788719A10BDBA5B2699C327186AF4E23C1A946834B6150BDA2583E9CA2AD44CE8DBBBC2DB04DE8EF92E8EFC141FBECAA6287C59474E6BC05D99B2964FA090C3A2233BA186515BE7ED1F612970CEE2D7AFB81BDD762170481CD0069127D5B05AA993B4EA988D8FDDC186FFB7DC90A6C08F4DF435C934063199FFFFFFFFFFFFFFFF
+G = 0x02
+X = 0xB73A80EB48DB4DF3108BE1345281A1B39B4373BFE71CB4DA9F3594A94C525E2E288F06089F61C1D29D6A99EA775C05D6
+Msg = D413DAC9D341361F17EDCE1C46A04D343424251B
+Ciphertext = 085E76D450C7FF0B2DB59D41D12596AD1B0D8AF877F5C63416D2B355ED137A5AEAB3B75AC4CBFB5168F37EC02724EA057ED5B9AAF0C40D5469FB9E068C7E090C6EB411CDFBC9A500294E2433A9F879F52F8359B0865128A76801B7C4E22D5A3A6279F755291ECC9454AC3C1F1395DA5FA8E25CD951FCBF9B569EED304B3B82B0198913FAFD0B9A3ED32A64B0E394F96C153D25FBFEF92ECB38F79F2DE12570A041C8B4E8ADB998D6A559BC9640EBA8B61A6D0387CF0CA621B6C3F60D464DE7D27D5347F79CABD09533219DD2CDA8BAB74E886E206409A94054CCF3EBBA570C33FE456BD6B0BEB564F406AF49400550AE01A21A68126C90E0B8295CB7F9C2F4C790D8B0FEFD1FC6BFF40A00737AF9EDA25A1BF00E7FEC8CE776C3D24C61EBF48049CE5B27E024B796566BA670090BAB1A6015C01DB57DFDDAD61240F151C61BC80C3BA320050D1E537D501611627531E41793C3468B87F28BF2281CE996957901BE6CE41FAB0F88467ECBC0DE6C5F60AB5A1AF21A9528B0E8BABAD56FA23F2AD3CBC521A8D54047F15F58FC9C5CD4BB322A0838EDAC053415CFED87FD0756FBFF6B052D385C2EED6FD4686E024F7175A9840DF7E74740FF368DA4DAEB879D7C0D265D51809BD6EC6A66717498A4998D0232586CA4C5F7858EBEC824821CDBD1133DA557612A398EA8F9AC959A39381FCF1D727D08136CAFC4D72E9A945043E6DE2C67F6B55C21B7EDBFDCEA2B63CF9A5BB931DFE76CA2BE5D3D964AA2C348E6DFBA4FFC4D5E463105E243BD20AF38531A70BE1DD4930F998E28C3182665507700976BC14438452179747E623B2E5328A3ED5925FA526AE897ACF67059D76D159CB31D85F03589A4874AB11A7E2BB680FCEF7A4CEBFD98B0DC18BC1AF838524107E3264C2FDACF883ED2701CF3306E83CB8E75F5ED148F3377A77474D47522596F50DADEFC149A91C619F4A9366771681CAE1A82AA57BB038E0180BD38C4323928E63FA890B85009B1A25C022AEE8DB4D7F4E34260677A22B3BC7F24089E98FC484B93EC95ED68D9D56B2F6DDBCE73AB844F5CBBD908E51651517F6920DC42F41B874EEB9DA244C4485D2A931C7A76E99D490E6B3D4AE44484CAE4B784A0773782D2B9CFB4D893E79D35CF4282CB9A70EA53700F49F6F47F374161D0B820690D2C99E3A2602B31E659E64E5D4D4BD111C73FD5AF47412748091E272947A307309F3732E04FA848AACC312ADD0323F09F7947788D9F2BC55BDB7DDDD1FE664C5C9E861F6052F8F94084927116CAB24C6B11FEE69ADD2BCED4CC7EF330519D287531861A75E0F00CA8E52CBE9B77E8F840168937222D5851C84195DD4E698AB8BB558A05026EBC09520A1B1F0BC44F699478A69E1C1384F37F16102DE90ED960CEFFD9EA299FB79D416F3AF6CCD1A022895CFE032AC65978486998E3714A56E3DBAE
+
+# Generated by Golang x/crypto
+P = 0xB10B8F96A080E01DDE92DE5EAE5D54EC52C99FBCFB06A3C69A6A9DCA52D23B616073E28675A23D189838EF1E2EE652C013ECB4AEA906112324975C3CD49B83BFACCBDD7D90C4BD7098488E9C219A73724EFFD6FAE5644738FAA31A4FF55BCCC0A151AF5F0DC8B4BD45BF37DF365C1A65E68CFDA76D4DA708DF1FB2BC2E4A4371
+G = 0xA4D1CBD5C3FD34126765A442EFB99905F8104DD258AC507FD6406CFF14266D31266FEA1E5C41564B777E690F5504F213160217B4B01B886A5E91547F9E2749F4D7FBD7D3B9A92EE1909D0D2263F80A76A6A24C087A091F531DBF0A0169B6A28AD662A4D18E73AFA32D779D5918D08BC8858F4DCEF97C2A24855E6EEB22B3B2E5
+X = 0x626adfc4696e5dee7f95f24077c8377b1df439cb76ab82134fe4a48b673e565a
+Msg = 0244454144424545464445414442454546444541444245454644454144424545464445414442454546444541444245454644454144424545464445414442454546444541444245454644454144424545464445414442454546444541444245454644454144424545464445414442454500476F207465737420766563746F72
+Ciphertext = 0F0AF27EB240927497A4245E592BDA1AA12420054AA406080420E92FCEDA12A3DCBF1CDEDA86A87029DF05C8D2435DF91A53BF65164375C302C19773C88677E88C36C3BBC408DFAD0672C1A56E5CDB8932AE11DD250F3DC31CB601582CC10C2E4BD26149AA5519AEDC7619C35B6F920B53B3AAEF728B06F37D08250B14C7AA0E291F233A5F5A6EE2333C9839C7C654C21669795B5C1415F92AFFBD24273403160AFE1DF058F554085283E0D5D8C487CBD4F7EFFBAE620C67F285CE4DD83FB1A00733B5BF9CA22A33039A7A15169757EFECC36A15F67609707C751F88FB5E70861BDE09A72A6B4558EA2841792BC86EC523DF23094D4B55663527EAB70D182CA9
+
+[EME-PKCS1-v1_5]
+# Same as above test from Go but with PKCS1 padding removed
+P = 0xB10B8F96A080E01DDE92DE5EAE5D54EC52C99FBCFB06A3C69A6A9DCA52D23B616073E28675A23D189838EF1E2EE652C013ECB4AEA906112324975C3CD49B83BFACCBDD7D90C4BD7098488E9C219A73724EFFD6FAE5644738FAA31A4FF55BCCC0A151AF5F0DC8B4BD45BF37DF365C1A65E68CFDA76D4DA708DF1FB2BC2E4A4371
+G = 0xA4D1CBD5C3FD34126765A442EFB99905F8104DD258AC507FD6406CFF14266D31266FEA1E5C41564B777E690F5504F213160217B4B01B886A5E91547F9E2749F4D7FBD7D3B9A92EE1909D0D2263F80A76A6A24C087A091F531DBF0A0169B6A28AD662A4D18E73AFA32D779D5918D08BC8858F4DCEF97C2A24855E6EEB22B3B2E5
+X = 0x626adfc4696e5dee7f95f24077c8377b1df439cb76ab82134fe4a48b673e565a
+Msg = 476F207465737420766563746F72
+Ciphertext = 0F0AF27EB240927497A4245E592BDA1AA12420054AA406080420E92FCEDA12A3DCBF1CDEDA86A87029DF05C8D2435DF91A53BF65164375C302C19773C88677E88C36C3BBC408DFAD0672C1A56E5CDB8932AE11DD250F3DC31CB601582CC10C2E4BD26149AA5519AEDC7619C35B6F920B53B3AAEF728B06F37D08250B14C7AA0E291F233A5F5A6EE2333C9839C7C654C21669795B5C1415F92AFFBD24273403160AFE1DF058F554085283E0D5D8C487CBD4F7EFFBAE620C67F285CE4DD83FB1A00733B5BF9CA22A33039A7A15169757EFECC36A15F67609707C751F88FB5E70861BDE09A72A6B4558EA2841792BC86EC523DF23094D4B55663527EAB70D182CA9
diff --git a/src/tests/data/pubkey/elgamal_encrypt.vec b/src/tests/data/pubkey/elgamal_encrypt.vec
index 059eb1668..92e869054 100644
--- a/src/tests/data/pubkey/elgamal_encrypt.vec
+++ b/src/tests/data/pubkey/elgamal_encrypt.vec
@@ -3,30 +3,35 @@
 Group = modp/ietf/1024
 Secret = 0xCC13EE3533858E0F0024FFC935DC5BD297DEC9385AC8EF7E
 Msg = 1C
-Nonce = EEE23AAA149AF29E18EF8D66AD8D4BACB72076BAE583A297
+Nonce = 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000EEE23AAA149AF29E18EF8D66AD8D4BACB72076BAE583A297
 Ciphertext = D73F6E5CEF558B92C924FEC2329774ACD75E7CEA04D2485F07920EF4E5B86E361E23E42AB6F3A97F5B1F46218BF3C00E93A2EA981B8BB48EDD020A3F96D61FDA0F3E4D26F5538B2179B7D7E333CE78414F18E6CD0AE74C3F44FBFAC9121A3A6CF80C85E89280F9BC476078F9FD686A6500590B1AD75616C0A92BC73838A6D4437368304638242BCD628A72EA432FE7C1892922136B3C19B39990980185328E5BBD35DE42549819C8E301348320BA80602E751172D9ACAA8E0B67FB97996310BC0C14B9E40626FE54138851E4BC4CA4CB2F0A1F3D3F042556A4942B2B03B4C2F75E50260365865FEE0050DAC3604E78708715549FF878F1B337D6ABF8B695462F
 
+Group = modp/ietf/1024
+Secret = 0xCC13EE3533858E0F0024FFC935DC5BD297DEC9385AC8EF7E
+Msg = 1C
+Nonce = D0F937A84865734C37877CBBD731D9A378EA8644B5C4D9A65B2C81C46F1014364F3593C6B9DFF25E0741EFB6C3E033522D66A6DA1C6B7666E8C15112BFAB850C38177C30CC05449B1A7D0D11EDD555997C57840D319279E5C80A51DC15F8103B820C5C870432DC14B70A12207EF749C835825C63B05B2E1A8FE36F0264D5B13D
+Ciphertext = B1F5602B7E72A8B3B5932EE86F303A14D764BAD54BF37902F0AA4C2592E04D3BB70F6CAAD3287B613D48C4D735E776F212BB26D46F53699B08194A0105239C588A2678EDC7476DF68B6C60F83E8DE47BA3477E17B3AD72D96F41FC1066089940F99ED6C0C8E9E77F322D986FDC4C718451E2CFBA51DCE13741C78AF81878EC6D4155741BFDD369A9DB4C9619E3753E0E80BD39A9B788481FB82ABA9A26FEF1B7619F9FC524B5D64DA2E3B23F8E8C0922754EB56A495DBD4F31B2DD3F9DC76A2EAB4D94F957F4E3776F423B85A8CDB343787AAFF00C95AFC297875DFF49EC9C886A5D550E1130A6CCC25E4A1C2D078C3B98586FFFD3C87EABC3FDC13A15AD4666
+
 Group = modp/ietf/1536
 Secret = 0x8D81343C4994DAF21AD0E6CB88C74F55529925EC953381470B72B3C8
 Msg = 7F0CCACA157707BF03
-Nonce = F0A0844B268ECEABA04827E7CE9F960119E0053CFBA00ADA47604857
+Nonce = 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000F0A0844B268ECEABA04827E7CE9F960119E0053CFBA00ADA47604857
 Ciphertext = 2EDE1A9F975FCAF943AEEB51EB37EAEDF54C4D939D0DCF7C80874A3BF8601B511685B1FDE52E07D8894EA647C50E480DE7A48ACADD89F79EEB9411234507CE6AB8503BD47B284134E301A78BD7FAC8D8B15A5D1424B820FF3FE1F363FC88FF510183165F52EE022A55EC43D4DD75763297C13F9EE3BCD579ADBA6800348F0C6240F49744B385737926A770EDF67257E7F5654C478C614700B6D2D671A13B28006C11C499BEB29658EF10C3E2EEC390A972372EBF733BA6EE5F4D600AAE1DDDC87EFA6D9FB05CBC995F82C3EF47CF862715E17DF7CC948846E849661D5C82C6A120610D90BB2D373D189A0BF13175F551326ECACF2D349A4BD2D265FDAC716E4B0A5D850E7EDA92CF9F8863BF1CD31C3888BFD81500DA4C615575EE8FA27615EF8E4B9D23A53852B236057E15DA7FC5827668A7B8AA699D3F79201567F4F0DAF7D89919906486A66ABA689FFD9E3BB5F0D1C677CCC12EA29BBFE1083C4FC349EE7E236BC8DC02DEE063E7F7C7B719E3176739D55196A2B7E6C3AA2A543135AB8F
 
 Group = modp/ietf/2048
 Secret = 0xA9F666E685F4F0BAFFF22C407B28461591CBF43F8DA1A8C3B1510BB6AA3BCD6C
 Msg = D830F02AA1AE9328CF3F2C6CB7D86875
-Nonce = DFA4E0979DADE5A620C4B9ED87C205F34D7AE739761BCDD060A9EC530E066538
+Nonce = 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000DFA4E0979DADE5A620C4B9ED87C205F34D7AE739761BCDD060A9EC530E066538
 Ciphertext = E8AC61EE6EA9DCBEDF5DD10247240E0FF3A6D1B1D2C9832A73C5EF2F96FB23C6FA571F9E407089ADAB459086B4331DBCBB3E5FC69B996748131D0D499EFF4F3654CEF8ED3C14C97C4985E5E0D6E0714E789F9D926CB26A23ACB52D6308CDB3C4DBF92F7A701513B133A0512A0CC16E13BCC7F983BC181C71A42252D48B113BAB4B861430AC6157E3043BD861C44D0804CCBB0B9D5BA599650DABE9FA7BF286EB08A97D11D5F88CB0157A4522E2C9F4EF53EB9D7679974C5AD86554EED49736D0D7B39461B92C73CBBEBAD8E92A6501293AE9A5BF0FBDA11BC743E032F78740F96F8CD71D30EA0F17F42181783C908A6008E339620CCB80226E9CDD7E5D50DEF9310DF03C971955CCF70557C9816049C2137CB7554998BD90B81AD549E9B65347E4BC798039BF05929DED052EE816EA3A87014B0D25E2E279B7736446201F52E542AA6E494BDC6D02A9A0479E1F90D5F3898A36AF7BA03E8F0BCBBF891A1C1B0B300EA664349E765EA331841ABC7963012C623318EF9B681711461ECC83EDC88722DE5E16FF1AB57B23F285CC5E75F6FCB46EEC9F919D1C089E7C045535E64A97F16662DF9CEFFB0E6C9C6402A43E47D1D073A5555A470E2451809234ABFD463A013D70288BA4A093E51FCED6A434886ED70490D63DFD809F27A773CDAC3D848A21C2937CA194C4FFBF8E50C05AEB3A530A7AB8B39B91A72EA45034A2FF8F16B1
 
 Group = modp/ietf/3072
 Secret = 0x981606068AE29B5B86E6F1E4E578010E43E1DBCB12504857CA6CDFC77913EFF0B3F563E1DDB40934B4F33099A6BF8EE8
 Msg = 0E738AF35B6AE8951E5C3BF8EB
-Nonce = F53B7EF9224D33392AE79CA3816755F066A2B15689B157FBA588CD5C247EFC9050DB2F84FA40C12E3493230D94D89306
+Nonce = 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000F53B7EF9224D33392AE79CA3816755F066A2B15689B157FBA588CD5C247EFC9050DB2F84FA40C12E3493230D94D89306
 Ciphertext = 659C8E28BF6A26E5D55386E437F2B66282EB9F9ECA54522D8A1FDE6BC6C4D65E5412D030BDC9833F93E3653B7B58FFD66A2EBFB8AAF1F7BBB52C3CD43E08DDB3D2C73E26EEA988EEF9CFDC9C59872B4D2454A1F500911B4D3BD3EED99107FAF39D97A3302166AD5B0381ECAB769953406DD3FEB502D23587D9CF2C89F93FE6A73167E3734CD0676EE95F7C43A558A56E7B0264A6084875D1E7F2312FA7BA7145AAA5921F904EDDC7A6EC823C57AFE323E4368CD7D47CAF2F8A94D6D3117A8BE92BAF6F0392A20C7FCFE381789755B7B47B9C5496382FF26533EA7F911472F02E2F9E29CAC9CFF4AEB90C36E55A1AF5D0259B195E2824C7F6B40299D8A0858E162B3D9392E323F62B48DA629089902F16D01D1AB3DCFBAAB46F1E74ECA6560B3A97E85E9B88B8F11AA83F78E8E542B8A3B4C0E7B47220594979BC7DD12E97238EB4B91D23A8F2D5362CB8B08C1F07B3461AD0968FB3053F60ECC2B3C0E900A0A7C2924C3FA79CCB43B33B336B807C6F4B83A7AE0112BD72A13822E3CD0B2E2AF7717F2CB21BE02D8DB0EB3BCCF66836BD83C828C221569EFCAA53124D206CB51D3718BC1511799DEA0558DD6FDBFB06B3D96BAC451FE71A4244BD3CD6826BF27EA3CC7782C17DCAF52EAA944CEA734D011145F10A4132A271349A8BF1ED0D7F7EF2ABC7031475B4397574F8A7EC4F5480D85CF0CA1F7C69097A2A009FFD4927AA769FD821F64741812FE5DB996ECAD3265CE93DBA7B40532A2133FB8EE5066A0C5F91C7E0F3902B6CEA39D5BB4B59B2993B5DAA2B61FF589BF45613D1EF36D5F7D959E8255C0010EC439AAE1C9B682BAC92C2883ED279CD8C644A301150879EB8D37B217B36447CBAC37C132C0278AA8CB38A8596392E3A3CAA91573370ED44DF46311EEE878B63F947F2A28930133D343737502623D0C7D3EA5D8D8123D7963C70AD30CC865BCD68F96C1A13A3484AB4EF3828CE338BF8E087F2300B777D556974D5E23FAFD55AB54353BCA31BEC13003AC7258510578F96B8F1E2254E91768A78CF9FCC6D8CFB0493701D523F75EC25B37B623B5A73A28009DBC169A084E95D
 
 Group = modp/ietf/4096
 Secret = 0xB73A80EB48DB4DF3108BE1345281A1B39B4373BFE71CB4DA9F3594A94C525E2E288F06089F61C1D29D6A99EA775C05D6
 Msg = D413DAC9D341361F17EDCE1C46A04D343424251B
-Nonce = B9AFD0F2F97C677BD3088B032696E7928DD62AD20912367113CFE5ABEEB7B4DFAD22E30442B04571CDC683D9971DE257
+Nonce = 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000B9AFD0F2F97C677BD3088B032696E7928DD62AD20912367113CFE5ABEEB7B4DFAD22E30442B04571CDC683D9971DE257
 Ciphertext = 085E76D450C7FF0B2DB59D41D12596AD1B0D8AF877F5C63416D2B355ED137A5AEAB3B75AC4CBFB5168F37EC02724EA057ED5B9AAF0C40D5469FB9E068C7E090C6EB411CDFBC9A500294E2433A9F879F52F8359B0865128A76801B7C4E22D5A3A6279F755291ECC9454AC3C1F1395DA5FA8E25CD951FCBF9B569EED304B3B82B0198913FAFD0B9A3ED32A64B0E394F96C153D25FBFEF92ECB38F79F2DE12570A041C8B4E8ADB998D6A559BC9640EBA8B61A6D0387CF0CA621B6C3F60D464DE7D27D5347F79CABD09533219DD2CDA8BAB74E886E206409A94054CCF3EBBA570C33FE456BD6B0BEB564F406AF49400550AE01A21A68126C90E0B8295CB7F9C2F4C790D8B0FEFD1FC6BFF40A00737AF9EDA25A1BF00E7FEC8CE776C3D24C61EBF48049CE5B27E024B796566BA670090BAB1A6015C01DB57DFDDAD61240F151C61BC80C3BA320050D1E537D501611627531E41793C3468B87F28BF2281CE996957901BE6CE41FAB0F88467ECBC0DE6C5F60AB5A1AF21A9528B0E8BABAD56FA23F2AD3CBC521A8D54047F15F58FC9C5CD4BB322A0838EDAC053415CFED87FD0756FBFF6B052D385C2EED6FD4686E024F7175A9840DF7E74740FF368DA4DAEB879D7C0D265D51809BD6EC6A66717498A4998D0232586CA4C5F7858EBEC824821CDBD1133DA557612A398EA8F9AC959A39381FCF1D727D08136CAFC4D72E9A945043E6DE2C67F6B55C21B7EDBFDCEA2B63CF9A5BB931DFE76CA2BE5D3D964AA2C348E6DFBA4FFC4D5E463105E243BD20AF38531A70BE1DD4930F998E28C3182665507700976BC14438452179747E623B2E5328A3ED5925FA526AE897ACF67059D76D159CB31D85F03589A4874AB11A7E2BB680FCEF7A4CEBFD98B0DC18BC1AF838524107E3264C2FDACF883ED2701CF3306E83CB8E75F5ED148F3377A77474D47522596F50DADEFC149A91C619F4A9366771681CAE1A82AA57BB038E0180BD38C4323928E63FA890B85009B1A25C022AEE8DB4D7F4E34260677A22B3BC7F24089E98FC484B93EC95ED68D9D56B2F6DDBCE73AB844F5CBBD908E51651517F6920DC42F41B874EEB9DA244C4485D2A931C7A76E99D490E6B3D4AE44484CAE4B784A0773782D2B9CFB4D893E79D35CF4282CB9A70EA53700F49F6F47F374161D0B820690D2C99E3A2602B31E659E64E5D4D4BD111C73FD5AF47412748091E272947A307309F3732E04FA848AACC312ADD0323F09F7947788D9F2BC55BDB7DDDD1FE664C5C9E861F6052F8F94084927116CAB24C6B11FEE69ADD2BCED4CC7EF330519D287531861A75E0F00CA8E52CBE9B77E8F840168937222D5851C84195DD4E698AB8BB558A05026EBC09520A1B1F0BC44F699478A69E1C1384F37F16102DE90ED960CEFFD9EA299FB79D416F3AF6CCD1A022895CFE032AC65978486998E3714A56E3DBAE
-