Open
Description
https://github.com/RustCrypto/hashes/blob/master/sha2/Cargo.toml vs https://github.com/brandonros/rust-ed25519-compact
$ cargo run --release -- aa $BLOCKS_PER_GRID $THREADS_PER_BLOCK
Compiling ed25519_vanity v0.1.0 (/home/brandon/ed25519-vanity-rs)
Finished `release` profile [optimized] target(s) in 0.90s
Running `target/release/ed25519_vanity aa 128 128`
Found 1 CUDA devices
Starting device 0
[0] Loading module...
[0] Starting search loop...
thread '<unnamed>' panicked at /home/brandon/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/cudarc-0.16.0/src/driver/safe/core.rs:470:36:
called `Result::unwrap()` on an `Err` value: DriverError(CUDA_ERROR_LAUNCH_FAILED, "unspecified launch failure")
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread '<unnamed>' panicked at /home/brandon/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/cudarc-0.16.0/src/driver/safe/core.rs:246:58:
called `Result::unwrap()` on an `Err` value: DriverError(CUDA_ERROR_LAUNCH_FAILED, "unspecified launch failure")
stack backtrace:
0: 0x55e313ca18e3 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::hdbd106d724e72c20
1: 0x55e313cc3493 - core::fmt::write::h861eecc74abebf7a
2: 0x55e313c9f003 - std::io::Write::write_fmt::h493b3152b071fba0
3: 0x55e313ca1732 - std::sys::backtrace::BacktraceLock::print::h71f315c25fc266cb
4: 0x55e313ca26ca - std::panicking::default_hook::{{closure}}::h8019dc6a2c6c0fe7
5: 0x55e313ca253a - std::panicking::default_hook::h497f769686a88dd6
6: 0x55e313ca2fd2 - std::panicking::rust_panic_with_hook::h98fc165e90ef379e
7: 0x55e313ca2e6a - std::panicking::begin_panic_handler::{{closure}}::h2c1a60d0a908eaec
8: 0x55e313ca1dd9 - std::sys::backtrace::__rust_end_short_backtrace::he8aba8f9b7ddf304
9: 0x55e313ca2afd - rust_begin_unwind
10: 0x55e313cc2010 - core::panicking::panic_fmt::hcbf39f8c1e585f84
11: 0x55e313cc23a6 - core::result::unwrap_failed::haf1491c6d679786d
12: 0x55e313c7bc98 - <cudarc::driver::safe::core::CudaEvent as core::ops::drop::Drop>::drop::heca398ef781d7d06
13: 0x55e313c60323 - core::ptr::drop_in_place<core::option::Option<cudarc::driver::safe::core::CudaEvent>>::h0f0fd586ce97c35f
14: 0x55e313c601f6 - core::ptr::drop_in_place<cudarc::driver::safe::core::CudaSlice<u8>>::he9b6484b4f5db6c9
15: 0x55e313c61cae - ed25519_vanity::device_main::h99b65f8ab2f8c263
16: 0x55e313c65f2b - std::sys::backtrace::__rust_begin_short_backtrace::he6efac01710238fd
17: 0x55e313c656f1 - core::ops::function::FnOnce::call_once{{vtable.shim}}::h486bd94640b67ff5
18: 0x55e313ca4d8b - std::sys::pal::unix::thread::Thread::new::thread_start::h20288ab9ea215a81
19: 0x7fe278c381f5 - <unknown>
20: 0x7fe278cb889c - <unknown>
21: 0x0 - <unknown>
thread '<unnamed>' panicked at library/core/src/panicking.rs:226:5:
panic in a destructor during cleanup
thread caused non-unwinding panic. aborting.
Aborted
use sha2::Digest as _;
use ed25519_compact::ge_scalarmult_base;
use rand_core::{SeedableRng, RngCore};
use rand_xorshift::XorShiftRng;
use bs58;
// fails
fn sha512(input: &[u8]) -> [u8; 64] {
let mut hasher = sha2::Sha512::new();
hasher.update(input);
hasher.finalize().into()
}
// works
fn sha512_compact(input: &[u8]) -> [u8; 64] {
let mut hasher = ed25519_compact::sha512::Hash::new();
hasher.update(input);
hasher.finalize()
}
Metadata
Metadata
Assignees
Labels
No labels