Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: briansmith/ring
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 01cd0070c9aa3e059bdc02e889ea5902a2cb4dea
Choose a base ref
..
head repository: briansmith/ring
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: fc8edaafce8d5e7a2b5e77983f4d66308ee5fd36
Choose a head ref
Showing with 767 additions and 3,117 deletions.
  1. +19 −19 .travis.yml
  2. +10 −18 Cargo.toml
  3. +18 −18 build.rs
  4. +4 −2 crypto/chacha/asm/chacha-armv4.pl
  5. +5 −8 crypto/chacha/asm/chacha-armv8.pl
  6. +0 −2,256 crypto/cipher_extra/asm/aes128gcmsiv-x86_64.pl
  7. +4 −0 crypto/curve25519/asm/x25519-asm-arm.S
  8. +4 −2 crypto/fipsmodule/aes/asm/aes-armv4.pl
  9. +4 −2 crypto/fipsmodule/aes/asm/bsaes-armv7.pl
  10. +4 −2 crypto/fipsmodule/bn/asm/armv4-mont.pl
  11. +0 −404 crypto/fipsmodule/ec/asm/p256_beeu-x86_64-asm.pl
  12. +4 −2 crypto/fipsmodule/modes/asm/ghash-armv4.pl
  13. +4 −2 crypto/fipsmodule/modes/asm/ghash-neon-armv8.pl
  14. +0 −18 crypto/fipsmodule/modes/internal.h
  15. +4 −2 crypto/fipsmodule/sha/asm/sha256-armv4.pl
  16. +4 −2 crypto/fipsmodule/sha/asm/sha512-armv4.pl
  17. +7 −3 crypto/fipsmodule/sha/asm/sha512-armv8.pl
  18. +7 −3 crypto/perlasm/arm-xlate.pl
  19. +2 −1 crypto/perlasm/x86_64-xlate.pl
  20. +2 −0 crypto/perlasm/x86asm.pl
  21. +7 −2 mk/travis.sh
  22. +1 −1 mk/update-travis-yml.py
  23. +2 −3 src/aead.rs
  24. +7 −7 src/aead/aes_gcm.rs
  25. +12 −21 src/aead/block.rs
  26. +5 −13 src/aead/chacha20_poly1305.rs
  27. +79 −46 src/aead/gcm.rs
  28. +1 −1 src/aead/nonce.rs
  29. +7 −10 src/aead/poly1305.rs
  30. +34 −24 src/digest/sha1.rs
  31. +2 −3 src/digest/sha2.rs
  32. +4 −0 src/hkdf.rs
  33. +12 −17 src/rand.rs
  34. +47 −39 src/rsa/convert_nist_rsa_test_vectors.py
  35. +1 −1 src/rsa/padding.rs
  36. +52 −6 src/rsa/verification.rs
  37. +6 −4 src/signature.rs
  38. +0 −1 tests/aead_tests.rs
  39. +0 −1 tests/agreement_tests.rs
  40. +0 −1 tests/digest_tests.rs
  41. +0 −1 tests/ecdsa_tests.rs
  42. +0 −1 tests/ed25519_tests.rs
  43. +0 −1 tests/hkdf_tests.rs
  44. +0 −1 tests/hmac_tests.rs
  45. +0 −1 tests/pbkdf2_tests.rs
  46. +0 −1 tests/quic_tests.rs
  47. +1 −5 tests/rsa_pkcs1_sign_tests.txt
  48. +326 −6 tests/rsa_pkcs1_verify_tests.txt
  49. +55 −22 tests/rsa_tests.rs
  50. +0 −113 util/diff_asm.go
38 changes: 19 additions & 19 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -87,20 +87,14 @@ matrix:
os: linux
dist: trusty

