Skip to content

Commit

Permalink
replace sha3 with keccak in few comments
Browse files Browse the repository at this point in the history
  • Loading branch information
debris committed Aug 31, 2017
1 parent ba3b271 commit e9cc4c8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions ethash/src/compute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ fn keccak_512(input: &[u8], output: &mut [u8]) {
}

fn keccak_512_inplace(input: &mut [u8]) {
// This is safe since `sha3_*` uses an internal buffer and copies the result to the output. This
// This is safe since `keccak_*` uses an internal buffer and copies the result to the output. This
// means that we can reuse the input buffer for both input and output.
unsafe { hash::keccak_512(input.as_mut_ptr(), input.len(), input.as_ptr(), input.len()) };
}
Expand Down Expand Up @@ -335,7 +335,7 @@ fn hash_compute(light: &Light, full_size: usize, header_hash: &H256, nonce: u64)
mem::size_of::<u64>(),
);

// compute sha3-512 hash and replicate across mix
// compute keccak-512 hash and replicate across mix
hash::keccak_512(
out.as_mut_ptr(),
NODE_BYTES,
Expand Down
8 changes: 4 additions & 4 deletions util/rlp/src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@ lazy_static! {
}

static EMPTY_RLPS: &'static [&'static [u8]] = &[
// RLP of SHA3_NULL_RLP
// RLP of KECCAK_NULL_RLP
&[160, 86, 232, 31, 23, 27, 204, 85, 166, 255, 131, 69, 230, 146, 192, 248, 110, 91, 72, 224, 27, 153, 108, 173, 192, 1, 98, 47, 181, 227, 99, 180, 33],
// RLP of SHA3_EMPTY
// RLP of KECCAK_EMPTY
&[160, 197, 210, 70, 1, 134, 247, 35, 60, 146, 126, 125, 178, 220, 199, 3, 192, 229, 0, 182, 83, 202, 130, 39, 59, 123, 250, 216, 4, 93, 133, 164, 112]
];

static COMMON_RLPS: &'static [&'static [u8]] = &[
// RLP of SHA3_NULL_RLP
// RLP of KECCAK_NULL_RLP
&[160, 86, 232, 31, 23, 27, 204, 85, 166, 255, 131, 69, 230, 146, 192, 248, 110, 91, 72, 224, 27, 153, 108, 173, 192, 1, 98, 47, 181, 227, 99, 180, 33],
// RLP of SHA3_EMPTY
// RLP of KECCAK_EMPTY
&[160, 197, 210, 70, 1, 134, 247, 35, 60, 146, 126, 125, 178, 220, 199, 3, 192, 229, 0, 182, 83, 202, 130, 39, 59, 123, 250, 216, 4, 93, 133, 164, 112],
// Other RLPs found in blocks DB using the test below.
&[160, 29, 204, 77, 232, 222, 199, 93, 122, 171, 133, 181, 103, 182, 204, 212, 26, 211, 18, 69, 27, 148, 138, 116, 19, 240, 161, 66, 253, 64, 212, 147, 71],
Expand Down

0 comments on commit e9cc4c8

Please sign in to comment.