This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*! | |
this module implements the AES algorithm completely in software without using any table lookups or | |
other timing dependant mechanisms. This module actually contains two seperate implementations - an | |
implementation that works on a single block at a time and a second implementation that processes 8 | |
blocks in parallel. Some block encryption modes really only work if you are processing a single | |
blocks (CFB, OFB, and CBC encryption for example) while other modes are trivially parallelizable | |
(CTR and CBC decryption). Processing more blocks at once allows for greater efficiency, especially | |
when using wide registers, such as the XMM registers available in x86 processors. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::unstable::simd::u32x4; | |
static test: u32x4 = u32x4(0, 0, 0, 0); | |
fn main() { | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn call(f: &fn()) { | |
f(); | |
} | |
fn call_twice(f: &fn()) { | |
call(f); | |
call(f); | |
} | |
fn main() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn test() -> (u32, u32) { | |
return (0, 0,); | |
} | |
fn main() { | |
let mut X0 = 0u32; | |
let mut X1 = 0u32; | |
(X0, X1) = test(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn test() -> (u32, u32) { | |
return (0, 0,); | |
} | |
fn main() { | |
let mut X0: u32; | |
let mut X1: u32; | |
(X0, X1) = test(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct Works { | |
val: int | |
} | |
impl Works { | |
fn fn1(&mut self) { | |
// This seems to work perfectly fine | |
self.fn2(&const self.val); | |
} | |
fn fn2(&mut self, x: &const int) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait Printable { | |
fn print(&self); | |
} | |
fn test(o: &[~Printable]) { | |
for o.each |&p| { | |
p.print(); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This code works fine | |
fn get(f: ~fn() -> int) -> ~fn() -> int { | |
|| { | |
f() | |
} | |
} | |
fn main() { | |
get(|| {8})(); | |
} |
NewerOlder