Commit 8fae1115 authored by Peter Farr's avatar Peter Farr
Browse files

Changed all sha objects to be clonable per PR review suggestion.

parent 22f02906
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@ extern "C" {
}

#[repr(C)]
#[derive(Clone)]
pub struct SHA256_CTX {
    pub h: [SHA_LONG; 8],
    pub Nl: SHA_LONG,
@@ -49,6 +50,7 @@ extern "C" {
pub type SHA_LONG64 = u64;

#[repr(C)]
#[derive(Clone)]
pub struct SHA512_CTX {
    pub h: [SHA_LONG64; 8],
    pub Nl: SHA_LONG64,
+4 −0
Original line number Diff line number Diff line
@@ -146,6 +146,7 @@ impl Sha1 {
}

/// An object which calculates a SHA224 hash of some data.
#[derive(Clone)]
pub struct Sha224(ffi::SHA256_CTX);

impl Sha224 {
@@ -181,6 +182,7 @@ impl Sha224 {
}

/// An object which calculates a SHA256 hash of some data.
#[derive(Clone)]
pub struct Sha256(ffi::SHA256_CTX);

impl Sha256 {
@@ -216,6 +218,7 @@ impl Sha256 {
}

/// An object which calculates a SHA384 hash of some data.
#[derive(Clone)]
pub struct Sha384(ffi::SHA512_CTX);

impl Sha384 {
@@ -251,6 +254,7 @@ impl Sha384 {
}

/// An object which calculates a SHA512 hash of some data.
#[derive(Clone)]
pub struct Sha512(ffi::SHA512_CTX);

impl Sha512 {