Initial commit.
This commit is contained in:
commit
d7085b90c8
|
@ -0,0 +1 @@
|
|||
target
|
|
@ -0,0 +1,14 @@
|
|||
[root]
|
||||
name = "librustzcash"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"libc 0.2.21 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "libc"
|
||||
version = "0.2.21"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[metadata]
|
||||
"checksum libc 0.2.21 (registry+https://github.com/rust-lang/crates.io-index)" = "88ee81885f9f04bff991e306fea7c1c60a5f0f9e409e99f6b40e3311a3363135"
|
|
@ -0,0 +1,12 @@
|
|||
[package]
|
||||
name = "librustzcash"
|
||||
version = "0.1.0"
|
||||
authors = ["Sean Bowe <ewillbefull@gmail.com>"]
|
||||
|
||||
[lib]
|
||||
name = "rustzcash"
|
||||
path = "src/rustzcash.rs"
|
||||
crate-type = ["staticlib"]
|
||||
|
||||
[dependencies]
|
||||
libc = "0.2"
|
|
@ -0,0 +1,20 @@
|
|||
# librustzcash
|
||||
|
||||
This repository contains librustzcash, a static library for Zcash code assets written in Rust.
|
||||
|
||||
## License
|
||||
|
||||
Licensed under either of
|
||||
|
||||
* Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
|
||||
* MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
|
||||
|
||||
at your option.
|
||||
|
||||
### Contribution
|
||||
|
||||
Unless you explicitly state otherwise, any contribution intentionally
|
||||
submitted for inclusion in the work by you, as defined in the Apache-2.0
|
||||
license, shall be dual licensed as above, without any additional terms or
|
||||
conditions.
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
extern crate libc;
|
||||
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() {
|
||||
assert_eq!(librustzcash_xor(0x0f0f0f0f0f0f0f0f, 0x1111111111111111), 0x1e1e1e1e1e1e1e1e);
|
||||
}
|
Loading…
Reference in New Issue