holochain_sodium

Crates.ioholochain_sodium
lib.rsholochain_sodium
version0.0.1-alpha1
sourcesrc
created_at2019-05-16 23:05:39.043271
updated_at2019-05-16 23:05:39.043271
descriptionholochain libsodium wrapper providing memory secure api access
homepage
repositoryhttps://github.com/holochain/lib3h
max_upload_size
id134794
size50,993
David Braden (neonphog)

documentation

https://docs.rs/holochain_sodium

README

holochain_sodium

Project Chat

Twitter Follow

License: Apache-2.0

Overview

Holochain libsodium wrapper providing memory secure api access.

Usage

extern crate holochain_sodium;
use holochain_sodium::{secbuf::SecBuf, sign::*};

fn main() {
    let mut seed = SecBuf::with_secure(32);
    seed.randomize();

    let mut public_key = SecBuf::with_insecure(PUBLICKEYBYTES);
    let mut secret_key = SecBuf::with_secure(SECRETKEYBYTES);
    seed_keypair(&mut public_key, &mut secret_key, &mut seed).unwrap();

    let mut message = SecBuf::with_insecure(32);
    message.randomize();

    let mut signature = SecBuf::with_insecure(64);
    sign(&mut message, &mut secret_key, &mut signature).unwrap();

    assert!(verify(&mut signature, &mut message, &mut public_key));
}

Contribute

Holochain is an open source project. We welcome all sorts of participation and are actively working on increasing surface area to accept it. Please see our contributing guidelines for our general practices and protocols on participating in the community.

License

License: Apache-2.0

Copyright (C) 2019, Holochain Foundation

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Commit count: 2587

cargo fmt