From b163059fff8918a2689affe85726ae498eaecb6a Mon Sep 17 00:00:00 2001 From: Chris Duncan Date: Fri, 30 Oct 2026 14:45:13 -0700 Subject: [PATCH] Fix name and make parameters consistent. --- src/assembly/crypto_verify.ts | 6 +++--- src/assembly/ed25519/ge.ts | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/assembly/crypto_verify.ts b/src/assembly/crypto_verify.ts index fd56161..717e2f1 100644 --- a/src/assembly/crypto_verify.ts +++ b/src/assembly/crypto_verify.ts @@ -3,7 +3,7 @@ import { BLOCKHASH_BYTELENGTH, KEY_BYTELENGTH } from './constants' import { Blake2b } from './ed25519/blake2b' -import { ge_accept_small_order, ge_double_scalarmult_vartime_to_p3, ge_frombytes, ge_frombytes_negate_vartime, ge_is_canonical, ge_cache_odd_multiples, ge_reject_small_order } from './ed25519/ge' +import { ge_accept_small_order, ge_double_scalarmult_vartime_to_p3, ge_frombytes, ge_frombytes_negate, ge_is_canonical, ge_cache_odd_multiples, ge_reject_small_order } from './ed25519/ge' import { p_cached, p3, p3_sub_p3, p3_tobytes } from './ed25519/p' import { sc_is_canonical, sc_reduce } from './ed25519/sc' import { clear_t, t_fe_0, t_fe_1, t_fe_2, t_fe_3, t_fe_4, t_fe_5, t_fe_6 } from './ed25519/t' @@ -39,7 +39,7 @@ const t_u8x32 = new StaticArray(32) * @returns null if public key fails to decode, else return pointer to A */ export function crypto_verify_decodepubkey (pub: StaticArray): StaticArray | null { - const b = ge_frombytes_negate_vartime(A, pub, t_u8x32, t_fe_0, t_fe_1, t_fe_2) + const b = ge_frombytes_negate(A, pub, t_fe_0, t_fe_1, t_fe_2, t_u8x32) clear_t() if (b != 0) return null ge_cache_odd_multiples(Ai, A, t_p3, t_fe_0) @@ -158,7 +158,7 @@ export function verify_pubkey (pub: StaticArray): boolean { } // fail if public key cannot be decoded - if (ge_frombytes_negate_vartime(A, pub, t_u8x32, t_fe_0, t_fe_1, t_fe_2) != 0) { + if (ge_frombytes_negate(A, pub, t_fe_0, t_fe_1, t_fe_2, t_u8x32) != 0) { clear_t() return false } diff --git a/src/assembly/ed25519/ge.ts b/src/assembly/ed25519/ge.ts index 663eef1..8a02417 100644 --- a/src/assembly/ed25519/ge.ts +++ b/src/assembly/ed25519/ge.ts @@ -146,8 +146,8 @@ export function ge_frombytes (h: p3, s: StaticArray, * * @returns {i32} 0 if `s` decodes to a valid point, else -1 */ -export function ge_frombytes_negate_vartime (h: p3, s: StaticArray, - t_u8x32: StaticArray, t_fe_0: FieldElement, t_fe_1: FieldElement, t_fe_2: FieldElement +export function ge_frombytes_negate (h: p3, s: StaticArray, + t_fe_0: FieldElement, t_fe_1: FieldElement, t_fe_2: FieldElement, t_u8x32: StaticArray ): i32 { const check = ge_frombytes(h, s, t_fe_0, t_fe_1, t_fe_2, t_u8x32) fe_neg(h.X, h.X) -- 2.52.0