# crypto_hash_sha512_update(&hs, m, mlen);
# crypto_hash_sha512_final(&hs, hram);
$hs =
hash_init('sha512'
);
self::
hash_update($hs, self::
substr($sig, 0, 32
));
self::
hash_update($hs, self::
substr($pk, 0, 32
));
self::
hash_update($hs,
$message);
$hramHash =
hash_final($hs, true
);
# sc_reduce(hram);
# sc_muladd(sig + 32, hram, az, nonce);
$hram = self::
sc_reduce($hramHash);
$sigAfter = self::
sc_muladd($hram,
$az,
$nonce);
$sig = self::
substr($sig, 0, 32
) . self::
substr($sigAfter, 0, 32
);
try { ParagonIE_Sodium_Compat::
memzero($az);
} catch (SodiumException
$ex) { $az = null;
} return $sig;
} /**
* @internal You should not use this directly from another application
*
* @param string $sig
* @param string $message
* @param string $pk
* @return bool
* @throws SodiumException
* @throws TypeError
*/