Commit 22f02906 authored by Peter Farr's avatar Peter Farr
Browse files

Added clonability for sha hash state. Useful for incremental hashing

parent dc72a8e2
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -5,6 +5,7 @@ pub type SHA_LONG = c_uint;
pub const SHA_LBLOCK: c_int = 16;

#[repr(C)]
#[derive(Clone)]
pub struct SHA_CTX {
    pub h0: SHA_LONG,
    pub h1: SHA_LONG,
+1 −0
Original line number Diff line number Diff line
@@ -110,6 +110,7 @@ pub fn sha512(data: &[u8]) -> [u8; 64] {
///
/// SHA1 is known to be insecure - it should not be used unless required for
/// compatibility with existing systems.
#[derive(Clone)]
pub struct Sha1(ffi::SHA_CTX);

impl Sha1 {