Skip to content

Commit

Permalink
update libsimplicity to 121b2951d8cca3d73dccd6fcbe721f2195025067
Browse files Browse the repository at this point in the history
  • Loading branch information
apoelstra committed Aug 8, 2024
1 parent e42b267 commit 3570b00
Show file tree
Hide file tree
Showing 44 changed files with 6,311 additions and 6,303 deletions.
2 changes: 1 addition & 1 deletion simplicity-sys/depend/simplicity-HEAD-revision.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# This file has been automatically generated.
714b44dafd66ab5d164c9247a0f793c320272162
121b2951d8cca3d73dccd6fcbe721f2195025067
14 changes: 7 additions & 7 deletions simplicity-sys/depend/simplicity/bitstream.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
* Precondition: NULL != stream
*/
simplicity_err closeBitstream(bitstream* stream) {
simplicity_err simplicity_closeBitstream(bitstream* stream) {
if (1 < stream->len) return SIMPLICITY_ERR_BITSTREAM_TRAILING_BYTES; /* If there is more than one byte remaining. */
if (1 == stream->len) {
if (0 == stream->offset) return SIMPLICITY_ERR_BITSTREAM_TRAILING_BYTES; /* If there is one byte remaining */
Expand All @@ -30,7 +30,7 @@ simplicity_err closeBitstream(bitstream* stream) {
* Precondition: 0 <= n < 32
* NULL != stream
*/
int32_t readNBits(int n, bitstream* stream) {
int32_t simplicity_readNBits(int n, bitstream* stream) {
simplicity_assert(0 <= n && n < 32);

uint32_t result = 0;
Expand Down Expand Up @@ -109,7 +109,7 @@ static int32_t decodeUpto3Bits(int32_t* result, bitstream* stream) {
} else {
int32_t n = decodeUpto3(stream);
if (0 <= n) {
*result = readNBits(n, stream);
*result = simplicity_readNBits(n, stream);
if (*result < 0) return *result;
}
return n;
Expand Down Expand Up @@ -153,7 +153,7 @@ static int32_t decodeUpto15Bits(int32_t* result, bitstream* stream) {
} else {
int32_t n = decodeUpto15(stream);
if (0 <= n) {
*result = readNBits(n, stream);
*result = simplicity_readNBits(n, stream);
if (*result < 0) return *result;
}
return n;
Expand Down Expand Up @@ -184,7 +184,7 @@ static int32_t decodeUpto65535(bitstream* stream) {
*
* Precondition: NULL != stream
*/
int32_t decodeUptoMaxInt(bitstream* stream) {
int32_t simplicity_decodeUptoMaxInt(bitstream* stream) {
int32_t bit = read1Bit(stream);
if (bit < 0) return bit;
if (0 == bit) {
Expand All @@ -194,7 +194,7 @@ int32_t decodeUptoMaxInt(bitstream* stream) {
if (n < 0) return n;
if (30 < n) return SIMPLICITY_ERR_DATA_OUT_OF_RANGE;
{
int32_t result = readNBits(n, stream);
int32_t result = simplicity_readNBits(n, stream);
if (result < 0) return result;
return ((1 << n) | result);
}
Expand All @@ -211,7 +211,7 @@ int32_t decodeUptoMaxInt(bitstream* stream) {
* n <= 2^31
* NULL != stream
*/
simplicity_err readBitstring(bitstring* result, size_t n, bitstream* stream) {
simplicity_err simplicity_readBitstring(bitstring* result, size_t n, bitstream* stream) {
static_assert(0x80000000u + 2*(CHAR_BIT - 1) <= SIZE_MAX, "size_t needs to be at least 32-bits");
simplicity_assert(n <= 0x80000000u);
size_t total_offset = n + stream->offset;
Expand Down
10 changes: 5 additions & 5 deletions simplicity-sys/depend/simplicity/bitstream.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ static inline bitstream initializeBitstream(const unsigned char* arr, size_t len
*
* Precondition: NULL != stream
*/
simplicity_err closeBitstream(bitstream* stream);
simplicity_err simplicity_closeBitstream(bitstream* stream);

/* Fetches up to 31 bits from 'stream' as the 'n' least significant bits of return value.
* The 'n' bits are set from the MSB to the LSB.
Expand All @@ -45,15 +45,15 @@ simplicity_err closeBitstream(bitstream* stream);
* Precondition: 0 <= n < 32
* NULL != stream
*/
int32_t readNBits(int n, bitstream* stream);
int32_t simplicity_readNBits(int n, bitstream* stream);

/* Returns one bit from 'stream', 0 or 1.
* Returns 'SIMPLICITY_ERR_BITSTREAM_EOF' if no bits are available.
*
* Precondition: NULL != stream
*/
static inline int32_t read1Bit(bitstream* stream) {
return readNBits(1, stream);
return simplicity_readNBits(1, stream);
}

/* Decode an encoded number between 1 and 2^31 - 1 inclusive.
Expand All @@ -64,7 +64,7 @@ static inline int32_t read1Bit(bitstream* stream) {
*
* Precondition: NULL != stream
*/
int32_t decodeUptoMaxInt(bitstream* stream);
int32_t simplicity_decodeUptoMaxInt(bitstream* stream);

/* Fills a 'bitstring' containing 'n' bits from 'stream'.
* Returns 'SIMPLICITY_ERR_BITSTREAM_EOF' if not enough bits are available.
Expand All @@ -76,5 +76,5 @@ int32_t decodeUptoMaxInt(bitstream* stream);
* n <= 2^31
* NULL != stream
*/
simplicity_err readBitstring(bitstring* result, size_t n, bitstream* stream);
simplicity_err simplicity_readBitstring(bitstring* result, size_t n, bitstream* stream);
#endif
8 changes: 4 additions & 4 deletions simplicity-sys/depend/simplicity/cmr.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ bool simplicity_computeCmr( simplicity_err* error, unsigned char* cmr

bitstream stream = initializeBitstream(program, program_len);
dag_node* dag = NULL;
int32_t dag_len = decodeMallocDag(&dag, NULL, &stream);
int_fast32_t dag_len = simplicity_decodeMallocDag(&dag, NULL, &stream);
if (dag_len <= 0) {
simplicity_assert(dag_len < 0);
*error = dag_len;
*error = (simplicity_err)dag_len;
} else {
simplicity_assert(NULL != dag);
simplicity_assert((size_t)dag_len <= DAG_LEN_MAX);
*error = closeBitstream(&stream);
simplicity_assert((uint_fast32_t)dag_len <= DAG_LEN_MAX);
*error = simplicity_closeBitstream(&stream);
sha256_fromMidstate(cmr, dag[dag_len-1].cmr.s);
}

Expand Down
91 changes: 46 additions & 45 deletions simplicity-sys/depend/simplicity/dag.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ static sha256_midstate mkJetCMR(uint32_t *imr, uint_fast64_t weight) {
block[6] = (uint32_t)(weight >> 32);
block[7] = (uint32_t)weight;
memcpy(&block[8], imr, sizeof(uint32_t[8]));
sha256_compression(result.s, block);
simplicity_sha256_compression(result.s, block);

return result;
}
Expand All @@ -97,7 +97,7 @@ static sha256_midstate mkJetCMR(uint32_t *imr, uint_fast64_t weight) {
*
* Precondition: 2^n == value->len
*/
sha256_midstate computeWordCMR(const bitstring* value, size_t n) {
sha256_midstate simplicity_computeWordCMR(const bitstring* value, size_t n) {
/* 'stack' is an array of 30 hashes consisting of 8 'uint32_t's each. */
uint32_t stack[8*30] = {0};
uint32_t *stack_ptr = stack;
Expand Down Expand Up @@ -128,7 +128,7 @@ sha256_midstate computeWordCMR(const bitstring* value, size_t n) {
for (size_t j = i; j & 1; j = j >> 1) {
sha256_midstate pair = cmrIV(PAIR);
stack_ptr -= 8;
sha256_compression(pair.s, stack_ptr);
simplicity_sha256_compression(pair.s, stack_ptr);
memcpy(stack_ptr, pair.s, sizeof(uint32_t[8]));
}
}
Expand All @@ -137,10 +137,10 @@ sha256_midstate computeWordCMR(const bitstring* value, size_t n) {
simplicity_assert(stack_ptr == stack + 8);

/* Pass 2: Compute the IMR for the expression by adding the type roots of ONE and TWO^(2^n) to the CMR. */
sha256_compression(imr.s, stack);
simplicity_sha256_compression(imr.s, stack);
memcpy(&stack[0], word_type_root[0].s, sizeof(uint32_t[8]));
memcpy(&stack[8], word_type_root[n+1].s, sizeof(uint32_t[8]));
sha256_compression(imr.s, stack);
simplicity_sha256_compression(imr.s, stack);

/* Pass 3: Compute the jet's CMR from the specificion's IMR. */
return mkJetCMR(imr.s, ((uint_fast64_t)1 << n));
Expand All @@ -156,7 +156,7 @@ sha256_midstate computeWordCMR(const bitstring* value, size_t n) {
* Precondition: dag_node dag[i + 1] and 'dag' is well-formed.
* dag[i].'tag' \notin {HIDDEN, JET, WORD}
*/
void computeCommitmentMerkleRoot(dag_node* dag, const size_t i) {
void simplicity_computeCommitmentMerkleRoot(dag_node* dag, const uint_fast32_t i) {
uint32_t block[16] = {0};
size_t j = 8;

Expand All @@ -182,7 +182,7 @@ void computeCommitmentMerkleRoot(dag_node* dag, const size_t i) {
case TAKE:
case DROP:
memcpy(block + j, dag[dag[i].child[0]].cmr.s, sizeof(uint32_t[8]));
sha256_compression(dag[i].cmr.s, block);
simplicity_sha256_compression(dag[i].cmr.s, block);
case IDEN:
case UNIT:
case WITNESS:
Expand All @@ -200,7 +200,7 @@ void computeCommitmentMerkleRoot(dag_node* dag, const size_t i) {
* Precondition: sha256_midstate imr[len];
* dag_node dag[len] and 'dag' is well-typed with 'type_dag' and contains witnesses.
*/
static void computeIdentityMerkleRoot(sha256_midstate* imr, const dag_node* dag, const type* type_dag, const size_t len) {
static void computeIdentityMerkleRoot(sha256_midstate* imr, const dag_node* dag, const type* type_dag, const uint_fast32_t len) {
/* Pass 1 */
for (size_t i = 0; i < len; ++i) {
uint32_t block[16] = {0};
Expand All @@ -213,9 +213,9 @@ static void computeIdentityMerkleRoot(sha256_midstate* imr, const dag_node* dag,
: imrIV(dag[i].tag);
switch (dag[i].tag) {
case WITNESS:
sha256_bitstring(block, &dag[i].compactValue);
simplicity_sha256_bitstring(block, &dag[i].compactValue);
memcpy(block + 8, type_dag[WITNESS_B(dag, type_dag, i)].typeMerkleRoot.s, sizeof(uint32_t[8]));
sha256_compression(imr[i].s, block);
simplicity_sha256_compression(imr[i].s, block);
break;
case COMP:
case ASSERTL:
Expand All @@ -231,7 +231,7 @@ static void computeIdentityMerkleRoot(sha256_midstate* imr, const dag_node* dag,
case TAKE:
case DROP:
memcpy(block + j, imr[dag[i].child[0]].s, sizeof(uint32_t[8]));
sha256_compression(imr[i].s, block);
simplicity_sha256_compression(imr[i].s, block);
case IDEN:
case UNIT:
case HIDDEN:
Expand All @@ -248,14 +248,14 @@ static void computeIdentityMerkleRoot(sha256_midstate* imr, const dag_node* dag,
if (HIDDEN == dag[i].tag) {
memcpy(block + 8, imr[i].s, sizeof(uint32_t[8]));
imr[i] = hiddenIV;
sha256_compression(imr[i].s, block);
simplicity_sha256_compression(imr[i].s, block);
} else {
memcpy(block + 8, imr[i].s, sizeof(uint32_t[8]));
imr[i] = identityIV;
sha256_compression(imr[i].s, block);
simplicity_sha256_compression(imr[i].s, block);
memcpy(block, type_dag[dag[i].sourceType].typeMerkleRoot.s, sizeof(uint32_t[8]));
memcpy(block + 8, type_dag[dag[i].targetType].typeMerkleRoot.s, sizeof(uint32_t[8]));
sha256_compression(imr[i].s, block);
simplicity_sha256_compression(imr[i].s, block);
}
}
}
Expand All @@ -271,8 +271,8 @@ static void computeIdentityMerkleRoot(sha256_midstate* imr, const dag_node* dag,
* dag_node dag[len] and 'dag' has witness data and is well-typed with 'type_dag'.
* Postconditon: analyses analysis[len] contains the annotated Merkle roots of each subexpressions of 'dag'.
*/
void computeAnnotatedMerkleRoot(analyses* analysis, const dag_node* dag, const type* type_dag, const size_t len) {
for (size_t i = 0; i < len; ++i) {
void simplicity_computeAnnotatedMerkleRoot(analyses* analysis, const dag_node* dag, const type* type_dag, const uint_fast32_t len) {
for (uint_fast32_t i = 0; i < len; ++i) {
uint32_t block[16] = {0};

/* For jets, their annotated Merkle root is the same as their commitment Merkle root. */
Expand All @@ -287,77 +287,77 @@ void computeAnnotatedMerkleRoot(analyses* analysis, const dag_node* dag, const t
memcpy(block, type_dag[CASE_A(dag, type_dag, i)].typeMerkleRoot.s, sizeof(uint32_t[8]));
memcpy(block + 8,
type_dag[CASE_B(dag, type_dag, i)].typeMerkleRoot.s, sizeof(uint32_t[8]));
sha256_compression(analysis[i].annotatedMerkleRoot.s, block);
simplicity_sha256_compression(analysis[i].annotatedMerkleRoot.s, block);
memcpy(block, type_dag[CASE_C(dag, type_dag, i)].typeMerkleRoot.s, sizeof(uint32_t[8]));
memcpy(block + 8, type_dag[CASE_D(dag, type_dag, i)].typeMerkleRoot.s, sizeof(uint32_t[8]));
sha256_compression(analysis[i].annotatedMerkleRoot.s, block);
simplicity_sha256_compression(analysis[i].annotatedMerkleRoot.s, block);
memcpy(block, analysis[dag[i].child[0]].annotatedMerkleRoot.s, sizeof(uint32_t[8]));
memcpy(block + 8, analysis[dag[i].child[1]].annotatedMerkleRoot.s, sizeof(uint32_t[8]));
sha256_compression(analysis[i].annotatedMerkleRoot.s, block);
simplicity_sha256_compression(analysis[i].annotatedMerkleRoot.s, block);
break;
case DISCONNECT:
memcpy(block, type_dag[DISCONNECT_A(dag, type_dag, i)].typeMerkleRoot.s, sizeof(uint32_t[8]));
memcpy(block + 8, type_dag[DISCONNECT_B(dag, type_dag, i)].typeMerkleRoot.s, sizeof(uint32_t[8]));
sha256_compression(analysis[i].annotatedMerkleRoot.s, block);
simplicity_sha256_compression(analysis[i].annotatedMerkleRoot.s, block);
memcpy(block, type_dag[DISCONNECT_C(dag, type_dag, i)].typeMerkleRoot.s, sizeof(uint32_t[8]));
memcpy(block + 8, type_dag[DISCONNECT_D(dag, type_dag, i)].typeMerkleRoot.s, sizeof(uint32_t[8]));
sha256_compression(analysis[i].annotatedMerkleRoot.s, block);
simplicity_sha256_compression(analysis[i].annotatedMerkleRoot.s, block);
memcpy(block, analysis[dag[i].child[0]].annotatedMerkleRoot.s, sizeof(uint32_t[8]));
memcpy(block + 8, analysis[dag[i].child[1]].annotatedMerkleRoot.s, sizeof(uint32_t[8]));
sha256_compression(analysis[i].annotatedMerkleRoot.s, block);
simplicity_sha256_compression(analysis[i].annotatedMerkleRoot.s, block);
break;
case COMP:
memcpy(block + 8, type_dag[COMP_A(dag, type_dag, i)].typeMerkleRoot.s, sizeof(uint32_t[8]));
sha256_compression(analysis[i].annotatedMerkleRoot.s, block);
simplicity_sha256_compression(analysis[i].annotatedMerkleRoot.s, block);
memcpy(block, type_dag[COMP_B(dag, type_dag, i)].typeMerkleRoot.s, sizeof(uint32_t[8]));
memcpy(block + 8, type_dag[COMP_C(dag, type_dag, i)].typeMerkleRoot.s, sizeof(uint32_t[8]));
sha256_compression(analysis[i].annotatedMerkleRoot.s, block);
simplicity_sha256_compression(analysis[i].annotatedMerkleRoot.s, block);
memcpy(block, analysis[dag[i].child[0]].annotatedMerkleRoot.s, sizeof(uint32_t[8]));
memcpy(block + 8, analysis[dag[i].child[1]].annotatedMerkleRoot.s, sizeof(uint32_t[8]));
sha256_compression(analysis[i].annotatedMerkleRoot.s, block);
simplicity_sha256_compression(analysis[i].annotatedMerkleRoot.s, block);
break;
case PAIR:
memcpy(block + 8, type_dag[PAIR_A(dag, type_dag, i)].typeMerkleRoot.s, sizeof(uint32_t[8]));
sha256_compression(analysis[i].annotatedMerkleRoot.s, block);
simplicity_sha256_compression(analysis[i].annotatedMerkleRoot.s, block);
memcpy(block, type_dag[PAIR_B(dag, type_dag, i)].typeMerkleRoot.s, sizeof(uint32_t[8]));
memcpy(block + 8, type_dag[PAIR_C(dag, type_dag, i)].typeMerkleRoot.s, sizeof(uint32_t[8]));
sha256_compression(analysis[i].annotatedMerkleRoot.s, block);
simplicity_sha256_compression(analysis[i].annotatedMerkleRoot.s, block);
memcpy(block, analysis[dag[i].child[0]].annotatedMerkleRoot.s, sizeof(uint32_t[8]));
memcpy(block + 8, analysis[dag[i].child[1]].annotatedMerkleRoot.s, sizeof(uint32_t[8]));
sha256_compression(analysis[i].annotatedMerkleRoot.s, block);
simplicity_sha256_compression(analysis[i].annotatedMerkleRoot.s, block);
break;
case INJL:
case INJR:
memcpy(block, type_dag[INJ_A(dag, type_dag, i)].typeMerkleRoot.s, sizeof(uint32_t[8]));
memcpy(block + 8, type_dag[INJ_B(dag, type_dag, i)].typeMerkleRoot.s, sizeof(uint32_t[8]));
sha256_compression(analysis[i].annotatedMerkleRoot.s, block);
simplicity_sha256_compression(analysis[i].annotatedMerkleRoot.s, block);
memcpy(block, type_dag[INJ_C(dag, type_dag, i)].typeMerkleRoot.s, sizeof(uint32_t[8]));
memcpy(block + 8, analysis[dag[i].child[0]].annotatedMerkleRoot.s, sizeof(uint32_t[8]));
sha256_compression(analysis[i].annotatedMerkleRoot.s, block);
simplicity_sha256_compression(analysis[i].annotatedMerkleRoot.s, block);
break;
case TAKE:
case DROP:
memcpy(block, type_dag[PROJ_A(dag, type_dag, i)].typeMerkleRoot.s, sizeof(uint32_t[8]));
memcpy(block + 8, type_dag[PROJ_B(dag, type_dag, i)].typeMerkleRoot.s, sizeof(uint32_t[8]));
sha256_compression(analysis[i].annotatedMerkleRoot.s, block);
simplicity_sha256_compression(analysis[i].annotatedMerkleRoot.s, block);
memcpy(block, type_dag[PROJ_C(dag, type_dag, i)].typeMerkleRoot.s, sizeof(uint32_t[8]));
memcpy(block + 8, analysis[dag[i].child[0]].annotatedMerkleRoot.s, sizeof(uint32_t[8]));
sha256_compression(analysis[i].annotatedMerkleRoot.s, block);
simplicity_sha256_compression(analysis[i].annotatedMerkleRoot.s, block);
break;
case IDEN:
memcpy(block + 8, type_dag[IDEN_A(dag, type_dag, i)].typeMerkleRoot.s, sizeof(uint32_t[8]));
sha256_compression(analysis[i].annotatedMerkleRoot.s, block);
simplicity_sha256_compression(analysis[i].annotatedMerkleRoot.s, block);
break;
case UNIT:
memcpy(block + 8, type_dag[UNIT_A(dag, type_dag, i)].typeMerkleRoot.s, sizeof(uint32_t[8]));
sha256_compression(analysis[i].annotatedMerkleRoot.s, block);
simplicity_sha256_compression(analysis[i].annotatedMerkleRoot.s, block);
break;
case WITNESS:
memcpy(block + 8, type_dag[WITNESS_A(dag, type_dag, i)].typeMerkleRoot.s, sizeof(uint32_t[8]));
sha256_compression(analysis[i].annotatedMerkleRoot.s, block);
simplicity_sha256_compression(analysis[i].annotatedMerkleRoot.s, block);
memcpy(block, type_dag[WITNESS_B(dag, type_dag, i)].typeMerkleRoot.s, sizeof(uint32_t[8]));
sha256_bitstring(block + 8, &dag[i].compactValue);
sha256_compression(analysis[i].annotatedMerkleRoot.s, block);
simplicity_sha256_bitstring(block + 8, &dag[i].compactValue);
simplicity_sha256_compression(analysis[i].annotatedMerkleRoot.s, block);
break;
case HIDDEN:
case JET:
Expand All @@ -378,9 +378,9 @@ void computeAnnotatedMerkleRoot(analyses* analysis, const dag_node* dag, const t
*
* Precondition: dag_node dag[len] and 'dag' is well-formed.
*/
simplicity_err verifyCanonicalOrder(dag_node* dag, const size_t len) {
size_t bottom = 0;
size_t top = len-1; /* Underflow is checked below. */
simplicity_err simplicity_verifyCanonicalOrder(dag_node* dag, const uint_fast32_t len) {
uint_fast32_t bottom = 0;
uint_fast32_t top = len-1; /* Underflow is checked below. */

if (!len) {
simplicity_assert(false); /* A well-formed dag has non-zero length */
Expand All @@ -403,7 +403,7 @@ simplicity_err verifyCanonicalOrder(dag_node* dag, const size_t len) {
*/

/* Check first child. */
size_t child = dag[top].child[0];
uint_fast32_t child = dag[top].child[0];
switch (dag[top].tag) {
case ASSERTL:
case ASSERTR:
Expand Down Expand Up @@ -482,9 +482,9 @@ simplicity_err verifyCanonicalOrder(dag_node* dag, const size_t len) {
* Postcondition: dag_node dag[len] and 'dag' has witness data and is well-typed with 'type_dag'
* when the result is 'SIMPLICITY_NO_ERROR';
*/
simplicity_err fillWitnessData(dag_node* dag, type* type_dag, const size_t len, bitstream *witness) {
simplicity_err simplicity_fillWitnessData(dag_node* dag, type* type_dag, const uint_fast32_t len, bitstream *witness) {
static_assert(CELLS_MAX <= 0x80000000, "CELLS_MAX is too large.");
for (size_t i = 0; i < len; ++i) {
for (uint_fast32_t i = 0; i < len; ++i) {
if (WITNESS == dag[i].tag) {
if (CELLS_MAX < type_dag[WITNESS_B(dag, type_dag, i)].bitSize) return SIMPLICITY_ERR_EXEC_MEMORY;
if (witness->len <= 0) {
Expand Down Expand Up @@ -571,16 +571,17 @@ simplicity_err fillWitnessData(dag_node* dag, type* type_dag, const size_t len,
*
* Precondition: dag_node dag[len] and 'dag' is well-typed with 'type_dag' and contains witnesses.
*/
simplicity_err verifyNoDuplicateIdentityRoots(sha256_midstate* imr, const dag_node* dag, const type* type_dag, const size_t dag_len) {
simplicity_err simplicity_verifyNoDuplicateIdentityRoots(sha256_midstate* imr, const dag_node* dag, const type* type_dag, const uint_fast32_t dag_len) {
simplicity_assert(0 < dag_len);
simplicity_assert(dag_len <= DAG_LEN_MAX);
sha256_midstate* imr_buf = simplicity_malloc((size_t)dag_len * sizeof(sha256_midstate));
if (!imr_buf) return SIMPLICITY_ERR_MALLOC;

computeIdentityMerkleRoot(imr_buf, dag, type_dag, dag_len);

if (imr) *imr = imr_buf[dag_len-1];

int result = hasDuplicates(imr_buf, dag_len);
int result = simplicity_hasDuplicates(imr_buf, dag_len);

simplicity_free(imr_buf);

Expand Down
Loading

0 comments on commit 3570b00

Please sign in to comment.