aboutsummaryrefslogtreecommitdiff
path: root/src/lib/sha1.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/sha1.rs')
-rw-r--r--src/lib/sha1.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/sha1.rs b/src/lib/sha1.rs
index 3866be1e..690489db 100644
--- a/src/lib/sha1.rs
+++ b/src/lib/sha1.rs
@@ -43,7 +43,7 @@ fn mk_sha1() -> sha1 {
fn add_input(&sha1state st, &vec[u8] msg) {
// FIXME: Should be typestate precondition
- check (!st.computed);
+ assert (!st.computed);
for (u8 element in msg) {
st.msg_block.(st.msg_block_idx) = element;
@@ -67,7 +67,7 @@ fn mk_sha1() -> sha1 {
fn process_msg_block(&sha1state st) {
// FIXME: Make precondition
- check (_vec.len[mutable u32](st.h) == digest_buf_len);
+ assert (_vec.len[mutable u32](st.h) == digest_buf_len);
// Constants
auto k = vec(0x5A827999u32,
@@ -192,7 +192,7 @@ fn mk_sha1() -> sha1 {
*/
fn pad_msg(&sha1state st) {
// FIXME: Should be a precondition
- check (_vec.len[mutable u8](st.msg_block) == msg_block_len);
+ assert (_vec.len[mutable u8](st.msg_block) == msg_block_len);
/*
* Check to see if the current message block is too small to hold
@@ -236,7 +236,7 @@ fn mk_sha1() -> sha1 {
fn reset() {
// FIXME: Should be typestate precondition
- check (_vec.len[mutable u32](st.h) == digest_buf_len);
+ assert (_vec.len[mutable u32](st.h) == digest_buf_len);
st.len_low = 0u32;
st.len_high = 0u32;