Skip to content

Commit 4497196

Browse files
authored
Auto merge of #37439 - michaelwoerister:remove-sha256, r=alexcrichton
Replace all uses of SHA-256 with BLAKE2b. Removes the SHA-256 implementation and replaces all uses of it with BLAKE2b, which we already use for debuginfo type guids and incremental compilation hashes. It doesn't make much sense to have two different cryptographic hash implementations in the compiler and Blake has a few advantages over SHA-2 (computationally less expensive, hashes of up to 512 bits).
2 parents 8f1fc86 + 9ef9194 commit 4497196

File tree

17 files changed

+154
-812
lines changed

17 files changed

+154
-812
lines changed

mk/crates.mk

+1-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ DEPS_rustc_driver := arena flate getopts graphviz libc rustc rustc_back rustc_bo
121121
rustc_trans rustc_privacy rustc_lint rustc_plugin \
122122
rustc_metadata syntax_ext proc_macro_plugin \
123123
rustc_passes rustc_save_analysis rustc_const_eval \
124-
rustc_incremental syntax_pos rustc_errors proc_macro
124+
rustc_incremental syntax_pos rustc_errors proc_macro rustc_data_structures
125125
DEPS_rustc_errors := log libc serialize syntax_pos
126126
DEPS_rustc_lint := rustc log syntax syntax_pos rustc_const_eval
127127
DEPS_rustc_llvm := native:rustllvm libc std rustc_bitflags

src/Cargo.lock

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/librustc/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,6 @@ pub mod traits;
111111
pub mod ty;
112112

113113
pub mod util {
114-
pub use rustc_back::sha2;
115-
116114
pub mod common;
117115
pub mod ppaux;
118116
pub mod nodemap;

src/librustc/ty/util.rs

+5
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
405405
///
406406
/// The same goes for endianess: We always convert multi-byte integers to little
407407
/// endian before hashing.
408+
#[derive(Debug)]
408409
pub struct ArchIndependentHasher<H> {
409410
inner: H,
410411
}
@@ -413,6 +414,10 @@ impl<H> ArchIndependentHasher<H> {
413414
pub fn new(inner: H) -> ArchIndependentHasher<H> {
414415
ArchIndependentHasher { inner: inner }
415416
}
417+
418+
pub fn into_inner(self) -> H {
419+
self.inner
420+
}
416421
}
417422

418423
impl<H: Hasher> Hasher for ArchIndependentHasher<H> {

src/librustc_back/lib.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,8 @@
3636
#![feature(rand)]
3737
#![feature(rustc_private)]
3838
#![feature(staged_api)]
39-
#![feature(step_by)]
4039
#![cfg_attr(stage0, feature(question_mark))]
41-
#![cfg_attr(test, feature(test, rand))]
40+
#![cfg_attr(test, feature(rand))]
4241

4342
extern crate syntax;
4443
extern crate libc;
@@ -48,7 +47,6 @@ extern crate serialize;
4847
extern crate serialize as rustc_serialize; // used by deriving
4948

5049
pub mod tempdir;
51-
pub mod sha2;
5250
pub mod target;
5351
pub mod slice;
5452
pub mod dynamic_lib;

0 commit comments

Comments
 (0)