Skip to content

Conversation

@danielailie
Copy link
Contributor

@danielailie danielailie commented Feb 3, 2025

  • update userVerifier.verify method to be a promise
  • update pubkeyDecryptor methods to be promises

@danielailie danielailie self-assigned this Feb 3, 2025
andreibancioiu
andreibancioiu previously approved these changes Feb 3, 2025
* @returns true if the signature is valid, false otherwise
*/
verify(data: Buffer | Uint8Array, signature: Buffer | Uint8Array): boolean {
async verify(data: Buffer | Uint8Array, signature: Buffer | Uint8Array): Promise<boolean> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor breaking change, we should document (not forget about) it.

}

verifyMessageSignature(message: Message): boolean {
async verifyMessageSignature(message: Message, account: IAccount): Promise<boolean> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In account, we have verifyTransaction and verifyMessage. Here, we also have the suffix signature. Keep it or drop it? (either way should be fine, but we must also reflect this in the specs).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I kind of like having signature in the name, but if we decide to drop it, it's fine

const ciphertext = Buffer.from(data.ciphertext, 'hex');
const edhPubKey = Buffer.from(data.identities.ephemeralPubKey, 'hex');
const originatorPubKeyBuffer = Buffer.from(data.identities.originatorPubKey, 'hex');
static async decrypt(data: X25519EncryptedData, decryptorSecretKey: UserSecretKey): Promise<Buffer> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor breaking change. Let's mention it in the PR description, as well, so that we don't forget to document it in the release notes.

mradian1
mradian1 previously approved these changes Feb 3, 2025
@danielailie danielailie dismissed stale reviews from mradian1 and andreibancioiu via 4f315d6 February 3, 2025 13:45
@danielailie danielailie merged commit 69438d1 into feat/next Feb 4, 2025
4 checks passed
@danielailie danielailie deleted the TOOL-460-add-verify-message-and-verify-signature branch February 4, 2025 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants