Skip to content

Commit 5dfc49e

Browse files
committed
<< requires uint shift now.
1 parent 196f4b1 commit 5dfc49e

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

src/rust-crypto/aessafe.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ define_aes_enc_x8!(AesSafe256EncryptorX8, 14)
321321
define_aes_dec_x8!(AesSafe256DecryptorX8, 14)
322322

323323
fn rotate(r: u32, rotate: u32) -> u32 {
324-
return (r >> rotate) | (r << (32 - rotate));
324+
return (r >> rotate as uint) | (r << (32 - rotate) as uint);
325325
}
326326

327327
fn ffmulx(x: u32) -> u32 {

src/rust-crypto/md5.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ impl Md5State {
5757
}
5858

5959
fn rotate_left(x: u32, n: u32) -> u32 {
60-
return (x << n) | (x >> (32 - n));
60+
return (x << n as uint) | (x >> (32 - n as uint));
6161
}
6262

6363
fn op_f(w: u32, x: u32, y: u32, z: u32, m: u32, s: u32) -> u32 {

src/rust-crypto/scrypt.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ impl ScryptParams {
168168
assert!(log_n > 0);
169169
assert!((log_n as uint) < size_of::<uint>() * 8);
170170

171-
let n = 1u32 << log_n;
171+
let n = 1u32 << log_n as uint;
172172

173173
let rp = match r.checked_mul(&p) {
174174
Some(x) => x,
@@ -232,7 +232,7 @@ pub fn scrypt(password: &[u8], salt: &[u8], params: &ScryptParams, output: &mut
232232
assert!(output.len() / 32 <= 0xffffffff);
233233

234234
// The checks in the ScryptParams constructor guarantee that the following is safe:
235-
let n = 1u << params.log_n;
235+
let n = 1u << params.log_n as uint;
236236
let r = params.r as uint;
237237
let p = params.p as uint;
238238

src/rust-crypto/sha1.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ fn process_msg_block(data: &[u8], h: &mut [u32, ..DIGEST_BUF_LEN]) {
125125
}
126126

127127
fn circular_shift(bits: u32, word: u32) -> u32 {
128-
return word << bits | word >> 32u32 - bits;
128+
return word << bits as uint | word >> (32u32 - bits) as uint;
129129
}
130130

131131
fn mk_result(st: &mut Sha1, rs: &mut [u8]) {

0 commit comments

Comments
 (0)