- env: TARGET_X=x86_64-unknown-linux-gnu CC_X=gcc-7 FEATURES_X= MODE_X=DEBUG KCOV=1 RUST_X=stable
- env: TARGET_X=x86_64-unknown-linux-gnu CC_X=gcc-7 FEATURES_X= MODE_X=DEBUG KCOV=0 RUST_X=stable
rust: stable
os: linux
dist: trusty
addons:
apt:
packages:
- binutils-dev
- g++-7
- gcc-7
- libcurl4-openssl-dev
- libdw-dev
- libelf-dev
- libiberty-dev
sources:
- ubuntu-toolchain-r-test

@@ -187,24 +181,15 @@ matrix:
sources:
- ubuntu-toolchain-r-test

- env: TARGET_X=i686-unknown-linux-gnu CC_X=gcc-7 FEATURES_X= MODE_X=DEBUG KCOV=1 RUST_X=stable
- env: TARGET_X=i686-unknown-linux-gnu CC_X=gcc-7 FEATURES_X= MODE_X=DEBUG KCOV=0 RUST_X=stable
rust: stable
os: linux
dist: trusty
addons:
apt:
packages:
- g++-7
- g++-7-multilib
- gcc-7
- gcc-7-multilib
- libcurl3:i386
- libcurl4-openssl-dev:i386
- libdw-dev:i386
- libelf-dev:i386
- libiberty-dev:i386
- libkrb5-dev:i386
- libssl-dev:i386
- linux-libc-dev:i386
sources:
- ubuntu-toolchain-r-test
@@ -318,14 +303,20 @@ matrix:
os: linux
dist: trusty

- env: TARGET_X=x86_64-unknown-linux-gnu CC_X=gcc-7 FEATURES_X= MODE_X=DEBUG KCOV=0 RUST_X=nightly
- env: TARGET_X=x86_64-unknown-linux-gnu CC_X=gcc-7 FEATURES_X= MODE_X=DEBUG KCOV=1 RUST_X=nightly
rust: nightly
os: linux
dist: trusty
addons:
apt:
packages:
- binutils-dev
- g++-7
- gcc-7
- libcurl4-openssl-dev
- libdw-dev
- libelf-dev
- libiberty-dev
sources:
- ubuntu-toolchain-r-test

@@ -412,15 +403,24 @@ matrix:
sources:
- ubuntu-toolchain-r-test

- env: TARGET_X=i686-unknown-linux-gnu CC_X=gcc-7 FEATURES_X= MODE_X=DEBUG KCOV=0 RUST_X=nightly
- env: TARGET_X=i686-unknown-linux-gnu CC_X=gcc-7 FEATURES_X= MODE_X=DEBUG KCOV=1 RUST_X=nightly
rust: nightly
os: linux
dist: trusty
addons:
apt:
packages:
- g++-7
- g++-7-multilib
- gcc-7
- gcc-7-multilib
- libcurl3:i386
- libcurl4-openssl-dev:i386
- libdw-dev:i386
- libelf-dev:i386
- libiberty-dev:i386
- libkrb5-dev:i386
- libssl-dev:i386
- linux-libc-dev:i386
sources:
- ubuntu-toolchain-r-test
28 changes: 10 additions & 18 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -10,17 +10,11 @@ license-file = "LICENSE"
name = "ring"
readme = "doc/link-to-readme.md"
repository = "https://github.com/briansmith/ring"
version = "0.16.9"
version = "0.16.13"

# Prevent multiple versions of *ring* from being linked into the same program.
links = "ring-asm"

