Browse Source
Merge pull request #5 from ia0/update_data_encoding
Update data-encoding major version
pull/9/merge
Cesar Eduardo Barros
7 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with
10 additions and
7 deletions
-
Cargo.toml
-
LICENSE-MIT
-
src/blake2b.rs
-
src/blake2s.rs
|
|
@ -20,4 +20,4 @@ constant_time_eq = "0.1.0" |
|
|
|
clippy = {version = "0.0.41", optional = true} |
|
|
|
|
|
|
|
[dev-dependencies] |
|
|
|
data-encoding = "1.1.0" |
|
|
|
data-encoding = "2.0.0" |
|
|
|
|
|
@ -1,4 +1,5 @@ |
|
|
|
Copyright (c) 2015 The blake2-rfc Developers |
|
|
|
Copyright (c) 2017 Google Inc. |
|
|
|
|
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a copy |
|
|
|
of this software and associated documentation files (the "Software"), to deal |
|
|
|
|
|
@ -1,4 +1,5 @@ |
|
|
|
// Copyright 2015 blake2-rfc Developers
|
|
|
|
// Copyright 2017 Google Inc.
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or
|
|
|
|
// http://apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or
|
|
|
@ -56,14 +57,14 @@ mod tests { |
|
|
|
use std::io::prelude::*; |
|
|
|
|
|
|
|
extern crate data_encoding; |
|
|
|
use self::data_encoding::base16; |
|
|
|
use self::data_encoding::HEXUPPER; |
|
|
|
|
|
|
|
use blake2::selftest_seq; |
|
|
|
use super::{Blake2b, blake2b}; |
|
|
|
|
|
|
|
#[test] |
|
|
|
fn test_empty() { |
|
|
|
assert_eq!(&blake2b(64, &[], b""), &base16::decode( |
|
|
|
assert_eq!(&blake2b(64, &[], b""), &HEXUPPER.decode( |
|
|
|
b"786A02F742015903C6C6FD852552D272912F4740E15847618A86E217F71F5419D25E1031AFEE585313896444934EB04B903A685B1448B755D56F701AFE9BE2CE") |
|
|
|
.unwrap()[..]); |
|
|
|
} |
|
|
@ -107,7 +108,7 @@ mod tests { |
|
|
|
for _ in 0..1048576 { |
|
|
|
state.update(&ZEROS); |
|
|
|
} |
|
|
|
assert_eq!(&state.finalize(), &base16::decode( |
|
|
|
assert_eq!(&state.finalize(), &HEXUPPER.decode( |
|
|
|
b"645572CA5756F9104329ED543735FC11904F0C18C4DF8ADF930F22D07F3094919A519FF34FD240AE3F5D5B4C8042225C109FB951036FDC99E7D2CD0C1D36B267") |
|
|
|
.unwrap()[..]); |
|
|
|
} |
|
|
|
|
|
@ -1,4 +1,5 @@ |
|
|
|
// Copyright 2015 blake2-rfc Developers
|
|
|
|
// Copyright 2017 Google Inc.
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or
|
|
|
|
// http://apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or
|
|
|
@ -54,14 +55,14 @@ mod tests { |
|
|
|
use std::io::prelude::*; |
|
|
|
|
|
|
|
extern crate data_encoding; |
|
|
|
use self::data_encoding::base16; |
|
|
|
use self::data_encoding::HEXUPPER; |
|
|
|
|
|
|
|
use blake2::selftest_seq; |
|
|
|
use super::{Blake2s, blake2s}; |
|
|
|
|
|
|
|
#[test] |
|
|
|
fn test_empty() { |
|
|
|
assert_eq!(&blake2s(32, &[], b""), &base16::decode( |
|
|
|
assert_eq!(&blake2s(32, &[], b""), &HEXUPPER.decode( |
|
|
|
b"69217A3079908094E11121D042354A7C1F55B6482CA1A51E1B250DFD1ED0EEF9") |
|
|
|
.unwrap()[..]); |
|
|
|
} |
|
|
@ -105,7 +106,7 @@ mod tests { |
|
|
|
for _ in 0..1048576 { |
|
|
|
state.update(&ZEROS); |
|
|
|
} |
|
|
|
assert_eq!(&state.finalize(), &base16::decode( |
|
|
|
assert_eq!(&state.finalize(), &HEXUPPER.decode( |
|
|
|
b"2A8E26830310DA3EF7F7032B7B1AF11B989ABA44A3713A22F539F69BD2CE4A87") |
|
|
|
.unwrap()[..]); |
|
|
|
} |
|
|
|