Struct exonum::crypto::SignStream [] [src]

pub struct SignStream(_);

This structure provides a possibility to create and/or verify Ed25519 digital signatures for a stream of data.

Example

use exonum::crypto::{SignStream, gen_keypair};

let data: Vec<[u8; 5]> = vec![[1, 2, 3, 4, 5], [6, 7, 8, 9, 10]];
let (pk, sk) = gen_keypair();
let mut create_stream = SignStream::new();
let mut verify_stream = SignStream::new();
for chunk in data {
    create_stream = create_stream.update(&chunk);
    verify_stream = verify_stream.update(&chunk);
}
let file_sign = create_stream.sign(&sk);
assert!(verify_stream.verify(&file_sign, &pk));

Methods

impl SignStream
[src]

[src]

Creates a new instance of SignStream.

[src]

Adds a new chunk to the message that will eventually be signed and/or verified.

[src]

Computes and returns a signature for the previously supplied message using the given secret_key.

[src]

Verifies that sig is a valid signature for the previously supplied message using the given public_key.

Trait Implementations

impl Debug for SignStream
[src]

[src]

Formats the value using the given formatter. Read more

impl Default for SignStream
[src]

[src]

Returns the "default value" for a type. Read more

Auto Trait Implementations

impl Send for SignStream

impl Sync for SignStream