Skip to content

Commit

Permalink
Fixed the specification of shifts for Low*
Browse files Browse the repository at this point in the history
The Low* spec. of these operators is more restrictive because of C's undefined behaviours
  • Loading branch information
Benjamin Beurdouche committed Jul 12, 2017
1 parent f875d5f commit c8a61ab
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion code/hash/Hacl.Hash.SHA2_256.fst
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ inline_for_extraction let pos_count_w = size_k_w +^ size_ws_w +^ size_whash_w


[@"substitute"]
let rotate_right (a:uint32_ht) (b:uint32_t{v b <= 32}) : Tot uint32_ht =
let rotate_right (a:uint32_ht) (b:uint32_t{v b < 32}) : Tot uint32_ht =
H32.logor (H32.shift_right a b) (H32.shift_left a (U32.sub 32ul b))

[@"substitute"]
Expand Down
2 changes: 1 addition & 1 deletion code/hash/Hacl.Hash.SHA2_384.fst
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ inline_for_extraction let pos_count_w = size_k_w +^ size_ws_w +^ size_whash_w


[@"substitute"]
let rotate_right64 (a:uint64_ht) (b:uint32_t{v b <= 64}) : Tot uint64_ht =
let rotate_right64 (a:uint64_ht) (b:uint32_t{v b < 64}) : Tot uint64_ht =
H64.logor (H64.shift_right a b) (H64.shift_left a (U32.sub 64ul b))

[@"substitute"]
Expand Down
2 changes: 1 addition & 1 deletion code/hash/Hacl.Hash.SHA2_512.fst
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ inline_for_extraction let pos_count_w = size_k_w +^ size_ws_w +^ size_whash_w


[@"substitute"]
let rotate_right64 (a:uint64_ht) (b:uint32_t{v b <= 64}) : Tot uint64_ht =
let rotate_right64 (a:uint64_ht) (b:uint32_t{v b < 64}) : Tot uint64_ht =
H64.logor (H64.shift_right a b) (H64.shift_left a (U32.sub 64ul b))

[@"substitute"]
Expand Down

0 comments on commit c8a61ab

Please sign in to comment.