]> git.codecow.com Git - nano25519.git/commitdiff
Expand to signed int to return -1 as libsodium instead of 255.
authorChris Duncan <chris@zoso.dev>
Sun, 16 Aug 2026 07:09:49 +0000 (00:09 -0700)
committerChris Duncan <chris@zoso.dev>
Sun, 16 Aug 2026 07:09:49 +0000 (00:09 -0700)
src/assembly/ge.ts

index 439f7289a770afb17c305aabd8275faa7664b0dd..1be4e3784bfa899ac49a86e98b7e8980a4c86c36 100644 (file)
@@ -143,7 +143,7 @@ export function ge_frombytes (h: ge_p3, s: StaticArray<u8>): i32 {
        fe_cmov(h.X, negx, fe_isnegative(h.X) ^ (s[31] >> 7))
        fe_mul(h.T, h.X, h.Y)
 
-       return (has_m_root | has_p_root) - 1
+       return i32(has_m_root | has_p_root) - 1
 }
 
 const ge_has_small_order_y_sqrtm1: FieldElement = fe()