Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
b2f522a
Squashed commit of the following:
mizabrik Mar 19, 2025
2d8ee58
Squashed commit of the following:
mizabrik Mar 19, 2025
c707404
WIP
mizabrik Mar 19, 2025
0d083b6
WIP: sat check passes
mizabrik Mar 19, 2025
986c69e
Done?
mizabrik Mar 19, 2025
b0f5c8d
Fixup
mizabrik Mar 19, 2025
1922c35
rw lower constraint degree
AntoineCyr Mar 20, 2025
9f6332a
fixup! Done?
mizabrik Mar 20, 2025
6e722eb
rw small field circuit fix
AntoineCyr Mar 6, 2025
29abfbe
fix missing include in expression.hpp
ioxid Mar 11, 2025
c647b4b
add PROFILING_ENABLED flag
ioxid Mar 19, 2025
b59d2c6
nix: fix parallel_crypto3_tests config name
ioxid Mar 14, 2025
2a31b9c
fix envrc
ioxid Mar 19, 2025
37023f6
cmake add config for x86_64-v3
ioxid Mar 16, 2025
c0c9dc8
dag_expression: avoid allocating nodes on stack
ioxid Mar 16, 2025
8e3d055
count arithmetic ops
ioxid Mar 11, 2025
cf3e20b
scoped profiler improvements
ioxid Mar 11, 2025
0ac3fda
WIP benchmarking
ioxid Mar 20, 2025
b3c25f1
generate circuits
ioxid Mar 20, 2025
ac1d068
fix gates_argument
ioxid Mar 20, 2025
bd12134
Fix constrains
ioxid Mar 20, 2025
e36f3d9
Add zkevm_wide benchmarks
ioxid Mar 20, 2025
26dddfe
Fix lookup build value map degree
ioxid Mar 20, 2025
41832d3
multiprecision: big_uint: implement three way comparison
ioxid Mar 14, 2025
dc81941
polynomial_dfs: comparator using <=>
ioxid Mar 14, 2025
2a62563
element_fp: implement <=>
ioxid Mar 16, 2025
692ac3c
implement gate argument speed-up trough packing values
ioxid Mar 13, 2025
45f9c96
fixup! implement gate argument speed-up trough packing values
ioxid Mar 21, 2025
45db9df
Add babybear wide test
ioxid Mar 21, 2025
c9175a1
do not waste time on copy constrains if there they are absent
ioxid Mar 21, 2025
6dc241a
Added locality to expression cache via toposorting.
Iluvmagick Mar 18, 2025
7f8e18e
Grouped expressions into batches in lookup argument.
Iluvmagick Mar 20, 2025
8c16bbe
all rows lookups
ayashunsky Mar 21, 2025
79f0e21
remove high degree
ioxid Mar 21, 2025
3c12865
Add other circuits
ioxid Mar 21, 2025
651c0e4
Use sched_getaffinity in threadpool
ioxid Mar 21, 2025
60065f4
dag: store operands indeces in small_vector to avoid allocations
ioxid Mar 24, 2025
72a05f3
fix single-thread compilation on clang
ioxid Mar 26, 2025
c7766cc
add all .nix files to watch_file in envrc
ioxid Mar 26, 2025
cd359ef
simplify operator<=> implementations (also fixes compilation on gcc)
ioxid Mar 26, 2025
50ec8da
fix big_uint_manual tests
ioxid Mar 26, 2025
d9dcedc
fix circuit_builder includes
ioxid Mar 26, 2025
c94eb18
revert parts with benchmarking small fields on small rw circuit using…
ioxid Mar 26, 2025
d670360
revert benchmarking test changes
ioxid Mar 26, 2025
8f12644
refactor minimal_math benchmarks
ioxid Mar 26, 2025
a82ca37
add develop-clang-profiling and develop-clang-release derivations
ioxid Mar 27, 2025
f1aac76
profiling improvements, add fft info
ioxid Mar 27, 2025
1739190
Stop multiplying with all rows selector in lookup argument.
Mar 27, 2025
2c3eba9
make tests configurable through env variables
ioxid Mar 27, 2025
9307252
more profiling improvements
ioxid Mar 27, 2025
d02dae0
Stop copying results when evaluating a DAG expression.
Mar 28, 2025
09ea11a
Added dfs cache to lookup/gate argument.
Iluvmagick Mar 28, 2025
37743dc
Various bugfixes.
Iluvmagick Mar 28, 2025
8f0a816
Additional bugfixes.
Iluvmagick Mar 28, 2025
71ed264
Fixed bad hash function in dag expression.
Iluvmagick Mar 29, 2025
d388734
Fixed verification tests in nix (for real this time).
Iluvmagick Mar 31, 2025
0b40d4d
Copy lookups lower degree
ETatuzova Mar 31, 2025
5b8cb67
Lookup sat check fixed
ETatuzova Mar 31, 2025
2e2af0a
Fixed dfs cache variable access crash.
Iluvmagick Mar 31, 2025
9399dcc
Keccak circuit multiple repetitions
ETatuzova Mar 31, 2025
40e4414
Never multiply by the all rows selector.
martun Mar 31, 2025
abf94c7
Fixed the dfs_cache special selectors again, added tests to nix.
Iluvmagick Mar 31, 2025
d80d1ea
Non-parallel FRI dfs cache integration.
Iluvmagick Mar 31, 2025
b333a0d
RW circuit constraints fixed
ETatuzova Mar 31, 2025
aefd0b8
parallel dfs cache
ioxid Mar 31, 2025
3db643f
revert precommit dfs cache because it slows down FRI
ioxid Mar 31, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
watch_file proof-producer.nix parallel-crypto3.nix crypto3.nix verify-proofs.nix debug-tools.nix
use flake ${PLACEHOLDER_DEVELOP_DERIVATION:-.}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -647,3 +647,5 @@ callgrind.*

