7 # If this variable is set, engine would be loaded via configuration
8 # file. Otherwise - via command line
15 my $engine=$ENV{'ENGINE_NAME'}||"gost";
17 # Reopen STDERR to eliminate extra output
18 open STDERR, ">>","tests.err";
23 open $F,">","test.cnf";
24 if (defined($use_config) && $use_config) {
26 open $F,">","test.cnf";
28 openssl_conf = openssl_def
34 default_algorithms = ALL
38 $eng_param = "-engine $engine"
41 $ENV{'OPENSSL_CONF'}=abs_path('test.cnf');
43 subtest 'keys' => sub {
45 my @keys=(['gost2001','A',"-----BEGIN PRIVATE KEY-----
46 MEUCAQAwHAYGKoUDAgITMBIGByqFAwICIwEGByqFAwICHgEEIgIgRhUDJ1WQASIf
47 nx+aUM2eagzV9dCt6mQ5wdtenr2ZS/Y=
48 -----END PRIVATE KEY-----
49 ","Private key: 46150327559001221F9F1F9A50CD9E6A0CD5F5D0ADEA6439C1DB5E9EBD994BF6
51 X:789094AF6386A43AF191210FFED0AEA5D1D9750D8FF8BCD1B584BFAA966850E4
52 Y:25ED63EE42624403D08FC60E5F8130F121ECDC5E297D9E3C7B106C906E0855E9
53 Parameter set: id-GostR3410-2001-CryptoPro-A-ParamSet
54 ","-----BEGIN PUBLIC KEY-----
55 MGMwHAYGKoUDAgITMBIGByqFAwICIwEGByqFAwICHgEDQwAEQORQaJaqv4S10bz4
56 jw112dGlrtD+DyGR8TqkhmOvlJB46VUIbpBsEHs8nn0pXtzsIfEwgV8Oxo/QA0Ri
58 -----END PUBLIC KEY-----
60 ['gost2001','B'=>'-----BEGIN PRIVATE KEY-----
61 MEUCAQAwHAYGKoUDAgITMBIGByqFAwICIwIGByqFAwICHgEEIgIgImwnCcqcfuXK
62 MVYg+UWQhiXYKz1yQ8kDSB7Ly515XH4=
63 -----END PRIVATE KEY-----
64 ','Private key: 226C2709CA9C7EE5CA315620F945908625D82B3D7243C903481ECBCB9D795C7E
66 X:59C15439385CBE790274D6537D318A35B27413D265FFDC5FBE5354DF8C7AC591
67 Y:11B771AC016AA817542184D05F2C7DDD0F9A5A5C9F840A79B5B7A73658F3048A
68 Parameter set: id-GostR3410-2001-CryptoPro-B-ParamSet
69 ','-----BEGIN PUBLIC KEY-----
70 MGMwHAYGKoUDAgITMBIGByqFAwICIwIGByqFAwICHgEDQwAEQJHFeozfVFO+X9z/
71 ZdITdLI1ijF9U9Z0Anm+XDg5VMFZigTzWDant7V5CoSfXFqaD919LF/QhCFUF6hq
73 -----END PUBLIC KEY-----
75 ['gost2001','C'=>'-----BEGIN PRIVATE KEY-----
76 MEUCAQAwHAYGKoUDAgITMBIGByqFAwICIwMGByqFAwICHgEEIgIgKKUJVY2xlp24
77 mky1F9inWeq3mm0J/uza6HsDvspgSzY=
78 -----END PRIVATE KEY-----
79 ','Private key: 28A509558DB1969DB89A4CB517D8A759EAB79A6D09FEECDAE87B03BECA604B36
81 X:58154320380CCFD2A101D2B7844516984023CF5A38610C4F98220E017270B2D4
82 Y:14C6977A6E9C0412DF5B53E69CD48DAF2B5805F55F6ACBEB4E01BA7B2BF84FC8
83 Parameter set: id-GostR3410-2001-CryptoPro-C-ParamSet
84 ','-----BEGIN PUBLIC KEY-----
85 MGMwHAYGKoUDAgITMBIGByqFAwICIwMGByqFAwICHgEDQwAEQNSycHIBDiKYTwxh
86 OFrPI0CYFkWEt9IBodLPDDggQxVYyE/4K3u6AU7ry2pf9QVYK6+N1JzmU1vfEgSc
88 -----END PUBLIC KEY-----
90 ['gost2001','XA'=>,'-----BEGIN PRIVATE KEY-----
91 MEUCAQAwHAYGKoUDAgITMBIGByqFAwICJAAGByqFAwICHgEEIgIgOFuMMveKUx/C
92 BOSjl9XCepDCHWHv/1bcjdKexKGJkZw=
93 -----END PRIVATE KEY-----
94 ','Private key: 385B8C32F78A531FC204E4A397D5C27A90C21D61EFFF56DC8DD29EC4A189919C
96 X:FA969CB29310E897978A1C9245107B46499D5C14A3975BF8E10EF5F613BE4EC6
97 Y:17FCFACCB0F838AE730E8B4021E880937824214DFF5365A61576AC5E72F92E35
98 Parameter set: id-GostR3410-2001-CryptoPro-XchA-ParamSet
99 ','-----BEGIN PUBLIC KEY-----
100 MGMwHAYGKoUDAgITMBIGByqFAwICJAAGByqFAwICHgEDQwAEQMZOvhP29Q7h+FuX
101 oxRcnUlGexBFkhyKl5foEJOynJb6NS75cl6sdhWmZVP/TSEkeJOA6CFAiw5zrjj4
103 -----END PUBLIC KEY-----
105 ['gost2001','XB'=>,'-----BEGIN PRIVATE KEY-----
106 MEUCAQAwHAYGKoUDAgITMBIGByqFAwICJAEGByqFAwICHgEEIgIgE7WWqiYWoKLs
107 7ezZ8L8Q9JcT73Jf5NYfFnlnoKRIQGg=
108 -----END PRIVATE KEY-----
109 ','Private key: 13B596AA2616A0A2ECEDECD9F0BF10F49713EF725FE4D61F167967A0A4484068
111 X:1D33A01774E501EFADD6C7A936728AF644749E98FEF5AE77A25E185955ED2E14
112 Y:FAD2D8101A99EDE8FBDF118B70A9894F4E6DE962B68D27E39B057624A51727
113 Parameter set: id-GostR3410-2001-CryptoPro-XchB-ParamSet
114 ','-----BEGIN PUBLIC KEY-----
115 MGMwHAYGKoUDAgITMBIGByqFAwICJAEGByqFAwICHgEDQwAEQBQu7VVZGF6id671
116 /piedET2inI2qcfWre8B5XQXoDMdJxelJHYFm+MnjbZi6W1OT4mpcIsR3/vo7Zka
118 -----END PUBLIC KEY-----
121 for my $keyinfo (@keys) {
122 my ($alg,$paramset,$seckey,$sectext,$pubtext,$pubkey) = @$keyinfo;
123 open $F,">",'tmp.pem';
126 #1. Прочитать секретный ключ и напечатать публичный и секретный ключи
127 is(`openssl pkey -noout -text -in tmp.pem`,$sectext . $pubtext,
128 "Print key pair $alg:$paramset");
129 #2. Прочитать секретный ключ и вывести публичный (все алгоритмы)
130 is(`openssl pkey -pubout -in tmp.pem`,$pubkey,
131 "Compute public key $alg:$paramset");
132 open $F,">","tmp.pem";
135 #3. Прочитать публичный и напечать его в виде текста
136 is(`openssl pkey -pubin -noout -in tmp.pem -text`,$pubtext,
137 "Read and print public key $alg:$paramset");
142 #4. Сгенерировать ключ два раза (для всех алгоритов и параметров).
143 # Проверить что получились числа требуемой длины и они не совпадают
146 #5. Проверить эталонную подпись
148 #6. Выработать подпись и проверить её
150 #7. Выработать подпись, поменять в ней один бит и убедиться что она
151 # перестала проверяться
153 # 8. Выработать подпись, поменять 1 бит в подписываемых данных и
154 # убедитсья, что подпись перестала быть корректной.
156 # 9. Выработать shared ключ по vko
157 # Generate a shared key by vko
158 subtest 'derive' => sub {
160 'id-GostR3410-2001-TestParamSet'=>
161 ['-----BEGIN PRIVATE KEY-----
162 MEMCAQAwHAYGKoUDAgITMBIGByqFAwICIwAGByqFAwICHgEEIIOQ6j9mU+bDGvvpzF6ImLRUztRmxlftkGliGuICxnkT
163 -----END PRIVATE KEY-----',
164 'e49ff6ce142a54da577de28c69140b8eaca21bbf97a3584b2a071b974ab62dd2',
165 '-----BEGIN PRIVATE KEY-----
166 MEMCAQAwHAYGKoUDAgITMBIGByqFAwICIwAGByqFAwICHgEEIA1EpaGE8PGO0erx6m4V+FYPbBSecBH8Fd4QUKvvfVdY
167 -----END PRIVATE KEY-----',
168 '13ff71a7787cf321d04e54fee29714008d81a1c972c871f374803ab96639d901',
169 'dc0e3c93b7c4e9186cf9d83ae23a8f080a7916e2d54a43e583e95795a486eaa6'],
170 'id-GostR3410-2001-CryptoPro-A-ParamSet'=>
171 ['-----BEGIN PRIVATE KEY-----
172 MEMCAQAwHAYGKoUDAgITMBIGByqFAwICIwEGByqFAwICHgEEIABLD+ZfhzArC3nsOaCGkMZSPrMMbsATYnWq1udDphdu
173 -----END PRIVATE KEY-----',
174 '8f3aad4a05ecf47377eff12293c993e353bc218cfb0f9af0c407bcf044454950',
175 '-----BEGIN PRIVATE KEY-----
176 MEMCAQAwHAYGKoUDAgITMBIGByqFAwICIwEGByqFAwICHgEEIMu2SqK9cBcaJNkHSKBUt7i8rr2JqbHVTeC6jsg4ir3c
177 -----END PRIVATE KEY-----',
178 'bcc1049e775dcaed60b00da185cd93dcc6fa705a14ed2add9f5af00d71e37f95',
179 'defbbd083692895d5c5c6a87e066b30964e5b527f56cf965a390096ba4bc9afb'],
180 'id-GostR3410-2001-CryptoPro-B-ParamSet'=>
181 ['-----BEGIN PRIVATE KEY-----
182 MEMCAQAwHAYGKoUDAgITMBIGByqFAwICIwIGByqFAwICHgEEIBTbapnHBIZDIjpvGGiwIP9qR4LrRjGHPlfa8w8GWWJ3
183 -----END PRIVATE KEY-----',
184 'c0306a860d36f0948dff7ae3b6b721a254f350f078a32062c5345365558e35e0',
185 '-----BEGIN PRIVATE KEY-----
186 MEMCAQAwHAYGKoUDAgITMBIGByqFAwICIwIGByqFAwICHgEEIC7D7cd3lNC00Q/yXLRtOhpPmBs71/twdNvDVXGnZdMP
187 -----END PRIVATE KEY-----',
188 'f5cb24ceb3433fc580ffc8058336dc6254477fb24df178427423540db18dd1b5',
189 '521cc034b603c21e26a3e47e38b56880bdd986089d14d6ffce4fbcad2d0f20bb'],
190 'id-GostR3410-2001-CryptoPro-C-ParamSet'=>
191 ['-----BEGIN PRIVATE KEY-----
192 MEMCAQAwHAYGKoUDAgITMBIGByqFAwICIwMGByqFAwICHgEEIDUY0Tplswjvx42N9rmzUgl3owlFeCTJuuhixPsGFCUR
193 -----END PRIVATE KEY-----',
194 'e882207141dc1a714002907d610ae5a7ba79a9c0c84bef13491038181f37d0f2',
195 '-----BEGIN PRIVATE KEY-----
196 MEMCAQAwHAYGKoUDAgITMBIGByqFAwICIwMGByqFAwICHgEEIGfgpqWECv1OpuZ3L4q4ZgpmGTS08NwPWgCIo61OalMg
197 -----END PRIVATE KEY-----',
198 '7f11fe4075a198c3afca5b4364afdc1cd45325cfa999a5b84fd510f90c3527c3',
199 'd61f1f55a1ad012884b969dbe2550f38f2356a029e5d8af07d50d10ca9812c58'],
200 'id-GostR3410-2001-CryptoPro-XchA-ParamSet'=>
201 ['-----BEGIN PRIVATE KEY-----
202 MEMCAQAwHAYGKoUDAgITMBIGByqFAwICJAAGByqFAwICHgEEIJ9zd4rb9MMqu4HnAEkd9+IrwUNSjUje4ljQVY4THYjC
203 -----END PRIVATE KEY-----',
204 '947ba3299cdb129386808638514bc4a21262123cd7e47ade7579e51439c70dac',
205 '-----BEGIN PRIVATE KEY-----
206 MEMCAQAwHAYGKoUDAgITMBIGByqFAwICJAAGByqFAwICHgEEIGwx1zcUdvsAyOr0jF+JR15DPN0hSTvy7f9ybA5OyiKN
207 -----END PRIVATE KEY-----',
208 '2cb9078a00f955aaa398d10c021dae9e954573c5d9f4d3190c4bce887731ea11',
209 'f4fb7e0f533a59cc40f17131f620be821e528f9cec2915b9f813159dc0e3a29e'],
210 'id-GostR3410-2001-CryptoPro-XchB-ParamSet'=>
211 ['-----BEGIN PRIVATE KEY-----
212 MEMCAQAwHAYGKoUDAgITMBIGByqFAwICJAEGByqFAwICHgEEIIqSv5Q/By1VtTk1U+1+A1WMMQ25Q2Ml5hkAmYlUBqxi
213 -----END PRIVATE KEY-----',
214 '44f89a85bbf256836f77e765f6ee0222d8ffd1f8f85e5197b06931178aa081ca',
215 '-----BEGIN PRIVATE KEY-----
216 MEMCAQAwHAYGKoUDAgITMBIGByqFAwICJAEGByqFAwICHgEEIO+jfUUFM0d2WPxQF8gY4KcqCJk02tca3aYovZh1eowt
217 -----END PRIVATE KEY-----',
218 'be866445486068067f0e479b83dde1b1b9a07fc8bc8fa5f5c60d15a39e3f3562',
219 'e8d30d98363b8b889464f4664c6a0403723484923e2db89039603c7ae294c504'],
220 'id-tc26-gost-3410-2012-256-paramSetA'=>
221 ['-----BEGIN PRIVATE KEY-----
222 MD4CAQAwFwYIKoUDBwEBAQEwCwYJKoUDBwECAQEBBCD5+u2ebYwQ9iDYWHmif4XeGgj2OijJuq4YsbTNoH3+Bw==
223 -----END PRIVATE KEY-----',
224 'a04b252bedc05f69fc92d8e985b52f0f984bccf3ef9f980ac7aca85f5ef11987',
225 '-----BEGIN PRIVATE KEY-----
226 MD4CAQAwFwYIKoUDBwEBAQEwCwYJKoUDBwECAQEBBCDVwXdvq1zdBBmzVjG1WOBQR/dkwCzF6KSIiVkfQVCsKg==
227 -----END PRIVATE KEY-----',
228 'c019d8939e12740a328625cea86efa3b39170412772b3c110536410bdd58a854',
229 'e9f7c57547fa0cd3c9942c62f9c74a553626d5f9810975a476825cd6f22a4e86',
230 '-----BEGIN PUBLIC KEY-----
231 MF4wFwYIKoUDBwEBAQEwCwYJKoUDBwECAQEBA0MABEB3WS+MEcXnrMCdavPRgF28U5PDlV1atDh1ADUFxoB/f80OjqQ0T7cGQtk/2nWCGDX7uUrBGA8dql8Bnw9Sgn5+
232 -----END PUBLIC KEY-----'],
233 'id-tc26-gost-3410-2012-256-paramSetB'=>
234 ['-----BEGIN PRIVATE KEY-----
235 MD4CAQAwFwYIKoUDBwEBAQEwCwYJKoUDBwECAQECBCDQ6G51VK2+96rvFyG/dRqWOFNJA33jQajAnzra585aIA==
236 -----END PRIVATE KEY-----',
237 'a13a84314a8d571b5218ca26194fe2f38b5f43eb3ac94203c448f9940df2fdb2',
238 '-----BEGIN PRIVATE KEY-----
239 MD4CAQAwFwYIKoUDBwEBAQEwCwYJKoUDBwECAQECBCCvvOUfoyljV0zfUrfEj1nOgBbelamj+eXgl0qxDJjDDA==
240 -----END PRIVATE KEY-----',
241 '6f7c5716c08fca79725beb4afaf2a48fd2fa547536d267f2b869b6ced5fddfa4',
242 'c9b2ad43f1aa70185f94dbc207ab4a147002f8aac5cf2fcec9d771a36f5f7a91'],
243 'id-tc26-gost-3410-2012-256-paramSetC'=>
244 ['-----BEGIN PRIVATE KEY-----
245 MD4CAQAwFwYIKoUDBwEBAQEwCwYJKoUDBwECAQEDBCDq9XGURfLDPrDiMNPUcunrvUwI46FBO2EU+ok8a1DANw==
246 -----END PRIVATE KEY-----',
247 'c352cf32ce4fd12a294ac62f3e44808cc7b21178093ba454b447a9ab4395d9be',
248 '-----BEGIN PRIVATE KEY-----
249 MD4CAQAwFwYIKoUDBwEBAQEwCwYJKoUDBwECAQEDBCAWm69+rfnGTDZ24MR29IcjMsuPhjBQT6zxPvUYQBrGLg==
250 -----END PRIVATE KEY-----',
251 '27e3afdcb9f191b0465ae7d28245cee6ca44d537a7c67d938933cf2012ec71a6',
252 '43c9f321b3659ee5108f0bcd5527f403d445f486c9e492768f46a82359ee0385'],
253 'id-tc26-gost-3410-2012-256-paramSetD'=>
254 ['-----BEGIN PRIVATE KEY-----
255 MD4CAQAwFwYIKoUDBwEBAQEwCwYJKoUDBwECAQEEBCBnmzl1MutYiAXBmZa3GW5sK6Kznpt6V5i+xAl36RDhXQ==
256 -----END PRIVATE KEY-----',
257 'ebfb18e801fe2d41462c52571b1805e34993910b29f75a7a5517d3190b5d9d1d',
258 '-----BEGIN PRIVATE KEY-----
259 MD4CAQAwFwYIKoUDBwEBAQEwCwYJKoUDBwECAQEEBCBpp7anU1gMcaK/BzAQzAbUHXW2kuh6h9t67i67eIfAgQ==
260 -----END PRIVATE KEY-----',
261 '902a174ace21dc8ecf94e6a7e84cde115f902484e2c37d1d2652b1ef0a402dfc',
262 '3af2a69e68cd444acc269e75edb90dfe01b8f3d9f97fe7c8b36841df9a2771a1'],
263 'id-tc26-gost-3410-2012-512-paramSetA'=>
264 ['-----BEGIN PRIVATE KEY-----
265 MGgCAQAwIQYIKoUDBwEBAQIwFQYJKoUDBwECAQIBBggqhQMHAQECAwRAVbz5k/8Zj8XbTEtlv9bK9i8FaIbm+NN9kCp2wCbiaw6AXvdBiQlMj7hSGv7AdW928VRszq9Elwc63VQcYzdnkw==
266 -----END PRIVATE KEY-----',
267 '8bb6886e74a3d04ec0cbbe799f2494fd577f3bd9b8c06d7ec4cfa7c597d2d0ae',
268 '-----BEGIN PRIVATE KEY-----
269 MGgCAQAwIQYIKoUDBwEBAQIwFQYJKoUDBwECAQIBBggqhQMHAQECAwRASeoodGB639ETkSEfOLTFkTozKEpMVAlFPgvK6fOlD9u1/ITUXBoERea2R+HG3YNi81wTMqT0Njq9WnbQvgIx6g==
270 -----END PRIVATE KEY-----',
271 'e88ba18821e6a86787cb225ea9b731821efb9e07bdcfb7b0b8f78c70d4e88c2b',
272 '4d032ae84928991a48d83fc462da4d21173d8e832a3b30df71a6974f66e377a8'],
273 'id-tc26-gost-3410-2012-512-paramSetB'=>
274 ['-----BEGIN PRIVATE KEY-----
275 MGgCAQAwIQYIKoUDBwEBAQIwFQYJKoUDBwECAQICBggqhQMHAQECAwRAvQKu1fl21NUXvdWlYtRs3Bs4ZW9vQlV1rf1D1rfRUdxjuC2A3xdD9RoUupzK6EeNFkhTMbZ+euQTXwPFN6ykbA==
276 -----END PRIVATE KEY-----',
277 '6c9f8cb350dcea5e673fe29950d9e5a041b005ca81d1236d19ba658dcbfdce01',
278 '-----BEGIN PRIVATE KEY-----
279 MGgCAQAwIQYIKoUDBwEBAQIwFQYJKoUDBwECAQICBggqhQMHAQECAwRA+I8I9E0Fz0cKG21QHn7VluHB9j348leFmeXLfGUS+jLqllemtCObR7KLW3bkzH+EiqXbLNMm+JLsmeGv4/nvYQ==
280 -----END PRIVATE KEY-----',
281 'f7071ed951ac98570a5f9d299bf5a61d3dcb8082e8733b1571164ce6b54b2d8f',
282 'f37881bf843ecee4f0935c4f7653d4cb48b8db6a50394f89792dad899765d7d9'],
283 'id-tc26-gost-3410-2012-512-paramSetC'=>
284 ['-----BEGIN PRIVATE KEY-----
285 MF4CAQAwFwYIKoUDBwEBAQIwCwYJKoUDBwECAQIDBEA79FKW7MqF4pQJJvpAhKd9YkwsFXBzcaUhYt3N1KuJV6n5aJ4+kaJfuT3YbhtwWWzNIsIdXUZRaBEGO2cEwysa
286 -----END PRIVATE KEY-----',
287 'fa92c3898642b419b320b15a8285d6d01ae3a22cadc791b9ba52d12919e7008d',
288 '-----BEGIN PRIVATE KEY-----
289 MF4CAQAwFwYIKoUDBwEBAQIwCwYJKoUDBwECAQIDBEAiCNNQAMnur4EG8eSDpr5WjJaoHquSsK3wydCrGM3Cdbaa0kiuj5m0Mx16Vow7AwvG2DvlKJL8HgwuBqWlDaYa
290 -----END PRIVATE KEY-----',
291 '6e1db0da8832660fbf761119e41d356a1599686a157c9a598b8e18b56cb09791',
292 '2df0dfa8d437689d41fad965f13ea28ce27c29dd84514b376ea6ad9f0c7e3ece',
293 '-----BEGIN PUBLIC KEY-----
294 MIGgMBcGCCqFAwcBAQECMAsGCSqFAwcBAgECAwOBhAAEgYCPdAER26Ym73DSUXBamTLJcntdV3oZ7RRx/+Ijf13GnF36o36i8tEC13uJqOOmujEkAGPtui6yE4iJNVU0uM6yHmIEM5H0c81Sd/VQD8yXW1hyGAZvTMc+U/6oa30YU9YY7+t759d1CIVznPmq9C+VbAApyDCMFjuYnKD/nChsGA==
295 -----END PUBLIC KEY-----']
298 while(my($id, $v) = each %derives) {
299 my ($alice,$alicehash,$bob,$bobhash,$secrethash,$malice) = @$v;
301 open $F,">",'alice.prv';
304 system("openssl pkey -in alice.prv -out alice.pub.der -pubout -outform DER");
305 like(`openssl dgst -sha256 -r alice.pub.der`, qr/^$alicehash/, "Compute public key:$id:Alice");
307 open $F,">",'bob.prv';
310 system("openssl pkey -in bob.prv -out bob.pub.der -pubout -outform DER");
311 like(`openssl dgst -sha256 -r bob.pub.der`, qr/^$bobhash/, "Compute public key:$id:Bob");
313 system("openssl pkeyutl -derive -inkey alice.prv -keyform PEM -peerkey bob.pub.der -peerform DER -pkeyopt ukmhex:0100000000000000 -out secret_a.bin");
314 like(`openssl dgst -sha256 -r secret_a.bin`, qr/^$secrethash/, "Compute shared key:$id:Alice");
316 system("openssl pkeyutl -derive -inkey bob.prv -keyform PEM -peerkey alice.pub.der -peerform DER -pkeyopt ukmhex:0100000000000000 -out secret_b.bin");
317 like(`openssl dgst -sha256 -r secret_b.bin`, qr/^$secrethash/, "Compute shared key:$id:Bob");
318 if (defined $malice && $malice ne "") {
319 # Malice: negative test -- this PEM is in the small subgroup
320 open $F,">",'malice.pub';
323 # NB system should return true on failure, so this is a negative test
324 ok(system("openssl pkeyutl -derive -inkey bob.prv -keyform PEM -peerkey malice.pub -peerform PEM -pkeyopt ukmhex:0100000000000000 -out secret_m.bin"), "Compute shared key:$id:Malice");
328 unlink "alice.pub.der";
330 unlink "bob.pub.der";
331 unlink "secret_a.bin";
332 unlink "secret_b.bin";
334 unlink "secret_m.bin";
337 # 10. Разобрать стандартый encrypted key
339 # 11. Сгенерирвоать encrypted key и его разобрать.