#![allow(non_upper_case_globals)]
extern crate libc;
#[cfg(test)]
extern crate regex;
use std::ffi::NulError;
use std::str;
use std::string;
pub mod crypto {
pub mod asymmetrickey;
pub mod hash;
pub mod symmetrickey;
pub mod utils;
}
pub use self::SSError::*;
#[derive(Debug)]
pub enum SSError {
CSTR(NulError),
DECRYPT(&'static str),
ENCRYPT(&'static str),
HASH(&'static str),
KEYGEN(&'static str),
MAC(&'static str),
SIGN(&'static str),
STR(str::Utf8Error),
STRING(string::FromUtf8Error),
VERIFYSIGNED(&'static str),
}
impl From<NulError> for SSError {
fn from(err: NulError) -> SSError {
CSTR(err)
}
}
impl From<str::Utf8Error> for SSError {
fn from(err: str::Utf8Error) -> SSError {
STR(err)
}
}
impl From<string::FromUtf8Error> for SSError {
fn from(err: string::FromUtf8Error) -> SSError {
STRING(err)
}
}