Skip to content

Commit 16238c7

Browse files
authored
Prover functions for split. (#2607)
1 parent 6639f00 commit 16238c7

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

std/machines/split/split_bb.asm

+6-3
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,12 @@ machine SplitBB(byte_compare: ByteCompare) with
2121
// understand step 3 to figure out that the byte decomposition is unique.
2222
let select_byte: fe, int -> fe = |input, byte| std::convert::fe((std::convert::int(input) >> (byte * 8)) & 0xff);
2323
col witness bytes;
24-
query |i| {
25-
std::prover::provide_value(bytes, i, select_byte(std::prover::eval(in_acc'), (i + 1) % 4));
26-
};
24+
query |i| std::prover::compute_from(
25+
bytes,
26+
i,
27+
[in_acc'],
28+
|in_acc_next| select_byte(in_acc_next[0], (i + 1) % 4)
29+
);
2730
// Puts the bytes together to form the input
2831
col witness in_acc;
2932
// Factors to multiply the bytes by

std/machines/split/split_bn254.asm

+6-3
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,12 @@ machine SplitBN254(byte_compare: ByteCompare) with
2121
// understand step 3 to figure out that the byte decomposition is unique.
2222
let select_byte: fe, int -> fe = |input, byte| std::convert::fe((std::convert::int(input) >> (byte * 8)) & 0xff);
2323
col witness bytes;
24-
query |i| {
25-
std::prover::provide_value(bytes, i, select_byte(std::prover::eval(in_acc'), (i + 1) % 32));
26-
};
24+
query |i| std::prover::compute_from(
25+
bytes,
26+
i,
27+
[in_acc'],
28+
|in_acc_next| select_byte(in_acc_next[0], (i + 1) % 32)
29+
);
2730
// Puts the bytes together to form the input
2831
col witness in_acc;
2932
// Factors to multiply the bytes by

0 commit comments

Comments
 (0)