/** @var string $msgKeypair */
$msgKeypair = ParagonIE_Sodium_Compat::
crypto_box_keypair_from_secretkey_and_publickey( ParagonIE_Sodium_Compat::
crypto_box_secretkey($ephKeypair),
$publicKey );
/** @var string $ephemeralPK */
$ephemeralPK = ParagonIE_Sodium_Compat::
crypto_box_publickey($ephKeypair);
/** @var string $nonce */
$nonce = ParagonIE_Sodium_Compat::
crypto_generichash( $ephemeralPK .
$publicKey,
'',
24
);
/** @var int $firstWrite */
$firstWrite =
fwrite( $ofp,
$ephemeralPK,
ParagonIE_Sodium_Compat::CRYPTO_BOX_PUBLICKEYBYTES
);