Initial commit.

This commit is contained in:
Sean Bowe 2017-03-17 11:07:23 -06:00
commit d7085b90c8
5 changed files with 63 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
target

14
Cargo.lock generated Normal file
View File

@ -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"

12
Cargo.toml Normal file
View File

@ -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"

20
README.md Normal file
View File

@ -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.

16
src/rustzcash.rs Normal file
View File

@ -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);
}