pirate-librustzcash/src/rustzcash.rs

19 lines
418 B
Rust
Raw Normal View History

2017-03-17 11:07:23 -06:00
extern crate libc;
2018-04-09 18:28:42 -06:00
extern crate sapling_crypto;
2017-03-17 11:07:23 -06:00
use libc::uint64_t;
/// XOR two uint64_t values and return the result, used
/// as a temporary mechanism for introducing Rust into
/// Zcash.
#[no_mangle]
pub extern "system" fn librustzcash_xor(a: uint64_t, b: uint64_t) -> uint64_t
{
a ^ b
}
#[test]
fn test_xor() {
2017-03-17 11:36:32 -06:00
assert_eq!(librustzcash_xor(0x0f0f0f0f0f0f0f0f, 0x1111111111111111), 0x1e1e1e1e1e1e1e1e);
2017-03-17 11:07:23 -06:00
}