/** @var string $nonceHash */
$nonceHash =
hash_final($hs, true
);
/** @var string $pk */
$pk = self::
substr($secretKey, 32, 32
);
/** @var string $nonce */
$nonce = ParagonIE_Sodium_Core_Ed25519::
sc_reduce($nonceHash) . self::
substr($nonceHash, 32
);
/** @var string $sig */
$sig = ParagonIE_Sodium_Core_Ed25519::
ge_p3_tobytes( ParagonIE_Sodium_Core_Ed25519::
ge_scalarmult_base($nonce) );
$hs =
hash_init('sha512'
);
self::
hash_update($hs, self::
substr($sig, 0, 32
));
self::
hash_update($hs, self::
substr($pk, 0, 32
));
/** @var resource $hs */
$hs = self::
updateHashWithFile($hs,
$fp,
$size);
/** @var string $hramHash */
$hramHash =
hash_final($hs, true
);