/** @var string $az */
$az =
hash('sha512', self::
substr($secretKey, 0, 32
), true
);
$az[0
] = self::
intToChr(self::
chrToInt($az[0
]) & 248
);
$az[31
] = self::
intToChr((self::
chrToInt($az[31
]) & 63
) | 64
);
$hs =
hash_init('sha512'
);
self::
hash_update($hs, self::
substr($az, 32, 32
));
/** @var resource $hs */
$hs = self::
updateHashWithFile($hs,
$fp,
$size);
/** @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 */