Derived Clone for Share (#12)

* Derived Clone for Share

* Bumped version
This commit is contained in:
zer0x64 2020-03-11 04:45:20 -04:00 committed by GitHub
parent 391edbd7da
commit f7b0526c0e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 1 deletions

View File

@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [0.3.2] - 2020-03-9
### Changed
- Share structs now derives the `Clone` trait
## [0.3.1] - 2020-01-23 ## [0.3.1] - 2020-01-23
### Changed ### Changed
- Sharks recover method now accepts any iterable collection - Sharks recover method now accepts any iterable collection

View File

@ -1,6 +1,6 @@
[package] [package]
name = "sharks" name = "sharks"
version = "0.3.1" version = "0.3.2"
authors = ["Aitor Ruano <codearm@pm.me>"] authors = ["Aitor Ruano <codearm@pm.me>"]
description = "Fast, small and secure Shamir's Secret Sharing library crate" description = "Fast, small and secure Shamir's Secret Sharing library crate"
homepage = "https://github.com/c0dearm/sharks" homepage = "https://github.com/c0dearm/sharks"

View File

@ -21,6 +21,7 @@ use super::field::GF256;
/// let shares_bytes: Vec<Vec<u8>> = ask_shares(); /// let shares_bytes: Vec<Vec<u8>> = ask_shares();
/// let shares: Vec<Share> = shares_bytes.iter().map(|s| Share::from(s.as_slice())).collect(); /// let shares: Vec<Share> = shares_bytes.iter().map(|s| Share::from(s.as_slice())).collect();
/// let secret = sharks.recover(&shares).unwrap(); /// let secret = sharks.recover(&shares).unwrap();
#[derive(Clone)]
pub struct Share { pub struct Share {
pub x: GF256, pub x: GF256,
pub y: Vec<GF256>, pub y: Vec<GF256>,