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
2 changes: 1 addition & 1 deletion ledger_device_sdk/src/io_legacy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ impl Comm {
}

/// Send the currently held APDU
// This is private. Users should call reply to set the satus word and
// This is private. Users should call reply to set the status word and
// transmit the response.
fn apdu_send(&mut self) {
#[cfg(any(
Expand Down
10 changes: 5 additions & 5 deletions ledger_device_sdk/src/nvm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ pub trait SingleStorage<T> {
/// unfinished write detection in SafeStorage and atomic operations in
/// AtomicStorage).
///
/// Warning: this wrapper does not provide any garantee about update atomicity.
/// Warning: this wrapper does not provide any guarantee about update atomicity.
#[repr(align(64))]
#[derive(Copy, Clone)]
pub struct AlignedStorage<T> {
Expand All @@ -99,7 +99,7 @@ impl<T> SingleStorage<T> for AlignedStorage<T> {
&self.value
}

/// Update the value by writting to the NVM memory.
/// Update the value by writing to the NVM memory.
/// Warning: this can be vulnerable to tearing - leading to partial write.
fn update(&mut self, value: &T) {
unsafe {
Expand All @@ -114,7 +114,7 @@ impl<T> SingleStorage<T> for AlignedStorage<T> {
}

/// Just a non-zero magic to mark a storage as valid, when the update procedure
/// has not been interupted. Any value excepted 0 and 0xff may work.
/// has not been interrupted. Any value excepted 0 and 0xff may work.
const STORAGE_VALID: u8 = 0xa5;

/// Non-Volatile data storage, with a flag to detect corruption if the update
Expand Down Expand Up @@ -175,7 +175,7 @@ macro_rules! atomic_storage {
pub struct AtomicStorage<T> {
// We must keep the storage B in another page, so when we update the
// storage A, erasing the page of A won't modify the storage for B.
// This is currently garanteed by the alignment of AlignedStorage.
// This is currently guaranteed by the alignment of AlignedStorage.
storage_a: SafeStorage<T>,
storage_b: SafeStorage<T>, // We also accept situations where both storages are marked as valid, which
// can happen with tearing. This is not a problem, and we consider the first
Expand Down Expand Up @@ -240,7 +240,7 @@ where
}
}

/// Update the value by writting to the NVM memory.
/// Update the value by writing to the NVM memory.
/// Warning: this can be vulnerable to tearing - leading to partial write.
fn update(&mut self, value: &T) {
match self.which() {
Expand Down
4 changes: 2 additions & 2 deletions ledger_secure_sdk_sys/link.ld
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ SECTIONS
_etext = .;
} > FLASH :flash0

/* Relocations, read only, no relocations aginst the relocations themselves
/* Relocations, read only, no relocations against the relocations themselves
needed! */
_reloc_size = SIZEOF(.rel.rodata) + SIZEOF(.rel.data) + SIZEOF(.rel.nvm_data);
.rel_flash : ALIGN(PAGE_SIZE)
Expand All @@ -48,7 +48,7 @@ SECTIONS
relocations are needed. (So not read-only completely.) */
.rodata : ALIGN(PAGE_SIZE)
{
/* Moved here from .text so we can permantly apply relocations to it with
/* Moved here from .text so we can permanently apply relocations to it with
nvm_write() */
. = ALIGN(PAGE_SIZE);
_rodata = .;
Expand Down
2 changes: 1 addition & 1 deletion ledger_secure_sdk_sys/src/c/src.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ void link_pass(
PRINTHEXC("First reloc: ", reloc_start->r_offset);

// Loop over the rodata entries - we could loop over the
// correct seciton, but this also works.
// correct section, but this also works.
for (Elf32_Rel* reloc = reloc_start; reloc < reloc_end; reloc++) {
// This is the (absolute) elf *load* address of the relocation.
link_addr_t abs_offset = reloc->r_offset;
Expand Down