Skip to content
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
wip
  • Loading branch information
alexandre-abrioux committed Apr 12, 2025
commit e7f8dff8625b398ba30c4b8aa3cfb4dfa09151d9
4 changes: 2 additions & 2 deletions packages/utils/src/crypto/ec-utils-legacy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ const deriveSharedKeyWithSha512 = (
publicKey: PublicKey,
padded = false,
): Uint8Array => {
const sharedPoint = secp256k1.getSharedSecret(privateKey.secret, publicKey.toBytes()).subarray(1);
const paddedBytes = padded ? sharedPoint.subarray(16, 64) : sharedPoint;
const sharedPoint = secp256k1.getSharedSecret(privateKey.secret, publicKey.toBytes());
const paddedBytes = padded ? sharedPoint.slice(1) : sharedPoint.slice(16, 64);
return new Uint8Array(sha512.create().update(paddedBytes).digest());
};

Expand Down