# direnv outputs
.direnv

crypto3/libs/blueprint/test/zkevm_bbf/data/alchemy/sp1_block/
15 changes: 15 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,21 @@ if(${SANITIZE})
add_link_options(-fsanitize=undefined,address,leak)
endif()

option(ARITHMETIC_COUNTERS "Build with arithmetic counters" FALSE)
if (${ARITHMETIC_COUNTERS})
add_compile_definitions(NIL_CO3_MP_ENABLE_ARITHMETIC_COUNTERS NIL_CO3_PROFILE_COUNT_ARITHMETIC_OPS)
endif()

option(PROFILING_ENABLED "Build with profiling enabled" FALSE)
if (${PROFILING_ENABLED})
add_compile_definitions(PROFILING_ENABLED)
endif()

option(USE_X86_64_V3 "Build with x86-64-v3 microarchitecture level" FALSE)
if (${USE_X86_64_V3})
add_compile_options(-march=x86-64-v3)
endif()

# Add dummy target for the more efficient reusing of precompiled headers
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/generated-dummy.cpp)
add_library(crypto3_precompiled_headers STATIC ${CMAKE_CURRENT_BINARY_DIR}/generated-dummy.cpp)
Expand Down
6 changes: 3 additions & 3 deletions crypto3/benchmarks/zk/lpc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ void lpc_test_case(std::size_t steps)

std::map<std::size_t, typename lpc_scheme_type::commitment_type> commitments;
{
PROFILE_SCOPE("polynomial commitment");
PROFILE_SCOPE("Polynomial commitment");
lpc_scheme_prover.append_to_batch(0, poly);
commitments[0] = lpc_scheme_prover.commit(0);
}
Expand All @@ -159,15 +159,15 @@ void lpc_test_case(std::size_t steps)
typename lpc_scheme_type::proof_type proof;
std::array<std::uint8_t, 96> x_data{};
{
PROFILE_SCOPE("proof generation");
PROFILE_SCOPE("Proof generation");
lpc_scheme_prover.append_eval_point(0,
algebra::fields::arithmetic_params<FieldType>::multiplicative_generator);
zk::transcript::fiat_shamir_heuristic_sequential<transcript_hash_type> transcript(x_data);
proof = lpc_scheme_prover.proof_eval(transcript);
}

{
PROFILE_SCOPE("verification");
PROFILE_SCOPE("Verification");
zk::transcript::fiat_shamir_heuristic_sequential<transcript_hash_type> transcript_verifier(x_data);
lpc_scheme_verifier.set_batch_size(0, proof.z.get_batch_size(0));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ namespace nil::crypto3::algebra::fields {
constexpr static integral_type multiplicative_generator = 31u;
constexpr static integral_type root_of_unity = 0x1a427a41u;
};

template<>
struct arithmetic_params<babybear_montgomery_big_mod> : public arithmetic_params<babybear> {};

template<>
struct arithmetic_params<babybear_simple_31_bit> : public arithmetic_params<babybear> {};
} // namespace nil::crypto3::algebra::fields

#endif // CRYPTO3_ALGEBRA_FIELDS_BABYBEAR_ARITHMETIC_PARAMS_HPP
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,18 @@ namespace nil::crypto3::algebra::fields {
using modular_type = nil::crypto3::multiprecision::auto_big_mod<modulus>;
using value_type = detail::element_fp<params<babybear>>;
};

class babybear_montgomery_big_mod : public babybear {
public:
using modular_type = nil::crypto3::multiprecision::montgomery_big_mod<modulus>;
using value_type = detail::element_fp<params<babybear_montgomery_big_mod>>;
};

class babybear_simple_31_bit : public babybear {
public:
using modular_type = nil::crypto3::multiprecision::big_mod_impl<nil::crypto3::multiprecision::detail::modular_ops_storage_ct<multiprecision::babybear_modulus, nil::crypto3::multiprecision::detail::simple_31_bit_modular_ops>>;
using value_type = detail::element_fp<params<babybear_simple_31_bit>>;
};
} // namespace nil::crypto3::algebra::fields

#endif // CRYPTO3_ALGEBRA_FIELDS_BABYBEAR_HPP
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,12 @@ namespace nil {
return *this == one();
}

constexpr bool operator==(const element_fp &B) const {
return data == B.data;
constexpr auto operator<=>(const element_fp &B) const {
return data.base() <=> B.data.base();
}

constexpr bool operator!=(const element_fp &B) const {
return data != B.data;
constexpr bool operator==(const element_fp &B) const {
return data == B.data;
}

constexpr element_fp &operator=(const element_fp &B) {
Expand Down Expand Up @@ -153,22 +153,6 @@ namespace nil {
return element_fp(data * B.data);
}

constexpr bool operator<(const element_fp &B) const {
return data.base() < B.data.base();
}

constexpr bool operator>(const element_fp &B) const {
return data.base() > B.data.base();
}

constexpr bool operator<=(const element_fp &B) const {
return data.base() <= B.data.base();
}

constexpr bool operator>=(const element_fp &B) const {
return data.base() >= B.data.base();
}

constexpr element_fp &operator++() {
data += one().data;
return *this;
Expand Down
Loading
Loading