1--TEST-- 2openssl_pkey_derive() X25519 3--EXTENSIONS-- 4openssl 5--SKIPIF-- 6<?php if (!defined("OPENSSL_KEYTYPE_X25519")) print "skip"; ?> 7--FILE-- 8<?php 9 10$priv = openssl_pkey_get_private("-----BEGIN PRIVATE KEY----- 11MC4CAQAwBQYDK2VuBCIEIEhxWrgdpbkAlbNgjSjuqodVy4w/SJzmxlsOlUdXUm5r 12-----END PRIVATE KEY----- 13"); 14 15$pub = openssl_pkey_get_public("-----BEGIN PUBLIC KEY----- 16MCowBQYDK2VuAyEAaKrFGJv6L6JrVmkxhtU5+xrPZU2MHNQJcsGZY71WhX8= 17-----END PUBLIC KEY----- 18"); 19 20echo bin2hex(openssl_pkey_derive($pub, $priv)); 21echo "\n"; 22?> 23--EXPECT-- 2476feeefed1d6bc01f3406d87759db371893ec6dc2cb912a130b33c3c91abcb21 25