Skip to content

Commit

Permalink
increased attest bcrypt difficulty to 8
Browse files Browse the repository at this point in the history
  • Loading branch information
Athryx committed Mar 10, 2024
1 parent 5b6dfbd commit c2a00b6
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion application_processor/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ fn main() {
let HashResult {
salt,
hash,
} = hash(pin, 7).expect("could not hash pin");
} = hash(pin, 8).expect("could not hash pin");

rust_code.push_str(&format!("pub const PIN_HASH: [u8; {}] = {:?};\n", hash.len(), hash.as_slice()));
rust_code.push_str(&format!("pub const PIN_SALT: [u8; {}] = {:?};\n", salt.len(), salt.as_slice()));
Expand Down
2 changes: 1 addition & 1 deletion application_processor/src/attest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ fn attempt_attest(driver: &mut ApDriver) -> Result<(), ApError> {
let pin= recv_input_with_message("Enter pin: ", &mut buf)
.ok_or(ApError::InvalidInput)?;

let hash = hash(pin.as_bytes(), &PIN_SALT, 7);
let hash = hash(pin.as_bytes(), &PIN_SALT, 8);

const_time_equal_or_error_jump_table!(
hash.as_slice(),
Expand Down
1 change: 0 additions & 1 deletion application_processor/src/post_boot/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use core::cell::RefCell;
use core::ffi::c_int;
use core::ptr;
use core::slice;
Expand Down
3 changes: 2 additions & 1 deletion component/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ fn process_scan(driver: &mut ComponentDriver) -> Result<(), ComponentError> {

fn process_attest(driver: &mut ComponentDriver) -> Result<(), ComponentError> {
// I think this should make getting rng samples a little harder
sleep(Duration::from_millis(300));
// this amount of sleeping leaves a 20 milliseconds extra under 300 for the whole attest process
sleep(Duration::from_millis(70));

let nonce = driver.gen_nonce();
driver.send_struct(nonce)?;
Expand Down

0 comments on commit c2a00b6

Please sign in to comment.