Skip to content

Commit

Permalink
Fix STAN
Browse files Browse the repository at this point in the history
  • Loading branch information
Spomky authored Feb 13, 2024
1 parent 82dc65f commit e734c30
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Library/Signature/Algorithm/EdDSA.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,15 @@ public function name(): string

private static function getPublicKey(JWK $key): string
{
$d = $key->get('d');
assert(is_string($d), 'Unsupported key type');

switch ($key->get('crv')) {
case 'Ed25519':
return Ed25519::publickey_from_secretkey($key->get('d'));
return Ed25519::publickey_from_secretkey($d);
case 'X25519':
if (extension_loaded('sodium')) {
return sodium_crypto_scalarmult_base($key->get('d'));
return sodium_crypto_scalarmult_base($d);
}
// no break
default:
Expand Down

0 comments on commit e734c30

Please sign in to comment.