Skip to content

Commit

Permalink
Merge pull request sfackler#768 from ia0/update_data_encoding
Browse files Browse the repository at this point in the history
Update data-encoding major version
  • Loading branch information
sfackler authored Nov 4, 2017
2 parents bc38213 + a5c582a commit 7a02ace
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion openssl/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ tempdir = "0.3"
winapi = "0.2"
ws2_32-sys = "0.2"
hex = "0.2"
data-encoding = "1.2"
data-encoding = "2.0"
2 changes: 1 addition & 1 deletion openssl/LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright 2011 Google Inc.
Copyright 2011-2017 Google Inc.
2013 Jack Lloyd
2013-2014 Steven Fackler

Expand Down
18 changes: 10 additions & 8 deletions openssl/src/ec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ impl EcKeyBuilderRef {
mod test {
use bn::{BigNum, BigNumContext};
use nid;
use data_encoding;
use data_encoding::BASE64URL_NOPAD;
use super::*;

#[test]
Expand Down Expand Up @@ -603,10 +603,10 @@ mod test {
#[test]
fn key_from_affine_coordinates() {
let group = EcGroup::from_curve_name(nid::X9_62_PRIME256V1).unwrap();
let x = data_encoding::base64url::decode_nopad(
let x = BASE64URL_NOPAD.decode(
"MKBCTNIcKUSDii11ySs3526iDZ8AiTo7Tu6KPAqv7D4".as_bytes(),
).unwrap();
let y = data_encoding::base64url::decode_nopad(
let y = BASE64URL_NOPAD.decode(
"4Etl6SRW2YiLUrN5vfvVHuhp7x8PxltmWWlbbM4IFyM".as_bytes(),
).unwrap();

Expand All @@ -627,7 +627,7 @@ mod test {
#[test]
fn set_private_key() {
let group = EcGroup::from_curve_name(nid::X9_62_PRIME256V1).unwrap();
let d = data_encoding::base64url::decode_nopad(
let d = BASE64URL_NOPAD.decode(
"870MB6gfuTJ4HtUnUvYMyJpr5eUZNP4Bk43bVdj3eAE".as_bytes(),
).unwrap();

Expand All @@ -643,11 +643,13 @@ mod test {

#[test]
fn get_affine_coordinates() {
let raw_x = "MKBCTNIcKUSDii11ySs3526iDZ8AiTo7Tu6KPAqv7D4";
let raw_y = "4Etl6SRW2YiLUrN5vfvVHuhp7x8PxltmWWlbbM4IFyM";
let group = EcGroup::from_curve_name(nid::X9_62_PRIME256V1).unwrap();
let x = data_encoding::base64url::decode_nopad(raw_x.as_bytes()).unwrap();
let y = data_encoding::base64url::decode_nopad(raw_y.as_bytes()).unwrap();
let x = BASE64URL_NOPAD.decode(
"MKBCTNIcKUSDii11ySs3526iDZ8AiTo7Tu6KPAqv7D4".as_bytes(),
).unwrap();
let y = BASE64URL_NOPAD.decode(
"4Etl6SRW2YiLUrN5vfvVHuhp7x8PxltmWWlbbM4IFyM".as_bytes(),
).unwrap();

let xbn = BigNum::from_slice(&x).unwrap();
let ybn = BigNum::from_slice(&y).unwrap();
Expand Down

0 comments on commit 7a02ace

Please sign in to comment.