exclude = [
# The presence of .gitignore is used to differentiate non-packaged builds
# from packaged builds in build.rs.
".gitignore",
"pregenerated/tmp",
]
include = [
"LICENSE",
"Cargo.toml",
@@ -33,7 +27,6 @@ include = [
"crypto/chacha/asm/chacha-armv8.pl",
"crypto/chacha/asm/chacha-x86.pl",
"crypto/chacha/asm/chacha-x86_64.pl",
"crypto/cipher_extra/asm/aes128gcmsiv-x86_64.pl",
"crypto/cipher_extra/test/aes_128_gcm_siv_tests.txt",
"crypto/cipher_extra/test/aes_256_gcm_siv_tests.txt",
"crypto/constant_time_test.c",
@@ -301,42 +294,41 @@ include = [
name = "ring"

[dependencies]
untrusted = { version = "0.7.0" }
untrusted = { version = "0.7.1" }

[target.'cfg(all(any(target_arch = "aarch64", target_arch = "arm", target_arch = "x86", target_arch = "x86_64"), not(target_os = "ios")))'.dependencies]
spin = { version = "0.5.2", default-features = false }


[target.'cfg(any(target_os = "android", target_os = "linux"))'.dependencies]
libc = { version = "0.2.48", default-features = false }
libc = { version = "0.2.69", default-features = false }

[target.'cfg(target_os = "wasi")'.dependencies]
wasi = { version = "0.7", default-features = false }

[target.'cfg(any(target_os = "android", target_os = "freebsd", target_os = "linux", target_os = "netbsd", target_os = "openbsd", target_os = "solaris"))'.dependencies]
lazy_static = { version = "1.3", default-features = false, optional = true }
once_cell = { version = "1.3.1", default-features = false, features=["std"], optional = true }

[target.'cfg(all(target_arch = "wasm32", target_vendor = "unknown", target_os = "unknown", target_env = ""))'.dependencies]
web-sys = { version = "0.3.25", default-features = false, features = ["Crypto", "Window"] }
web-sys = { version = "0.3.37", default-features = false, features = ["Crypto", "Window"] }

[target.'cfg(target_os = "windows")'.dependencies]
winapi = { version = "0.3.7", default-features = false, features = ["ntsecapi", "wtypesbase"] }
winapi = { version = "0.3.8", default-features = false, features = ["ntsecapi", "wtypesbase"] }

[target.'cfg(target_arch = "wasm32")'.dev-dependencies]
wasm-bindgen-test = { version = "0.2.48", default-features = false }
wasm-bindgen-test = { version = "0.3.10", default-features = false }

[target.'cfg(any(unix, windows))'.dev-dependencies]
libc = { version = "0.2.48", default-features = false }
libc = { version = "0.2.69", default-features = false }

# Keep this in sync with `[dependencies]` in pregenerate_asm/Cargo.toml.
[build-dependencies]
cc = { version = "1.0.37", default-features = false }
cc = { version = "1.0.52", default-features = false }

[features]
# These features are documented in the top-level module's documentation.
default = ["alloc", "dev_urandom_fallback"]
alloc = []
dev_urandom_fallback = ["lazy_static"]
dev_urandom_fallback = ["once_cell"]
internal_benches = []
slow_tests = []
std = ["alloc"]
36 changes: 18 additions & 18 deletions build.rs
Original file line number Diff line number Diff line change
@@ -14,10 +14,14 @@

//! Build the non-Rust components.
// It seems like it would be a good idea to use `log!` for logging, but it
// isn't worth having the external dependencies (one for the `log` crate, and
// another for the concrete logging implementation). Instead we use `eprintln!`
// to log everything to stderr.

#![forbid(
anonymous_parameters,
box_pointers,
legacy_directory_ownership,
missing_copy_implementations,
missing_debug_implementations,
missing_docs,
@@ -47,7 +51,6 @@ const X86: &str = "x86";
const X86_64: &str = "x86_64";
const AARCH64: &str = "aarch64";
const ARM: &str = "arm";
const NEVER: &str = "Don't ever build this file.";

#[cfg_attr(rustfmt, rustfmt_skip)]
const RING_SRCS: &[(&[&str], &str)] = &[
@@ -81,9 +84,7 @@ const RING_SRCS: &[(&[&str], &str)] = &[
(&[X86_64], "crypto/fipsmodule/bn/asm/x86_64-mont.pl"),
(&[X86_64], "crypto/fipsmodule/bn/asm/x86_64-mont5.pl"),
(&[X86_64], "crypto/chacha/asm/chacha-x86_64.pl"),
(&[NEVER], "crypto/cipher_extra/asm/aes128gcmsiv-x86_64.pl"),
(&[X86_64], "crypto/fipsmodule/ec/asm/p256-x86_64-asm.pl"),
(&[NEVER], "crypto/fipsmodule/ec/asm/p256_beeu-x86_64-asm.pl"),
(&[X86_64], "crypto/fipsmodule/modes/asm/aesni-gcm-x86_64.pl"),
(&[X86_64], "crypto/fipsmodule/modes/asm/ghash-x86_64.pl"),
(&[X86_64], "crypto/poly1305/asm/poly1305-x86_64.pl"),
@@ -263,7 +264,7 @@ fn ring_build_rs_main() {
use std::env;

for (key, value) in env::vars() {
println!("{}: {}", key, value);
eprintln!("ENV {}={}", key, value);
}

let out_dir = env::var("OUT_DIR").unwrap();
@@ -419,18 +420,17 @@ fn build_c_code(target: &Target, pregenerated: PathBuf, out_dir: &Path) {

// XXX: Ideally, ring-test would only be built for `cargo test`, but Cargo
// can't do that yet.
libs.into_iter()
.for_each(|&(lib_name, srcs, additional_srcs)| {
build_library(
&target,
&out_dir,
lib_name,
srcs,
additional_srcs,
warnings_are_errors,
includes_modified,
)
});
libs.iter().for_each(|&(lib_name, srcs, additional_srcs)| {
build_library(
&target,
&out_dir,
lib_name,
srcs,
additional_srcs,
warnings_are_errors,
includes_modified,
)
});

println!(
"cargo:rustc-link-search=native={}",
@@ -650,7 +650,7 @@ where
}

fn run_command(mut cmd: Command) {
println!("running {:?}", cmd);
eprintln!("running {:?}", cmd);
let status = cmd.status().unwrap_or_else(|e| {
panic!("failed to execute [{:?}]: {}", cmd, e);
});
6 changes: 4 additions & 2 deletions crypto/chacha/asm/chacha-armv4.pl
Original file line number Diff line number Diff line change
@@ -44,9 +44,11 @@
( $xlate="${dir}../../perlasm/arm-xlate.pl" and -f $xlate) or
die "can't locate arm-xlate.pl";

open STDOUT,"| \"$^X\" $xlate $flavour $output";
open OUT,"| \"$^X\" $xlate $flavour $output";
*STDOUT=*OUT;
} else {
open STDOUT,">$output";
open OUT,">$output";
*STDOUT=*OUT;
}

sub AUTOLOAD() # thunk [simplified] x86-style perlasm
13 changes: 5 additions & 8 deletions crypto/chacha/asm/chacha-armv8.pl
Original file line number Diff line number Diff line change
@@ -131,12 +131,6 @@ sub ROUND {
.quad 0x3320646e61707865,0x6b20657479622d32 // endian-neutral
.Lone:
.long 1,0,0,0
.LGFp_armcap_P:
#ifdef __ILP32__
.long GFp_armcap_P-.
#else
.quad GFp_armcap_P-.
#endif
.asciz "ChaCha20 for ARMv8, CRYPTOGAMS by <appro\@openssl.org>"

.text
@@ -146,11 +140,14 @@ sub ROUND {
.align 5
GFp_ChaCha20_ctr32:
cbz $len,.Labort
#if __has_feature(hwaddress_sanitizer) && __clang_major__ >= 10
adrp @x[0],:pg_hi21_nc:GFp_armcap_P
#else
adrp @x[0],:pg_hi21:GFp_armcap_P
#endif
cmp $len,#192
b.lo .Lshort
add @x[0],@x[0],:lo12:GFp_armcap_P
ldr w17,[@x[0]]
ldr w17,[@x[0],:lo12:GFp_armcap_P]
tst w17,#ARMV7_NEON
b.ne ChaCha20_neon

Loading