Check that FIELD_ELEMENTS_PER_BLOB is defined. (#225)
This commit is contained in:
parent
0b6791bbce
commit
6d75c674ab
|
@ -36,6 +36,19 @@ extern "C" {
|
|||
// Macros
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef FIELD_ELEMENTS_PER_BLOB
|
||||
#error FIELD_ELEMENTS_PER_BLOB is undefined. This value must be externally supplied.
|
||||
#endif // FIELD_ELEMENTS_PER_BLOB
|
||||
/**
|
||||
* There are only 1<<32 2-adic roots of unity in the field, limiting the
|
||||
* possible values of FIELD_ELEMENTS_PER_BLOB. The restriction to 1<<31 is a
|
||||
* current implementation limitation. Notably, the size of the FFT setup would
|
||||
* overflow uint32_t, which would casues issues.
|
||||
*/
|
||||
#if ((FIELD_ELEMENTS_PER_BLOB) <= 0) || ((FIELD_ELEMENTS_PER_BLOB) > (1 << 31))
|
||||
#error Invalid value of FIELD_ELEMENTS_PER_BLOB
|
||||
#endif // FIELD_ELEMENTS_PER_BLOB
|
||||
|
||||
#define BYTES_PER_COMMITMENT 48
|
||||
#define BYTES_PER_PROOF 48
|
||||
#define BYTES_PER_FIELD_ELEMENT 32
|
||||
|
|
Loading…
Reference in New Issue