sha1collisiondetection 0.2.0

SHA-1 hash function with collision detection and mitigation
Documentation
# Maintenance manual

This library is translated using c2rust.  This document describes the
translation, and how to redo it if the upstream project changes.

First, merge any changes from upstream into the repository, taking
care of any merge conflicts.

Run `make check` to see if the C implementation still works.

Then, remove `lib/sha1.rs` (`lib/ubc_check.rs` if the
`src/ubc_check.c` was changed).  Run `c2rust transpile --emit-no-std
compile_commands.json`.

Edit `lib/sha1.rs`.  Remove the following lines at the top:

```rust
#![register_tool(c2rust)]
#![feature(register_tool)]
#![no_std]
```

And replace `sha1_process_unaligned` and `maybe_bswap32` with the
following functions:

```rust
#[inline]
unsafe extern "C" fn sha1_process_unaligned(mut ctx: *mut SHA1_CTX,
                                            buf: *const libc::c_void) {
    if cfg!(any(target_arch = "x86", target_arch = "x86_64")) {
        sha1_process(ctx, buf as *mut uint32_t as *const uint32_t);
    } else {
        libc::memcpy((*ctx).buffer.as_mut_ptr() as *mut _, buf, 64);
        sha1_process(ctx, (*ctx).buffer.as_mut_ptr() as *const uint32_t);

    }
}
```

```rust
#[inline]
unsafe extern "C" fn maybe_bswap32(mut x: uint32_t) -> uint32_t {
    if cfg!(target_endian = "big") {
        x
    } else if cfg!(target_endian = "little") {
        sha1_bswap32(x)
    } else {
        unimplemented!()
    }
}
```

Run `cargo check` to see if the Rust implementation still works.

Finally, commit the changes.