Useful to hash update files to check integrity
(data: &[u8])
| 2036 | |
| 2037 | /// Useful to hash update files to check integrity |
| 2038 | fn hash(data: &[u8]) { |
| 2039 | let mut sha256_hasher = Sha256::new(); |
| 2040 | let mut sha384_hasher = Sha384::new(); |
| 2041 | let mut sha512_hasher = Sha512::new(); |
| 2042 | |
| 2043 | sha256_hasher.update(data); |
| 2044 | sha384_hasher.update(data); |
| 2045 | sha512_hasher.update(data); |
| 2046 | |
| 2047 | let sha256 = &sha256_hasher.finalize()[..]; |
| 2048 | let sha384 = &sha384_hasher.finalize()[..]; |
| 2049 | let sha512 = &sha512_hasher.finalize()[..]; |
| 2050 | |
| 2051 | println!("Hashes"); |
| 2052 | print!(" SHA256: "); |
| 2053 | util::print_buffer(sha256); |
| 2054 | print!(" SHA384: "); |
| 2055 | util::print_buffer(sha384); |
| 2056 | print!(" SHA512: "); |
| 2057 | util::print_buffer(sha512); |
| 2058 | } |
| 2059 | |
| 2060 | fn print_board_ids(ec: &CrosEc) { |
| 2061 | println!("Board IDs"); |
no test coverage detected