Viewing File: /opt/alt/tests/alt-php82-pecl-zmq_1.1.3-1.84f0720.el8/tests/054-curvekeypair.phpt
--TEST--
Test curve keypair
--SKIPIF--
<?php
require_once(dirname(__FILE__) . '/skipif.inc');
if (!in_array ('curvekeypair', get_class_methods ('zmq')))
die ('skip curvekeypair not found in libzmq');
?>
--FILE--
<?php
function test_z85_decode_encode($input) {
$decoded = zmq::z85decode($input);
$encoded = zmq::z85encode($decoded);
if ($input !== $encoded) {
echo "E: test_z85_decode_encode: input=[$input] encoded=[$encoded] decoded=[$decoded]" . PHP_EOL;
}
}
$keypair = ZMQ::curveKeypair();
test_z85_decode_encode($keypair['public_key']);
test_z85_decode_encode($keypair['secret_key']);
echo "OK";
--EXPECT--
OK
Back to Directory
File Manager
<