Move function definitions to source file (ffi)
This commit is contained in:
parent
012b5ee757
commit
97f9cc6e2b
3 changed files with 13 additions and 8 deletions
|
@ -55,6 +55,7 @@ fn main() {
|
|||
.include(libsnark_source_path.join("depends/libff"))
|
||||
.include(libsnark_source_path.join("depends/libfqfft"))
|
||||
.define("CURVE_ALT_BN128", None)
|
||||
.file("lib/ffi.cpp")
|
||||
.file("lib/util.cpp")
|
||||
.file("lib/gm17.cpp")
|
||||
.file("lib/pghr13.cpp")
|
||||
|
|
10
zokrates_core/lib/ffi.cpp
Normal file
10
zokrates_core/lib/ffi.cpp
Normal file
|
@ -0,0 +1,10 @@
|
|||
#include "ffi.hpp"
|
||||
|
||||
void __alloc(buffer_t* buffer, size_t length) {
|
||||
buffer->data = (uint8_t*)malloc(length);
|
||||
buffer->length = length;
|
||||
}
|
||||
|
||||
void __free(uint8_t* ptr) {
|
||||
free(ptr);
|
||||
}
|
|
@ -23,14 +23,8 @@ struct proof_result_t {
|
|||
proof_result_t(buffer_t& proof_buf) : proof(proof_buf) { }
|
||||
};
|
||||
|
||||
void __alloc(buffer_t* buffer, size_t length) {
|
||||
buffer->data = (uint8_t*)malloc(length);
|
||||
buffer->length = length;
|
||||
}
|
||||
|
||||
void __free(uint8_t* ptr) {
|
||||
free(ptr);
|
||||
}
|
||||
void __alloc(buffer_t* buffer, size_t length);
|
||||
void __free(uint8_t* ptr);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
|
|
Loading…
Reference in a new issue