Loading src/bn/mod.rs +10 −8 Original line number Diff line number Diff line use libc::{c_int, c_ulong, c_void}; use std::{fmt, ptr}; use std::c_str::CString; use std::cmp::Ordering; use std::{fmt, ptr}; use ffi; use ssl::error::SslError; pub struct BigNum(*mut ffi::BIGNUM); #[deriving(Copy)] #[derive(Copy)] #[repr(C)] pub enum RNGProperty { MsbMaybeZero = -1, Loading Loading @@ -303,11 +304,11 @@ impl BigNum { unsafe { let res = ffi::BN_ucmp(self.raw(), oth.raw()) as i32; if res < 0 { Less Ordering::Less } else if res > 0 { Greater Ordering::Greater } else { Equal Ordering::Equal } } } Loading Loading @@ -382,11 +383,11 @@ impl PartialOrd for BigNum { let v = ffi::BN_cmp(self.raw(), oth.raw()); let ret = if v == 0 { Equal Ordering::Equal } else if v < 0 { Less Ordering::Less } else { Greater Ordering::Greater }; Some(ret) } Loading @@ -404,6 +405,7 @@ impl Drop for BigNum { } pub mod unchecked { use std::ops::{Add, Div, Mul, Neg, Rem, Shl, Shr, Sub}; use ffi; use super::{BigNum}; Loading src/crypto/hash.rs +1 −1 Original line number Diff line number Diff line Loading @@ -4,7 +4,7 @@ use std::io; use ffi; #[deriving(Copy)] #[derive(Copy)] pub enum HashType { MD5, SHA1, Loading src/crypto/hmac.rs +1 −1 Original line number Diff line number Diff line Loading @@ -72,7 +72,7 @@ impl Drop for HMAC { #[cfg(test)] mod tests { use serialize::hex::FromHex; use crypto::hash::HashType::{mod, MD5, SHA1, SHA224, SHA256, SHA384, SHA512}; use crypto::hash::HashType::{self, MD5, SHA1, SHA224, SHA256, SHA384, SHA512}; use super::HMAC; #[test] Loading src/crypto/pkey.rs +3 −3 Original line number Diff line number Diff line Loading @@ -6,7 +6,7 @@ use crypto::hash::HashType; use ffi; use ssl::error::{SslError, StreamError}; #[deriving(Copy)] #[derive(Copy)] enum Parts { Neither, Public, Loading @@ -14,7 +14,7 @@ enum Parts { } /// Represents a role an asymmetric key might be appropriate for. #[deriving(Copy)] #[derive(Copy)] pub enum Role { Encrypt, Decrypt, Loading @@ -23,7 +23,7 @@ pub enum Role { } /// Type of encryption padding to use. #[deriving(Copy)] #[derive(Copy)] pub enum EncryptionPadding { OAEP, PKCS1v15 Loading src/crypto/symm.rs +2 −2 Original line number Diff line number Diff line Loading @@ -2,14 +2,14 @@ use libc::{c_int}; use ffi; #[deriving(Copy)] #[derive(Copy)] pub enum Mode { Encrypt, Decrypt, } #[allow(non_camel_case_types)] #[deriving(Copy)] #[derive(Copy)] pub enum Type { AES_128_ECB, AES_128_CBC, Loading Loading
src/bn/mod.rs +10 −8 Original line number Diff line number Diff line use libc::{c_int, c_ulong, c_void}; use std::{fmt, ptr}; use std::c_str::CString; use std::cmp::Ordering; use std::{fmt, ptr}; use ffi; use ssl::error::SslError; pub struct BigNum(*mut ffi::BIGNUM); #[deriving(Copy)] #[derive(Copy)] #[repr(C)] pub enum RNGProperty { MsbMaybeZero = -1, Loading Loading @@ -303,11 +304,11 @@ impl BigNum { unsafe { let res = ffi::BN_ucmp(self.raw(), oth.raw()) as i32; if res < 0 { Less Ordering::Less } else if res > 0 { Greater Ordering::Greater } else { Equal Ordering::Equal } } } Loading Loading @@ -382,11 +383,11 @@ impl PartialOrd for BigNum { let v = ffi::BN_cmp(self.raw(), oth.raw()); let ret = if v == 0 { Equal Ordering::Equal } else if v < 0 { Less Ordering::Less } else { Greater Ordering::Greater }; Some(ret) } Loading @@ -404,6 +405,7 @@ impl Drop for BigNum { } pub mod unchecked { use std::ops::{Add, Div, Mul, Neg, Rem, Shl, Shr, Sub}; use ffi; use super::{BigNum}; Loading
src/crypto/hash.rs +1 −1 Original line number Diff line number Diff line Loading @@ -4,7 +4,7 @@ use std::io; use ffi; #[deriving(Copy)] #[derive(Copy)] pub enum HashType { MD5, SHA1, Loading
src/crypto/hmac.rs +1 −1 Original line number Diff line number Diff line Loading @@ -72,7 +72,7 @@ impl Drop for HMAC { #[cfg(test)] mod tests { use serialize::hex::FromHex; use crypto::hash::HashType::{mod, MD5, SHA1, SHA224, SHA256, SHA384, SHA512}; use crypto::hash::HashType::{self, MD5, SHA1, SHA224, SHA256, SHA384, SHA512}; use super::HMAC; #[test] Loading
src/crypto/pkey.rs +3 −3 Original line number Diff line number Diff line Loading @@ -6,7 +6,7 @@ use crypto::hash::HashType; use ffi; use ssl::error::{SslError, StreamError}; #[deriving(Copy)] #[derive(Copy)] enum Parts { Neither, Public, Loading @@ -14,7 +14,7 @@ enum Parts { } /// Represents a role an asymmetric key might be appropriate for. #[deriving(Copy)] #[derive(Copy)] pub enum Role { Encrypt, Decrypt, Loading @@ -23,7 +23,7 @@ pub enum Role { } /// Type of encryption padding to use. #[deriving(Copy)] #[derive(Copy)] pub enum EncryptionPadding { OAEP, PKCS1v15 Loading
src/crypto/symm.rs +2 −2 Original line number Diff line number Diff line Loading @@ -2,14 +2,14 @@ use libc::{c_int}; use ffi; #[deriving(Copy)] #[derive(Copy)] pub enum Mode { Encrypt, Decrypt, } #[allow(non_camel_case_types)] #[deriving(Copy)] #[derive(Copy)] pub enum Type { AES_128_ECB, AES_128_CBC, Loading