From: Chris Duncan Date: Fri, 28 Aug 2026 00:21:40 +0000 (-0700) Subject: Fix relaxed verify. X-Git-Url: https://git.codecow.com/?a=commitdiff_plain;h=959574bc0f64865a76839d5f6d8af417a9982390;p=nano25519.git Fix relaxed verify. --- diff --git a/src/assembly/crypto_verify.ts b/src/assembly/crypto_verify.ts index df797a3..d19caf8 100644 --- a/src/assembly/crypto_verify.ts +++ b/src/assembly/crypto_verify.ts @@ -54,9 +54,6 @@ export function crypto_verify_relaxed (s: StaticArray, M: StaticArray, p memory.copy(changetype(S), changetype(s) + 32, 32) - if (ge_frombytes(expected_r, s) != 0) return -1 - if (ge_has_small_order(expected_r) != 0) return -1 - // signature is nonce point R and scalar S (R || S) // data to hash is nonce point R, public key A, and message M // from parameter arguments: R = s[0,32], A = pk, M = m @@ -74,8 +71,7 @@ export function crypto_verify_relaxed (s: StaticArray, M: StaticArray, p * Verify signature `s` was made by signing message `M` using public key `pub`. * * Unlike `crypto_verify_relaxed`, this function is intended for single-use - * verifications and thus can compute and set `A` by calling - * `crypto_verify_pubkey` itself. + * verifications and thus can compute and set `A` itself. * @returns -1 if signature fails to verify, else return 0 if signature is good */ export function crypto_verify_strict (s: StaticArray, M: StaticArray, mlen: i32, pub: StaticArray): i32 { @@ -109,5 +105,5 @@ export function crypto_verify_strict (s: StaticArray, M: StaticArray, ml return ge_has_small_order(check) - 1 // if (ge_has_small_order(check) == 0) return -1 - // return equalbytes(s, check_r) - 1 + // return equalbytes(s, check) - 1 }