Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
set(DBB-FIRMWARE-SOURCES
${CMAKE_SOURCE_DIR}/src/firmware_main_loop.c
${CMAKE_SOURCE_DIR}/src/delay.c
${CMAKE_SOURCE_DIR}/src/keystore.c
${CMAKE_SOURCE_DIR}/src/random.c
${CMAKE_SOURCE_DIR}/src/hardfault.c
${CMAKE_SOURCE_DIR}/src/util.c
Expand Down Expand Up @@ -569,6 +568,10 @@ if(CMAKE_CROSSCOMPILING)
target_link_libraries(${elf} PRIVATE "-Wl,-Map=\"${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${firmware}.map\" -T\"${CMAKE_SOURCE_DIR}/firmware.ld\"")
target_link_libraries(${elf} PRIVATE -Wl,--defsym=STACK_SIZE=${STACK_SIZE} -Wl,-defsym=HEAP_SIZE=${HEAP_SIZE})

# Link the Rust static library before its C dependencies. Static library resolution is
# left-to-right.
target_link_libraries(${elf} PRIVATE ${firmware}_rust_c)

target_link_libraries(${elf} PRIVATE secp256k1)
target_link_libraries(${elf} PRIVATE ${QTOUCHLIB_A} ${QTOUCHLIB_B} ${QTOUCHLIB_T})

Expand All @@ -578,8 +581,6 @@ if(CMAKE_CROSSCOMPILING)
target_compile_options(${elf} PRIVATE --specs=nosys.specs)
target_link_libraries(${elf} PRIVATE --specs=nosys.specs)

target_link_libraries(${elf} PRIVATE ${firmware}_rust_c)

# Optiga config must be defined both when compiling the optiga lib, and also when compiling our
# sources. We can verify this include is indeed used by our sources - when you point it to a
# non-existing file, compilation fails.
Expand Down
1 change: 0 additions & 1 deletion src/common_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#include "driver_init.h"
#include "flags.h"
#include "hardfault.h"
#include "keystore.h"
#include "memory/memory.h"
#include "memory/mpu.h"
#include "memory/smarteeprom.h"
Expand Down
1 change: 0 additions & 1 deletion src/hww.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#include "hww.h"

#include <hardfault.h>
#include <keystore.h>
#include <memory/memory.h>
#include <version.h>

Expand Down
71 changes: 0 additions & 71 deletions src/keystore.c

This file was deleted.

89 changes: 0 additions & 89 deletions src/keystore.h

This file was deleted.

1 change: 0 additions & 1 deletion src/reset.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

#include "da14531/da14531.h"
#include "hardfault.h"
#include "keystore.h"
#include "memory/memory.h"
#include "memory/memory_shared.h"
#include "system.h"
Expand Down
4 changes: 2 additions & 2 deletions src/rust/bitbox02-rust/src/hww/api/bitcoin/signmsg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ pub async fn process(
let host_nonce = match request.host_nonce_commitment {
// Engage in the anti-klepto protocol if the host sends a host nonce commitment.
Some(pb::AntiKleptoHostNonceCommitment { ref commitment }) => {
let signer_commitment = keystore::secp256k1_nonce_commit(
let signer_commitment = crate::secp256k1::secp256k1_nonce_commit(
keystore::secp256k1_get_private_key(hal, keypath)?
.as_slice()
.try_into()
Expand All @@ -117,7 +117,7 @@ pub async fn process(
None => [0; 32],
};

let sign_result = keystore::secp256k1_sign(
let sign_result = crate::secp256k1::secp256k1_sign(
keystore::secp256k1_get_private_key(hal, keypath)?
.as_slice()
.try_into()
Expand Down
4 changes: 2 additions & 2 deletions src/rust/bitbox02-rust/src/hww/api/bitcoin/signtx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1237,7 +1237,7 @@ async fn _process(
// Engage in the Anti-Klepto protocol if the host sends a host nonce commitment.
let host_nonce: [u8; 32] = match tx_input.host_nonce_commitment {
Some(pb::AntiKleptoHostNonceCommitment { ref commitment }) => {
let signer_commitment = crate::keystore::secp256k1_nonce_commit(
let signer_commitment = crate::secp256k1::secp256k1_nonce_commit(
private_key.as_slice().try_into().unwrap(),
&sighash,
commitment
Expand All @@ -1261,7 +1261,7 @@ async fn _process(
None => [0; 32],
};

let sign_result = crate::keystore::secp256k1_sign(
let sign_result = crate::secp256k1::secp256k1_sign(
private_key.as_slice().try_into().unwrap(),
&sighash,
&host_nonce,
Expand Down
4 changes: 2 additions & 2 deletions src/rust/bitbox02-rust/src/hww/api/ethereum/sign.rs
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ pub async fn _process(
let host_nonce = match request.host_nonce_commitment() {
// Engage in the anti-klepto protocol if the host sends a host nonce commitment.
Some(pb::AntiKleptoHostNonceCommitment { commitment }) => {
let signer_commitment = keystore::secp256k1_nonce_commit(
let signer_commitment = crate::secp256k1::secp256k1_nonce_commit(
&keystore::secp256k1_get_private_key(hal, request.keypath())?
.as_slice()
.try_into()
Expand All @@ -407,7 +407,7 @@ pub async fn _process(
// Return signature directly without the anti-klepto protocol, for backwards compatibility.
None => [0; 32],
};
let sign_result = keystore::secp256k1_sign(
let sign_result = crate::secp256k1::secp256k1_sign(
&keystore::secp256k1_get_private_key(hal, request.keypath())?
.as_slice()
.try_into()
Expand Down
4 changes: 2 additions & 2 deletions src/rust/bitbox02-rust/src/hww/api/ethereum/sign_typed_msg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ pub async fn process(

let host_nonce = match request.host_nonce_commitment {
Some(pb::AntiKleptoHostNonceCommitment { ref commitment }) => {
let signer_commitment = keystore::secp256k1_nonce_commit(
let signer_commitment = crate::secp256k1::secp256k1_nonce_commit(
keystore::secp256k1_get_private_key(hal, &request.keypath)?
.as_slice()
.try_into()
Expand All @@ -581,7 +581,7 @@ pub async fn process(
_ => return Err(Error::InvalidInput),
};

let sign_result = keystore::secp256k1_sign(
let sign_result = crate::secp256k1::secp256k1_sign(
keystore::secp256k1_get_private_key(hal, &request.keypath)?
.as_slice()
.try_into()
Expand Down
4 changes: 2 additions & 2 deletions src/rust/bitbox02-rust/src/hww/api/ethereum/signmsg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ pub async fn process(
let host_nonce = match request.host_nonce_commitment {
// Engage in the anti-klepto protocol if the host sends a host nonce commitment.
Some(pb::AntiKleptoHostNonceCommitment { ref commitment }) => {
let signer_commitment = keystore::secp256k1_nonce_commit(
let signer_commitment = crate::secp256k1::secp256k1_nonce_commit(
keystore::secp256k1_get_private_key(hal, &request.keypath)?
.as_slice()
.try_into()
Expand All @@ -86,7 +86,7 @@ pub async fn process(
None => [0; 32],
};

let sign_result = keystore::secp256k1_sign(
let sign_result = crate::secp256k1::secp256k1_sign(
keystore::secp256k1_get_private_key(hal, &request.keypath)?
.as_slice()
.try_into()
Expand Down
Loading