Struct ursa::bls::MultiSignature[][src]

pub struct MultiSignature { /* fields omitted */ }
Expand description

BLS multi signature.

Implementations

Creates and returns multi signature for provided list of signatures.

Arguments

  • signatures - List of signatures

Example

use ursa::bls::*;
let sign_key1 = SignKey::new(None).unwrap();
let sign_key2 = SignKey::new(None).unwrap();

let message = vec![1, 2, 3, 4, 5];

let signature1 = Bls::sign(&message, &sign_key1).unwrap();
let signature2 = Bls::sign(&message, &sign_key2).unwrap();

let signatures = vec![
   &signature1,
   &signature2
];

MultiSignature::new(&signatures).unwrap();

Returns BLS multi signature bytes representation.

Example

use ursa::bls::{SignKey, Bls, MultiSignature};
let message = vec![1, 2, 3, 4, 5];
let sign_key1 = SignKey::new(None).unwrap();
let sign_key2 = SignKey::new(None).unwrap();
let signature1 = Bls::sign(&message, &sign_key1).unwrap();
let signature2 = Bls::sign(&message, &sign_key2).unwrap();
let signatures = vec![&signature1, &signature2];
let multi_signature = MultiSignature::new(&signatures).unwrap();
let bytes = multi_signature.as_bytes();

Creates and returns BLS multi signature from bytes representation.

Example

use ursa::bls::{SignKey, Bls, MultiSignature};
let message = vec![1, 2, 3, 4, 5];
let sign_key1 = SignKey::new(None).unwrap();
let sign_key2 = SignKey::new(None).unwrap();
let signature1 = Bls::sign(&message, &sign_key1).unwrap();
let signature2 = Bls::sign(&message, &sign_key2).unwrap();
let signatures = vec![&signature1, &signature2];
let multi_signature = MultiSignature::new(&signatures).unwrap();
let bytes = multi_signature.as_bytes();
let multi_signature2 = MultiSignature::from_bytes(bytes).unwrap();

Trait Implementations

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.