Generate Bulletproofs(+) generators at compile time

Creates a new monero-generators crate so the monero crate can run the 
code in question at build time.

Saves several seconds from running the tests.

Closes https://github.com/serai-dex/serai/issues/101.
This commit is contained in:
Luke Parker
2022-08-21 06:36:53 -04:00
parent 577fe99a08
commit 603a3f8c9f
19 changed files with 274 additions and 133 deletions

View File

@@ -57,12 +57,7 @@ fn bulletproofs_vector() {
}
macro_rules! bulletproofs_tests {
($init: ident, $name: ident, $max: ident, $plus: literal) => {
#[test]
fn $init() {
Bulletproofs::init($plus);
}
($name: ident, $max: ident, $plus: literal) => {
#[test]
fn $name() {
// Create Bulletproofs for all possible output quantities
@@ -93,5 +88,5 @@ macro_rules! bulletproofs_tests {
};
}
bulletproofs_tests!(bulletproofs_init, bulletproofs, bulletproofs_max, false);
bulletproofs_tests!(bulletproofs_plus_init, bulletproofs_plus, bulletproofs_plus_max, true);
bulletproofs_tests!(bulletproofs, bulletproofs_max, false);
bulletproofs_tests!(bulletproofs_plus, bulletproofs_plus_max, true);