replace sha3 with keccak in few comments

This commit is contained in:
debris 2017-08-31 15:25:30 +02:00
parent ba3b2712a1
commit e9cc4c848b
2 changed files with 6 additions and 6 deletions

View File

@ -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()) };
}
@ -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,

View File

@ -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],