Remove (ptr base.u8).read_u32le method

This commit is contained in:
Nigel Tao committed 2018-05-04 12:11:42 +10:00
1 parent f64bf4af61
commit c9ec81f0d6
4 files changed
+9 -33

No files matched your search

+5 -3
View File
@@ -30,9 +30,11 @@ pub func ieee_hasher.update(x slice base.u8)(checksum base.u32) {
iterate (step:8, unroll:1)(p ptr base.u8:in.x) {
// TODO: explain the slicing-by-8 algorithm.
//
// TODO: bounds checking for the ptr base.u8 methods and the index
// expressions "p[7]" etc.
s ^= p.read_u32le(at:0)
// TODO: bounds checking for the index expressions "p[7]" etc.
s ^= ((p[0] as base.u32) << 0) |
((p[1] as base.u32) << 8) |
((p[2] as base.u32) << 16) |
((p[3] as base.u32) << 24)
s = ieee_table[0][p[7]] ^
ieee_table[1][p[6]] ^
ieee_table[2][p[5]] ^