mirror of
https://github.com/logos-storage/plonky2.git
synced 2026-01-09 17:23:08 +00:00
fixes
This commit is contained in:
parent
f1ad3da8eb
commit
b62bc35d64
@ -4,6 +4,11 @@
|
||||
// Compares two bignums of the same given length. Assumes that len > 0.
|
||||
// Returns 1 if a > b, 0 if a == b, and -1 (that is, 2^256 - 1) if a < b.
|
||||
global cmp_bignum:
|
||||
// stack: len, a_start_loc, b_start_loc, retdest
|
||||
DUP1
|
||||
// stack: len, len, a_start_loc, b_start_loc, retdest
|
||||
ISZERO
|
||||
%jumpi(equal)
|
||||
// stack: len, a_start_loc, b_start_loc, retdest
|
||||
SWAP1
|
||||
// stack: a_start_loc, len, b_start_loc, retdest
|
||||
|
||||
@ -171,7 +171,9 @@ fn test_add_bignum(a: BigUint, b: BigUint, expected_output: BigUint) -> Result<(
|
||||
if carry_limb > 0.into() {
|
||||
new_memory[len] = carry_limb;
|
||||
}
|
||||
let output = mem_vec_to_biguint(&new_memory[a_start_loc..a_start_loc + len]);
|
||||
|
||||
let expected_output = biguint_to_mem_vec(expected_output);
|
||||
let output = &new_memory[a_start_loc..a_start_loc + expected_output.len()];
|
||||
assert_eq!(output, expected_output);
|
||||
|
||||
Ok(())
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user