Skip to content

How to use other library in rust code #146

@notawayne

Description

@notawayne

I am trying to compile rust code and convert it to wasm file with wasm-pack.Everything is ok when running simple calculations in rust code.

But when I try to use an ecdsa library k256 in my code, an error will be reported
thread 'main' panicked at 'failed to load wasm: Validation("Unknown opcode 192")', /home/Project/zkWasm/src/cli/app_builder.rs:75:67 note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

When I try to do the following hash operation in the rust code, an error will be reported when doing single-prove
` let string = "Hello, World!";

let mut hasher = DefaultHasher::new();

string.hash(&mut hasher);

let result = hasher.finish().try_into().unwrap();

wasm_output(result)

`

thread 'main' panicked at 'proof generation should not fail: ConstraintSystemFailure', /home/.cargo/git/checkouts/halo2aggregator-s-4591bb34d62c1163/2db5888/src/circuits/utils.rs:191:14 note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

How can I use other library in rust code?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions