mirror of https://github.com/waku-org/go-rln.git
added ci
This commit is contained in:
parent
7fa929adb4
commit
608a355585
|
@ -0,0 +1,33 @@
|
||||||
|
name: CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
go-version: [1.16.x]
|
||||||
|
platform: [ubuntu-latest]
|
||||||
|
runs-on: ${{ matrix.platform }}
|
||||||
|
steps:
|
||||||
|
- name: Install Go
|
||||||
|
uses: actions/setup-go@v2
|
||||||
|
with:
|
||||||
|
go-version: ${{ matrix.go-version }}
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Test
|
||||||
|
run: go test ./...
|
||||||
|
lint:
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
go-version: [1.15.x, 1.16.x]
|
||||||
|
platform: [ubuntu-latest]
|
||||||
|
runs-on: ${{ matrix.platform }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@master
|
||||||
|
- uses: reviewdog/action-golangci-lint@v1
|
6
Makefile
6
Makefile
|
@ -2,8 +2,4 @@
|
||||||
|
|
||||||
rlnlib:
|
rlnlib:
|
||||||
sh scripts/build.sh
|
sh scripts/build.sh
|
||||||
#cd lib/rln && cargo build --release --target=aarch64-apple-darwin
|
cd lib/rln && cbindgen --config ../cbindgen.toml --crate rln --output ../../rln/librln.h --lang c
|
||||||
#cbindgen --config ../cbindgen.toml --crate rln --output librln.h --lang c
|
|
||||||
#mv lib/rln/target/release/librln.* lib/
|
|
||||||
|
|
||||||
# @TODO TARGET FOR BINDINGS.
|
|
||||||
|
|
35
rln/librln.h
35
rln/librln.h
|
@ -1,35 +0,0 @@
|
||||||
#include <stdarg.h>
|
|
||||||
#include <stdbool.h>
|
|
||||||
#include <stdint.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
typedef struct RLN_Bn256 RLN_Bn256;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Buffer struct is taken from
|
|
||||||
* https://github.com/celo-org/celo-threshold-bls-rs/blob/master/crates/threshold-bls-ffi/src/ffi.rs
|
|
||||||
*/
|
|
||||||
typedef struct Buffer {
|
|
||||||
const uint8_t *ptr;
|
|
||||||
uintptr_t len;
|
|
||||||
} Buffer;
|
|
||||||
|
|
||||||
bool new_circuit_from_params(uintptr_t merkle_depth,
|
|
||||||
const struct Buffer *parameters_buffer,
|
|
||||||
struct RLN_Bn256 **ctx);
|
|
||||||
|
|
||||||
bool generate_proof(const struct RLN_Bn256 *ctx,
|
|
||||||
const struct Buffer *input_buffer,
|
|
||||||
struct Buffer *output_buffer);
|
|
||||||
|
|
||||||
bool verify(const struct RLN_Bn256 *ctx,
|
|
||||||
const struct Buffer *proof_buffer,
|
|
||||||
const struct Buffer *public_inputs_buffer,
|
|
||||||
uint32_t *result_ptr);
|
|
||||||
|
|
||||||
bool hash(const struct RLN_Bn256 *ctx,
|
|
||||||
const struct Buffer *inputs_buffer,
|
|
||||||
const uintptr_t *input_len,
|
|
||||||
struct Buffer *output_buffer);
|
|
||||||
|
|
||||||
bool key_gen(const struct RLN_Bn256 *ctx, struct Buffer *keypair_buffer);
|
|
Loading…
Reference in New Issue