mcginty / snow

A Rust implementation of the Noise Protocol Framework

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't run the example

uber6 opened this issue · comments

commented

After git cloning the repo and running cargo run --example simple -- -s, I get the following error:

thread 'main' panicked at 'Example must be compiled with some cryptographic provider.', src/main.rs:127:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

I created a new cargo and copied the code to main.rs and all dependencies and I get the following error:

thread 'main' panicked at 'Example must be compiled with some cryptographic provider.', src/main.rs:127:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

I tried to figure out what is wrong, but I can't seem to figure out.

Hmm, it looks like your example is being compiled somehow with an implicit --no-default-features somewhere?

I'm not sure why that is for your setup, but you could probably fix it by being more explicit a la:

cargo run --features "default-resolver" --example simple -- -s

FYI, I also just noticed that the clap dependency in the simple example was misdefined, so I fixed that in a commit to master just now.

commented

It certainly worked. So if I wanted to use this on my project, what minimal dependencies are required to make snow work? I'm quite new so I apologize in advance.

It really depends on your specific cryptographic needs to define what truly "minimal" is, but the simple answer is that it's easiest to simply start with snow and its default feature-set, then once you know specifically what primitives you're using, you can disable the default resolver and roll your own custom one with a minimal set of dependencies.

commented

Got ya. Thanks for the advice and help!