mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 02:42:27 +00:00
Format
This commit is contained in:
parent
1e9d4882ce
commit
55df11555c
4 changed files with 14 additions and 17 deletions
6
Makefile
6
Makefile
|
|
@ -2,16 +2,16 @@
|
|||
# with Go source code. If you know what GOPATH is then you probably
|
||||
# don't need to bother with make.
|
||||
|
||||
.PHONY: geth android ios evm all test clean
|
||||
.PHONY: geth android ios evm all test clean mina
|
||||
|
||||
GOBIN = ./build/bin
|
||||
GO ?= latest
|
||||
GORUN = env GO111MODULE=on go run
|
||||
|
||||
mina_lib:
|
||||
mina:
|
||||
cd mina && cargo build --release
|
||||
|
||||
geth: mina_lib
|
||||
geth: mina
|
||||
$(GORUN) build/ci.go install ./cmd/geth
|
||||
@echo "Done building."
|
||||
@echo "Run \"$(GOBIN)/geth\" to launch geth."
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ func (c *MinaPoseidon) Run(input []byte) ([]byte, error) {
|
|||
|
||||
output_buffer := [32]byte{}
|
||||
|
||||
if !C.poseidon_hash(
|
||||
if !C.poseidon(
|
||||
C.uint8_t(networkId),
|
||||
(*C.uint8_t)(&fields[0][0]),
|
||||
C.uintptr_t(len(fields)),
|
||||
|
|
|
|||
|
|
@ -3,14 +3,13 @@ mod mina;
|
|||
use std::array::TryFromSliceError;
|
||||
|
||||
use mina::{Message, NetworkId};
|
||||
use mina_hasher::Hashable;
|
||||
use mina_signer::{BaseField, CurvePoint, PubKey, ScalarField, Signature};
|
||||
use o1_utils::FieldHelpers;
|
||||
|
||||
pub const FIELD_SIZE: usize = 32;
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn poseidon_hash(
|
||||
pub extern "C" fn poseidon(
|
||||
network_id: u8,
|
||||
field_ptr: *const u8,
|
||||
field_len: usize,
|
||||
|
|
@ -99,8 +98,6 @@ pub extern "C" fn verify(
|
|||
Err(_) => return false,
|
||||
};
|
||||
|
||||
println!("{:?}", msg.to_roinput().to_fields()[0].to_biguint());
|
||||
|
||||
let result = mina::verify(&signature, &pubkey, &msg, network_id);
|
||||
|
||||
unsafe { *output_ptr = result };
|
||||
|
|
|
|||
Loading…
Reference in a new issue