repo
stringlengths
6
65
file_url
stringlengths
81
311
file_path
stringlengths
6
227
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 15:31:58
2026-01-04 20:25:31
truncated
bool
2 classes
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/device/src/bin/dev.rs
device/src/bin/dev.rs
//! Development device binary #![no_std] #![no_main] extern crate alloc; use core::cell::RefCell; use esp_hal::entry; use esp_storage::FlashStorage; use frostsnap_device::{esp32_run, peripherals::DevicePeripherals, resources::Resources}; #[entry] fn main() -> ! { // Initialize heap esp_alloc::heap_allocator...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/device/src/bin/widget_dev.rs
device/src/bin/widget_dev.rs
#![no_std] #![no_main] extern crate alloc; use esp_hal::{entry, timer::Timer as _}; use frostsnap_device::{peripherals::DevicePeripherals, touch_handler, DISPLAY_REFRESH_MS}; use frostsnap_widgets::debug::{EnabledDebug, OverlayDebug}; // Widget demo selection const DEMO: &str = "bip39_backup"; #[entry] fn main() -> ...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/device/src/bin/frontier.rs
device/src/bin/frontier.rs
//! Production device binary #![no_std] #![no_main] extern crate alloc; use core::cell::RefCell; use esp_hal::entry; use esp_storage::FlashStorage; use frostsnap_device::{esp32_run, peripherals::DevicePeripherals, resources::Resources}; #[entry] fn main() -> ! { // Initialize heap esp_alloc::heap_allocator!...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/device/src/flash/genuine_certificate.rs
device/src/flash/genuine_certificate.rs
use alloc::vec::Vec; use esp_storage::FlashStorage; use frostsnap_comms::genuine_certificate::Certificate; use frostsnap_core::Versioned; use frostsnap_embedded::FlashPartition; use frostsnap_embedded::ABWRITE_BINCODE_CONFIG; #[derive(Debug, Clone, bincode::Encode, bincode::Decode, PartialEq)] pub struct VersionedFact...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/device/src/flash/log.rs
device/src/flash/log.rs
use alloc::{boxed::Box, string::String}; use embedded_storage::nor_flash::NorFlash; use frostsnap_core::device::{self, SaveShareMutation}; use frostsnap_embedded::{AbSlot, FlashPartition, NorFlashLog}; #[derive(Debug, Clone, bincode::Encode, bincode::Decode)] pub enum Mutation { Core(device::Mutation), Name(St...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/device/src/flash/header.rs
device/src/flash/header.rs
use embedded_storage::nor_flash::NorFlash; use frostsnap_comms::{HasMagicBytes, MagicBytes, MAGIC_BYTES_LEN}; use frostsnap_core::schnorr_fun::fun::{KeyPair, Scalar}; use frostsnap_embedded::{AbSlot, FlashPartition}; use crate::efuse::EfuseHmacKey; #[derive(Debug, Clone, bincode::Encode, bincode::Decode)] pub struct ...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/device/src/factory/mod.rs
device/src/factory/mod.rs
pub mod init; pub use init::*;
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/device/src/factory/init.rs
device/src/factory/init.rs
use crate::flash::VersionedFactoryData; use crate::peripherals::DevicePeripherals; use alloc::boxed::Box; use core::cell::RefCell; use embedded_graphics::{ mono_font::{ascii::*, MonoTextStyle}, pixelcolor::Rgb565, prelude::*, }; use esp_storage::FlashStorage; use frostsnap_comms::{factory::*, ReceiveSerial}...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_core/src/map_ext.rs
frostsnap_core/src/map_ext.rs
use alloc::collections::BTreeMap; #[allow(unused)] /// Extension trait for BTreeMap providing a take_entry method pub trait BTreeMapExt<K, V> { /// Removes the entry for the given key and returns the value (if it existed) /// along with a vacant entry for reinsertion fn take_entry(&mut self, key: K) -> (Op...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_core/src/coord_nonces.rs
frostsnap_core/src/coord_nonces.rs
use crate::{nonce_stream::*, DeviceId}; use alloc::collections::*; #[derive(Default, Clone, Debug, PartialEq)] pub struct NonceCache { by_device: BTreeMap<DeviceId, BTreeMap<NonceStreamId, NonceStreamSegment>>, } impl NonceCache { pub fn extend_segment( &mut self, device_id: DeviceId, ...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_core/src/lib.rs
frostsnap_core/src/lib.rs
#![no_std] #[cfg(feature = "std")] #[macro_use] extern crate std; #[cfg(feature = "coordinator")] pub mod coord_nonces; pub mod device_nonces; mod macros; mod map_ext; mod master_appkey; pub mod message; pub mod nonce_stream; pub mod nostr; pub mod tweak; use core::ops::RangeBounds; use schnorr_fun::{ frost::{ch...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_core/src/device.rs
frostsnap_core/src/device.rs
use crate::device_nonces::{self, AbSlots, MemoryNonceSlot, NonceStreamSlot}; use crate::nonce_stream::CoordNonceStreamState; use crate::symmetric_encryption::{Ciphertext, SymmetricKey}; use crate::tweak::{self, Xpub}; use crate::{ bitcoin_transaction, message::*, AccessStructureId, AccessStructureKind, AccessStruct...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
true
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_core/src/tweak.rs
frostsnap_core/src/tweak.rs
use bitcoin::{ bip32::*, hashes::{sha512, Hash, HashEngine, Hmac, HmacEngine}, secp256k1, NetworkKind, }; use schnorr_fun::{ frost::{PairedSecretShare, SharedKey}, fun::{g, marker::*, Point, Scalar, G}, }; #[derive( Clone, Copy, Debug, PartialEq, bincode::Encode, bincode::Decode, Eq, Hash, Part...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_core/src/master_appkey.rs
frostsnap_core/src/master_appkey.rs
use crate::{ tweak::{AppTweakKind, TweakableKey, Xpub}, KeyId, }; use alloc::string::String; use schnorr_fun::fun::prelude::*; /// A 65-byte encoded point and chaincode. This is a byte array because it's easier to pass around byte /// arrays via FFI rather than `Point`. #[derive(Clone, Copy, PartialEq, Eq, Ord...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_core/src/symmetric_encryption.rs
frostsnap_core/src/symmetric_encryption.rs
use chacha20poly1305::{ aead::{AeadInPlace, KeyInit}, ChaCha20Poly1305, }; use core::marker::PhantomData; #[derive(Clone, Copy, Debug, bincode::Encode, bincode::Decode, PartialEq, Eq, Ord, PartialOrd)] pub struct Ciphertext<const N: usize, T> { data: [u8; N], nonce: [u8; 12], ty: PhantomData<T>, ...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_core/src/sqlite.rs
frostsnap_core/src/sqlite.rs
use crate::{DeviceId, KeyId, RestorationId}; use alloc::boxed::Box; use alloc::str::FromStr; use alloc::string::ToString; use rusqlite::{ types::{FromSql, FromSqlError, ToSqlOutput}, ToSql, }; impl FromSql for DeviceId { fn column_result(value: rusqlite::types::ValueRef<'_>) -> rusqlite::types::FromSqlResu...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_core/src/macros.rs
frostsnap_core/src/macros.rs
/// Implements Display, FromStr, Serialize and Deserialize for something that /// can be represented as a fixed length byte array #[macro_export] #[doc(hidden)] macro_rules! impl_fromstr_deserialize { ( name => $name:literal, fn from_bytes$(<$($tpl:ident $(: $tcl:ident)?),*>)?($input:ident : [u8;$l...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_core/src/nostr.rs
frostsnap_core/src/nostr.rs
use alloc::string::String; use alloc::vec::Vec; use schnorr_fun::fun::{marker::EvenY, Point}; use schnorr_fun::Signature; #[derive( Debug, Clone, serde::Serialize, serde::Deserialize, PartialEq, Eq, Hash, Ord, PartialOrd, )] pub struct UnsignedEvent { pub id: String, pubkey: Point<EvenY>, created_at: ...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_core/src/nonce_stream.rs
frostsnap_core/src/nonce_stream.rs
use alloc::collections::VecDeque; use schnorr_fun::binonce; #[derive(Debug, Clone, PartialEq, bincode::Encode, bincode::Decode)] pub struct NonceStreamSegment { pub stream_id: NonceStreamId, pub nonces: VecDeque<binonce::Nonce>, pub index: u32, } #[derive(Debug, Clone, PartialEq, bincode::Encode, bincode::...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_core/src/sign_task.rs
frostsnap_core/src/sign_task.rs
use crate::{bitcoin_transaction, device::KeyPurpose, tweak::AppTweak, MasterAppkey}; use alloc::{boxed::Box, string::String, vec::Vec}; use bitcoin::hashes::Hash; use schnorr_fun::{Message, Schnorr, Signature}; #[derive(Debug, Clone, bincode::Encode, bincode::Decode, PartialEq, Eq, Hash)] pub enum WireSignTask { T...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_core/src/device_nonces.rs
frostsnap_core/src/device_nonces.rs
use crate::{ device::DeviceSecretDerivation, nonce_stream::{CoordNonceStreamState, NonceStreamId, NonceStreamSegment}, SignSessionId, Versioned, }; use alloc::vec::Vec; use chacha20::{ cipher::{KeyIvInit, StreamCipher}, ChaCha20, }; use rand_core::RngCore; use schnorr_fun::{ binonce, frost::...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_core/src/message.rs
frostsnap_core/src/message.rs
use crate::device::KeyPurpose; use crate::nonce_stream::CoordNonceStreamState; use crate::{ AccessStructureId, AccessStructureRef, CheckedSignTask, CoordShareDecryptionContrib, Gist, KeygenId, MasterAppkey, SessionHash, ShareImage, SignSessionId, SignTaskError, Vec, }; use crate::{DeviceId, EnterPhysicalId, Kin...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_core/src/bitcoin_transaction.rs
frostsnap_core/src/bitcoin_transaction.rs
use alloc::vec::Vec; use alloc::{boxed::Box, collections::BTreeMap}; use bitcoin::{ consensus::Encodable, hashes::{sha256d, Hash}, key::TweakedPublicKey, sighash::SighashCache, OutPoint, Script, ScriptBuf, TapSighash, TxOut, Txid, }; use crate::{ tweak::{AppTweak, BitcoinBip32Path}, MasterA...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_core/src/coordinator.rs
frostsnap_core/src/coordinator.rs
use crate::{ coord_nonces::{NonceCache, NotEnoughNonces}, device::{KeyPurpose, NONCE_BATCH_SIZE}, map_ext::*, message::{signing::OpenNonceStreams, *}, nonce_stream::{CoordNonceStreamState, NonceStreamId}, symmetric_encryption::{Ciphertext, SymmetricKey}, tweak::Xpub, AccessStructureId, A...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
true
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_core/src/device/device_to_user.rs
frostsnap_core/src/device/device_to_user.rs
use crate::device_nonces::NonceJobBatch; use bitcoin::{address::NetworkChecked, Address}; use tweak::BitcoinBip32Path; use super::*; /// Messages to the user often to ask them to confirm things. Often confirmations contain what we /// call a "phase" which is both the data that describes the action and what will be pas...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_core/src/device/restoration.rs
frostsnap_core/src/device/restoration.rs
use crate::message::HeldShare2; use crate::EnterPhysicalId; use frost_backup::ShareBackup; use schnorr_fun::frost::SharedKey; use super::*; use alloc::fmt::Debug; #[derive(Clone, Debug, PartialEq, Default)] pub struct State { tmp_loaded_backups: BTreeMap<ShareImage, ShareBackup>, saved_backups: BTreeMap<Share...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_core/src/device/keys.rs
frostsnap_core/src/device/keys.rs
use crate::{device::KeyPurpose, AccessStructureKind, AccessStructureRef, KeyId, Kind}; use alloc::{boxed::Box, string::String}; use frostsnap_macros::Kind as KindDerive; #[derive(Clone, Debug, bincode::Encode, bincode::Decode, PartialEq, KindDerive)] pub enum KeyMutation { NewKey { key_id: KeyId, k...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_core/src/message/keygen.rs
frostsnap_core/src/message/keygen.rs
use schnorr_fun::frost::chilldkg::certpedpop::vrf_cert; use super::*; pub const VRF_CERT_SCHEME_ID: &str = "cert-vrf-v0"; #[derive(Clone, Debug, bincode::Encode, bincode::Decode, Kind)] pub enum Keygen { Begin(Begin), CertifyPlease { keygen_id: KeygenId, agg_input: certpedpop::AggKeygenInput,...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_core/src/message/screen_verify.rs
frostsnap_core/src/message/screen_verify.rs
use crate::{Kind, MasterAppkey}; use frostsnap_macros::Kind as KindDerive; /// Screen verification messages (for verifying addresses on device screens) #[derive(Clone, Debug, bincode::Encode, bincode::Decode, KindDerive)] pub enum ScreenVerify { VerifyAddress { master_appkey: MasterAppkey, derivati...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_core/src/message/signing.rs
frostsnap_core/src/message/signing.rs
use crate::{ nonce_stream::{CoordNonceStreamState, NonceStreamSegment}, Kind, SignSessionId, }; use alloc::{boxed::Box, vec::Vec}; use frostsnap_macros::Kind as KindDerive; use schnorr_fun::frost::SignatureShare; /// A request to open one or more nonce streams #[derive(Clone, Debug, bincode::Encode, bincode::D...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_core/src/coordinator/restoration.rs
frostsnap_core/src/coordinator/restoration.rs
use std::collections::BTreeSet; use super::keys; use super::*; use crate::{fail, message::HeldShare2, EnterPhysicalId, RestorationId}; #[derive(Clone, Debug, PartialEq)] pub struct RestorationState { pub restoration_id: RestorationId, pub key_name: String, pub access_structure: RecoveringAccessStructure, ...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
true
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_core/src/coordinator/signing.rs
frostsnap_core/src/coordinator/signing.rs
use crate::{nonce_stream::NonceStreamSegment, DeviceId, KeyId, Kind, SignSessionId}; use alloc::vec::Vec; use frostsnap_macros::Kind as KindDerive; use schnorr_fun::frost::SignatureShare; use super::FrostCoordinator; #[derive(Clone, Debug, bincode::Encode, bincode::Decode, PartialEq, KindDerive)] pub enum SigningMuta...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_core/src/coordinator/coordinator_to_user.rs
frostsnap_core/src/coordinator/coordinator_to_user.rs
use super::*; use frostsnap_macros::Kind; #[derive(Clone, Debug, Kind)] pub enum CoordinatorToUserMessage { KeyGen { keygen_id: KeygenId, inner: CoordinatorToUserKeyGenMessage, }, Signing(CoordinatorToUserSigningMessage), Restoration(super::restoration::ToUserRestoration), Replenish...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_core/src/coordinator/keys.rs
frostsnap_core/src/coordinator/keys.rs
use crate::coordinator::CompleteKey; use crate::tweak::Xpub; use crate::{ device::KeyPurpose, AccessStructureKind, AccessStructureRef, DeviceId, KeyId, KeygenId, Kind, }; use alloc::{collections::BTreeMap, collections::BTreeSet, string::String, vec::Vec}; use frostsnap_macros::Kind as KindDerive; use schnorr_fun::f...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_core/tests/endtoend.rs
frostsnap_core/tests/endtoend.rs
use common::TEST_ENCRYPTION_KEY; use frostsnap_core::bitcoin_transaction::{LocalSpk, TransactionTemplate}; use frostsnap_core::device::KeyPurpose; use frostsnap_core::tweak::BitcoinBip32Path; use frostsnap_core::EnterPhysicalId; use frostsnap_core::{MasterAppkey, WireSignTask}; use rand::seq::IteratorRandom; use rand_c...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_core/tests/restoration.rs
frostsnap_core/tests/restoration.rs
use common::TEST_ENCRYPTION_KEY; use frostsnap_core::device::KeyPurpose; use frostsnap_core::EnterPhysicalId; use rand_chacha::rand_core::SeedableRng; use rand_chacha::ChaCha20Rng; mod common; mod env; use crate::common::Run; use crate::env::TestEnv; #[test] fn restore_2_of_3_with_physical_backups_propagates_threshol...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_core/tests/share_location.rs
frostsnap_core/tests/share_location.rs
use common::TEST_ENCRYPTION_KEY; use frostsnap_core::coordinator::KeyLocationState; use frostsnap_core::device::KeyPurpose; use frostsnap_core::message::HeldShare2; use frostsnap_core::DeviceId; use rand_chacha::rand_core::SeedableRng; use rand_chacha::ChaCha20Rng; mod common; mod env; use crate::common::Run; use crat...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_core/tests/feerate_calculation.rs
frostsnap_core/tests/feerate_calculation.rs
use bitcoin::{Amount, ScriptBuf, TxOut}; use frostsnap_core::bitcoin_transaction::{LocalSpk, TransactionTemplate}; use frostsnap_core::tweak::BitcoinBip32Path; use frostsnap_core::MasterAppkey; use schnorr_fun::fun::G; /// Test that TransactionTemplate.feerate() correctly estimates the feerate /// of a signed transact...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_core/tests/proptest.rs
frostsnap_core/tests/proptest.rs
mod common; use common::*; use proptest::{ array, prelude::*, sample, test_runner::{Config, RngAlgorithm, TestRng}, }; use std::collections::{BTreeMap, BTreeSet}; use frostsnap_core::{ bitcoin_transaction::{LocalSpk, TransactionTemplate}, coordinator::{ BeginKeygen, CoordinatorToUserKey...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
true
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_core/tests/coordinator_backward_compat.rs
frostsnap_core/tests/coordinator_backward_compat.rs
/// Tests to ensure backward compatibility of coordinator mutations mod common; use frostsnap_core::coordinator::{ keys::KeyMutation, restoration::{PendingConsolidation, RestorationMutation}, signing::SigningMutation, ActiveSignSession, CompleteKey, CoordAccessStructure, Mutation, SignSessionProgress, ...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_core/tests/device_backward_compat.rs
frostsnap_core/tests/device_backward_compat.rs
/// Tests to ensure backward compatibility of device mutations mod common; use frost_backup::ShareBackup; use frostsnap_core::device::{ restoration::*, EncryptedSecretShare, KeyPurpose, Mutation, SaveShareMutation, }; use frostsnap_core::{AccessStructureId, AccessStructureKind, Kind}; use schnorr_fun::frost::{Secr...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_core/tests/malicious.rs
frostsnap_core/tests/malicious.rs
//! Tests for a malicious actions. A malicious coordinator, a malicious device or both. use common::TEST_ENCRYPTION_KEY; use env::TestEnv; use frostsnap_core::coordinator::{BeginKeygen, CoordinatorSend}; use frostsnap_core::device::KeyPurpose; use frostsnap_core::message::{ keygen::DeviceKeygen, CoordinatorToDevice...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_core/tests/nonce_generation.rs
frostsnap_core/tests/nonce_generation.rs
mod common; use common::TestDeviceKeyGen; use frostsnap_core::device_nonces::{NonceJobBatch, RatchetSeedMaterial, SecretNonceSlot}; use frostsnap_core::nonce_stream::NonceStreamId; #[test] fn test_nonce_generation_deterministic() { // Fixed test data let nonce_stream_id = NonceStreamId([ 0x01, 0x23, 0...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_core/tests/env/test_env.rs
frostsnap_core/tests/env/test_env.rs
use crate::common::{Env, Run, TestDeviceKeyGen, TEST_ENCRYPTION_KEY}; use bitcoin::Address; use frostsnap_core::coordinator::restoration::RecoverShare; use frostsnap_core::device::{self, DeviceToUserMessage}; use frostsnap_core::message::{self, DeviceSend, DeviceToCoordinatorMessage, EncodedSignature}; use frostsnap_co...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_core/tests/env/mod.rs
frostsnap_core/tests/env/mod.rs
mod test_env; pub use test_env::TestEnv;
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_core/tests/common/mod.rs
frostsnap_core/tests/common/mod.rs
use bitcoin::hashes::{sha256, Hash, HashEngine, Hmac, HmacEngine}; use frostsnap_core::device::{DeviceSecretDerivation, DeviceToUserMessage, KeyPurpose}; use frostsnap_core::message::{CoordinatorToDeviceMessage, DeviceSend, DeviceToCoordinatorMessage}; use frostsnap_core::{ coordinator::{ BeginKeygen, Coord...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_widgets/src/bobbing_carat.rs
frostsnap_widgets/src/bobbing_carat.rs
use crate::super_draw_target::SuperDrawTarget; use crate::{image::Image, translate::Translate, Widget}; use embedded_graphics::{ draw_target::DrawTarget, geometry::{Point, Size}, }; use embedded_iconoir::{prelude::IconoirNewIcon, size24px::navigation::NavArrowUp}; /// A carat icon that bobs up and down pub str...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_widgets/src/any_of.rs
frostsnap_widgets/src/any_of.rs
use crate::{AnyDynWidget, DynWidget, Instant, Widget}; use alloc::boxed::Box; use core::any::{Any, TypeId}; use embedded_graphics::{ draw_target::DrawTarget, geometry::{Point, Size}, }; /// A widget that can be any one of the types in the tuple T /// This provides type-safe dynamic dispatch for widgets pub str...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_widgets/src/cursor.rs
frostsnap_widgets/src/cursor.rs
use crate::palette::PALETTE; use crate::super_draw_target::SuperDrawTarget; use crate::Widget; use embedded_graphics::{ pixelcolor::Rgb565, prelude::*, primitives::{PrimitiveStyle, Rectangle}, }; // Font size matching the one used in bip39_input_preview const FONT_SIZE: Size = Size::new(16, 24); #[derive(...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_widgets/src/prelude.rs
frostsnap_widgets/src/prelude.rs
//! Common imports for frostsnap_widgets //! //! Import this module with `use crate::prelude::*;` to get access to commonly used traits and types. pub use crate::layout::*; pub use crate::text::Text; pub use crate::Instant; pub use crate::SuperDrawTarget; pub use crate::{DynWidget, Widget};
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_widgets/src/device_name.rs
frostsnap_widgets/src/device_name.rs
use super::{Column, Row, Text as TextWidget}; use crate::DefaultTextStyle; use crate::{cursor::Cursor, palette::PALETTE, prelude::*, GrayToAlpha, Image, Switcher}; use alloc::string::String; use embedded_graphics::{ pixelcolor::{Gray8, Rgb565}, text::renderer::TextRenderer, }; use tinybmp::Bmp; /// A widget fo...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_widgets/src/hold_to_confirm_border.rs
frostsnap_widgets/src/hold_to_confirm_border.rs
use super::{compressed_point::CompressedPoint, pixel_recorder::PixelRecorder, rat::Frac, Widget}; use crate::fader::FadingDrawTarget; use crate::super_draw_target::SuperDrawTarget; use alloc::vec::Vec; use embedded_graphics::{ draw_target::DrawTarget, pixelcolor::{BinaryColor, PixelColor, Rgb565}, prelude::...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_widgets/src/vec_framebuffer.rs
frostsnap_widgets/src/vec_framebuffer.rs
//! Vec-based framebuffer implementation for dynamic sizing //! This is a translation of embedded-graphics framebuffer that uses Vec instead of const generics use alloc::vec::Vec; use core::convert::Infallible; use embedded_graphics::{ draw_target::DrawTarget, geometry::{OriginDimensions, Point, Size}, ite...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_widgets/src/screen_test.rs
frostsnap_widgets/src/screen_test.rs
use crate::{ palette::PALETTE, DefaultTextStyle, DynWidget, HoldToConfirm, Instant, SuperDrawTarget, Text, Widget, FONT_MED, HOLD_TO_CONFIRM_TIME_SHORT_MS, }; use alloc::{format, vec::Vec}; use embedded_graphics::{ mono_font::{iso_8859_1::FONT_10X20, MonoTextStyle}, pixelcolor::Rgb565, prelude::*, ...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_widgets/src/lib.rs
frostsnap_widgets/src/lib.rs
#![no_std] #![allow(clippy::type_complexity)] #[cfg(feature = "std")] #[macro_use] extern crate std; #[macro_use] pub extern crate alloc; use embedded_graphics::prelude::*; pub mod compressed_point; pub mod palette; pub mod pixel_recorder; // Widget modules pub mod address_display; pub mod animation_speed; pub mod...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_widgets/src/address_display.rs
frostsnap_widgets/src/address_display.rs
use crate::{ any_of::AnyOf, layout::Column, p2tr_address_display::P2trAddressDisplay, palette::PALETTE, text::Text, DefaultTextStyle, MainAxisAlignment, FONT_HUGE_MONO, FONT_LARGE, }; use alloc::{ boxed::Box, string::{String, ToString}, }; use embedded_graphics::text::Alignment; use frostsnap_fonts::Gra...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_widgets/src/rat.rs
frostsnap_widgets/src/rat.rs
use core::fmt; use core::ops::{Add, Div, Mul, Sub}; /// The base denominator for rational number representation const DENOMINATOR: u32 = 10_000; /// A rational number represented as (numerator * DENOMINATOR) / denominator #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord)] pub struct Rat(pub(crate) u32); impl Rat...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_widgets/src/palette.rs
frostsnap_widgets/src/palette.rs
use embedded_graphics::pixelcolor::Rgb565; pub struct MaterialDarkPalette565 { pub primary: Rgb565, pub on_primary: Rgb565, pub primary_container: Rgb565, pub on_primary_container: Rgb565, pub secondary: Rgb565, pub on_secondary: Rgb565, pub secondary_container: Rgb565, pub on_secondar...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_widgets/src/animation_speed.rs
frostsnap_widgets/src/animation_speed.rs
use crate::Frac; /// Animation speed curve for controlling how animations progress over time #[derive(Clone, Copy, Debug, PartialEq)] pub enum AnimationSpeed { /// Linear interpolation - constant speed throughout Linear, /// Cubic bezier ease-out curve (0.0, 0.0, 0.58, 1.0) /// Starts fast and slows do...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_widgets/src/image.rs
frostsnap_widgets/src/image.rs
use crate::super_draw_target::SuperDrawTarget; use crate::Widget; use embedded_graphics::{ draw_target::DrawTarget, geometry::{Point, Size}, image::ImageDrawable, pixelcolor::PixelColor, prelude::*, primitives::Rectangle, Pixel, }; /// A widget that wraps any ImageDrawable as a widget pub s...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_widgets/src/fade_switcher.rs
frostsnap_widgets/src/fade_switcher.rs
use crate::super_draw_target::SuperDrawTarget; use crate::{DynWidget, Fader, Instant, Widget}; use embedded_graphics::{ draw_target::DrawTarget, geometry::{Point, Size}, pixelcolor::Rgb565, }; /// A widget that smoothly fades between widgets of the same type pub struct FadeSwitcher<T> where T: Widget<C...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_widgets/src/standby.rs
frostsnap_widgets/src/standby.rs
use crate::DefaultTextStyle; use crate::{ any_of::AnyOf, device_name::DeviceName, palette::PALETTE, prelude::*, FadeSwitcher, GrayToAlpha, }; use alloc::string::{String, ToString}; use embedded_graphics::{ pixelcolor::{Gray8, Rgb565}, text::Alignment, }; use frostsnap_core::message::HeldShare2; use tinybmp:...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_widgets/src/circle_button.rs
frostsnap_widgets/src/circle_button.rs
use crate::super_draw_target::SuperDrawTarget; use crate::{checkmark::Checkmark, palette::PALETTE, prelude::*}; use embedded_graphics::{ draw_target::DrawTarget, geometry::{Point, Size}, image::Image, pixelcolor::Rgb565, prelude::*, primitives::{Circle, PrimitiveStyleBuilder}, }; use embedded_ic...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_widgets/src/scroll_bar.rs
frostsnap_widgets/src/scroll_bar.rs
use crate::super_draw_target::SuperDrawTarget; use crate::{palette::PALETTE, Frac, Rat, Widget}; use embedded_graphics::{ pixelcolor::Rgb565, prelude::*, primitives::{PrimitiveStyleBuilder, Rectangle, RoundedRectangle}, }; pub const SCROLLBAR_WIDTH: u32 = 4; const MIN_INDICATOR_HEIGHT: u32 = 20; #[derive(...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_widgets/src/progress_bars.rs
frostsnap_widgets/src/progress_bars.rs
use crate::{palette::PALETTE, prelude::*}; use alloc::vec::Vec; use embedded_graphics::prelude::*; use frostsnap_macros::Widget; #[derive(Widget)] pub struct ProgressBars { #[widget_delegate] row: Row<Vec<Container<()>>>, } impl core::fmt::Debug for ProgressBars { fn fmt(&self, f: &mut core::fmt::Formatte...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_widgets/src/icons.rs
frostsnap_widgets/src/icons.rs
use crate::super_draw_target::SuperDrawTarget; use core::marker::PhantomData; use embedded_graphics::{geometry::Size, image::Image, pixelcolor::Rgb565, prelude::*}; use embedded_iconoir::{ icons::size24px::actions::Check, prelude::{IconoirIcon, IconoirNewIcon}, size32px::navigation::NavArrowLeft, }; #[der...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_widgets/src/sign_prompt.rs
frostsnap_widgets/src/sign_prompt.rs
use crate::DefaultTextStyle; use crate::{ address_display::AddressDisplay, any_of::AnyOf, bitcoin_amount_display::BitcoinAmountDisplay, icons::IconWidget, page_slider::PageSlider, palette::PALETTE, prelude::*, widget_list::WidgetList, HoldToConfirm, HOLD_TO_CONFIRM_TIME_MS, }; use alloc::{format, string::To...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_widgets/src/switcher.rs
frostsnap_widgets/src/switcher.rs
use crate::{FadeSwitcher, Widget}; use embedded_graphics::pixelcolor::Rgb565; /// A widget that switches between child widgets instantly without fading /// Uses FadeSwitcher internally but with 0 duration for instant switching #[derive(frostsnap_macros::Widget)] pub struct Switcher<W: Widget<Color = Rgb565>> { fad...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_widgets/src/share_index.rs
frostsnap_widgets/src/share_index.rs
use crate::DefaultTextStyle; use crate::{ layout::{MainAxisAlignment, Row}, palette::PALETTE, text::Text, }; use frostsnap_fonts::Gray4Font; /// A widget that displays a share index with "#" in secondary color and the number in primary #[derive(frostsnap_macros::Widget)] pub struct ShareIndexWidget { #...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_widgets/src/text.rs
frostsnap_widgets/src/text.rs
use super::Widget; use crate::{super_draw_target::SuperDrawTarget, Instant}; use alloc::string::String; use embedded_graphics::{ draw_target::DrawTarget, geometry::{Dimensions, Point, Size}, pixelcolor::PixelColor, prelude::*, primitives::{Line, PrimitiveStyle}, text::{ renderer::{Charac...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_widgets/src/debug.rs
frostsnap_widgets/src/debug.rs
use crate::{palette::PALETTE, prelude::*, string_ext::StringWrap, switcher::Switcher, Fps}; use alloc::collections::VecDeque; use alloc::string::String; use alloc::vec::Vec; use embedded_graphics::pixelcolor::Rgb565; #[cfg(target_arch = "riscv32")] use embedded_graphics::pixelcolor::RgbColor; use embedded_graphics::{ ...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_widgets/src/bitcoin_amount_display.rs
frostsnap_widgets/src/bitcoin_amount_display.rs
use crate::DefaultTextStyle; use crate::{palette::PALETTE, prelude::*, rat::FatRat}; use alloc::string::ToString; use embedded_graphics::{geometry::Size, pixelcolor::Rgb565}; // Type alias to reduce complexity type BitcoinAmountRow = Row<( Text, // Whole part + decimal point Text, // Fi...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_widgets/src/hold_to_confirm.rs
frostsnap_widgets/src/hold_to_confirm.rs
use crate::{ circle_button::{CircleButton, CircleButtonState}, hold_to_confirm_border::HoldToConfirmBorder, palette::PALETTE, prelude::*, rat::Frac, Fader, }; use alloc::boxed::Box; use embedded_graphics::{ draw_target::DrawTarget, geometry::{Point, Size}, pixelcolor::Rgb565, }; ///...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_widgets/src/page_slider.rs
frostsnap_widgets/src/page_slider.rs
use crate::super_draw_target::SuperDrawTarget; use crate::{palette::PALETTE, prelude::*, Fader, SlideInTransition, SwipeUpChevron, WidgetList}; use alloc::boxed::Box; use embedded_graphics::{ draw_target::DrawTarget, geometry::{Point, Size}, pixelcolor::Rgb565, }; const ANIMATION_DURATION_MS: u64 = 750; co...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_widgets/src/translate.rs
frostsnap_widgets/src/translate.rs
use crate::{ animation_speed::AnimationSpeed, vec_framebuffer::VecFramebuffer, Frac, Instant, Widget, }; use embedded_graphics::{ draw_target::DrawTarget, geometry::{Dimensions, Point, Size}, pixelcolor::BinaryColor, primitives::Rectangle, Pixel, }; /// Translation direction for the translate w...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_widgets/src/progress.rs
frostsnap_widgets/src/progress.rs
use crate::super_draw_target::SuperDrawTarget; use crate::DefaultTextStyle; use crate::{palette::PALETTE, Column, Frac, Switcher, Text as TextWidget, Widget, FONT_SMALL}; use alloc::format; use embedded_graphics::{ draw_target::DrawTarget, geometry::{Point, Size}, pixelcolor::Rgb565, primitives::{Primit...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_widgets/src/sign_message.rs
frostsnap_widgets/src/sign_message.rs
use crate::{ palette::PALETTE, prelude::*, string_ext::StringWrap, HoldToConfirm, Padding, FONT_MED, }; use crate::{DefaultTextStyle, HOLD_TO_CONFIRM_TIME_SHORT_MS, LEGACY_FONT_SMALL}; use alloc::string::String; use embedded_graphics::pixelcolor::Rgb565; use embedded_graphics::{geometry::Size, text::Alignment}; use...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_widgets/src/widget_list.rs
frostsnap_widgets/src/widget_list.rs
/// A trait for providing a list of widgets by index pub trait WidgetList<T> { /// Returns the number of widgets in the list fn len(&self) -> usize; /// Returns the widget at the given index, or None if out of bounds fn get(&self, index: usize) -> Option<T>; /// Returns true if the list is empty ...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_widgets/src/fader.rs
frostsnap_widgets/src/fader.rs
use super::{Frac, Widget}; use crate::animation_speed::AnimationSpeed; use crate::super_draw_target::SuperDrawTarget; use crate::widget_color::ColorInterpolate; use embedded_graphics::{ draw_target::DrawTarget, geometry::{Dimensions, Point, Size}, pixelcolor::Rgb565, primitives::Rectangle, Pixel, };...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_widgets/src/firmware_upgrade.rs
frostsnap_widgets/src/firmware_upgrade.rs
use crate::DefaultTextStyle; use crate::HOLD_TO_CONFIRM_TIME_SHORT_MS; use crate::{ palette::PALETTE, prelude::*, HoldToConfirm, Padding, ProgressIndicator, FONT_MED, FONT_SMALL, }; use alloc::{boxed::Box, format}; use embedded_graphics::{geometry::Size, text::Alignment}; /// Hold to confirm widget for firmware up...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_widgets/src/fps.rs
frostsnap_widgets/src/fps.rs
use crate::super_draw_target::SuperDrawTarget; use crate::{ string_ext::StringFixed, Container, DynWidget, Instant, Switcher, Text as TextWidget, Widget, }; use core::fmt::Write; use embedded_graphics::{ draw_target::DrawTarget, geometry::{Point, Size}, mono_font::{iso_8859_1::FONT_7X13, MonoTextStyle},...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_widgets/src/one_time_clear_hack.rs
frostsnap_widgets/src/one_time_clear_hack.rs
use crate::{ palette::PALETTE, DynWidget, Instant, KeyTouch, Sizing, SuperDrawTarget, Widget, WidgetColor, }; use core::ops::{Deref, DerefMut}; use embedded_graphics::{ draw_target::DrawTarget, geometry::{Point, Size}, pixelcolor::Rgb565, }; /// A temporary hack widget that clears the screen once befor...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_widgets/src/string_ext.rs
frostsnap_widgets/src/string_ext.rs
use alloc::string::String; use core::fmt::{self, Display, Write}; /// A fixed-size string that doesn't allocate /// Useful for formatting strings in no_std environments without allocations #[derive(Clone, Copy)] pub struct StringFixed<const N: usize> { buf: [u8; N], len: usize, characters_per_row: usize, ...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_widgets/src/slide_in_transition.rs
frostsnap_widgets/src/slide_in_transition.rs
use crate::super_draw_target::SuperDrawTarget; use crate::{ animation_speed::AnimationSpeed, fader::Fader, translate::Translate, DynWidget, Instant, Widget, }; use core::mem; use embedded_graphics::{ draw_target::DrawTarget, geometry::{Point, Size}, pixelcolor::Rgb565, }; /// A transition widget that s...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_widgets/src/super_draw_target.rs
frostsnap_widgets/src/super_draw_target.rs
use crate::Frac; use alloc::rc::Rc; use core::cell::{RefCell, RefMut}; use embedded_graphics::prelude::*; use embedded_graphics::primitives::Rectangle; pub struct SuperDrawTarget<D, C = <D as DrawTarget>::Color> where D: DrawTarget<Color = C>, C: crate::WidgetColor, { display: Rc<RefCell<D>>, crop_area...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_widgets/src/touch_listener.rs
frostsnap_widgets/src/touch_listener.rs
use crate::{DynWidget, Instant, Key, KeyTouch, Sizing, SuperDrawTarget, Widget}; use embedded_graphics::{ draw_target::DrawTarget, geometry::{Point, Size}, primitives::Rectangle, }; /// A widget that listens for touch events and converts them to KeyTouch events pub struct TouchListener<W> { pub child: ...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_widgets/src/swipe_up_chevron.rs
frostsnap_widgets/src/swipe_up_chevron.rs
use crate::DefaultTextStyle; use crate::{bobbing_carat::BobbingCarat, text::Text, Column, FONT_SMALL}; use embedded_graphics::pixelcolor::Rgb565; use frostsnap_macros::Widget; // Since Gray4TextStyle only works with Rgb565, we now specialize SwipeUpChevron for Rgb565 #[derive(Widget)] pub struct SwipeUpChevron { c...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_widgets/src/gray4_style.rs
frostsnap_widgets/src/gray4_style.rs
use embedded_graphics::{ draw_target::DrawTarget, geometry::{Point, Size}, pixelcolor::{GrayColor, Rgb565, RgbColor}, primitives::{Line, Primitive, PrimitiveStyle, Rectangle}, text::{ renderer::{CharacterStyle, TextMetrics, TextRenderer}, Baseline, DecorationColor, }, Drawabl...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_widgets/src/demo_widget.rs
frostsnap_widgets/src/demo_widget.rs
/// Macro for selecting and running demo widgets #[macro_export] macro_rules! demo_widget { ($demo:expr, $run_macro:ident) => { // Common imports for all demos use $crate::{ palette::PALETTE, HoldToConfirm, FONT_SMALL, FONT_MED, FONT_LARGE, prelude::*...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
true
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_widgets/src/compressed_point.rs
frostsnap_widgets/src/compressed_point.rs
use embedded_graphics::prelude::*; /// Compressed point representation using 3 bytes instead of 8 #[derive(Debug, Clone, Copy, PartialEq)] pub struct CompressedPoint { pub x: u8, pub y: u16, } impl CompressedPoint { pub fn new(point: Point) -> Self { Self { x: point.x as u8, ...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_widgets/src/key_touch.rs
frostsnap_widgets/src/key_touch.rs
use crate::palette::PALETTE; use crate::super_draw_target::SuperDrawTarget; use crate::{Container, DynWidget as _, Fader, SizedBox, Widget}; use embedded_graphics::{pixelcolor::Rgb565, prelude::*, primitives::Rectangle}; #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum Key { Keyboard(char), WordSelector(&...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_widgets/src/checkmark.rs
frostsnap_widgets/src/checkmark.rs
use super::{pixel_recorder::PixelRecorder, Widget}; use crate::{ compressed_point::CompressedPoint, super_draw_target::SuperDrawTarget, Frac, Instant, Rat, }; use alloc::vec::Vec; use embedded_graphics::{ draw_target::DrawTarget, geometry::{Point, Size}, pixelcolor::{BinaryColor, PixelColor}, prelud...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_widgets/src/p2tr_address_display.rs
frostsnap_widgets/src/p2tr_address_display.rs
use crate::{ palette::PALETTE, text::Text, Column, DefaultTextStyle, MainAxisAlignment, Row, FONT_HUGE_MONO, }; use alloc::{boxed::Box, string::String, vec::Vec}; use frostsnap_fonts::Gray4Font; // Font for displaying addresses - uses monospace for better readability const ADDRESS_FONT: &Gray4Font = FONT_HUGE_MONO...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_widgets/src/bitmap.rs
frostsnap_widgets/src/bitmap.rs
use crate::vec_framebuffer::VecFramebuffer; use alloc::vec::Vec; use bincode::{Decode, Encode}; use embedded_graphics::{pixelcolor::BinaryColor, prelude::*}; #[derive(Debug, Clone, Copy, Encode, Decode)] enum ImageColor { Binary = 0x00, } #[derive(Debug, Encode, Decode)] pub struct EncodedImage { color: Image...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_widgets/src/keygen_check.rs
frostsnap_widgets/src/keygen_check.rs
use super::{Column, Container, HoldToConfirm, Padding, Row, Text}; use crate::HOLD_TO_CONFIRM_TIME_MS; use crate::DefaultTextStyle; use crate::{palette::PALETTE, MainAxisAlignment}; use alloc::format; use embedded_graphics::geometry::Size; type CodeText = Text; type TofNText = Text; type CodeColumn = Column<(TofNText...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_widgets/src/pixel_recorder.rs
frostsnap_widgets/src/pixel_recorder.rs
use crate::compressed_point::CompressedPoint; use alloc::vec::Vec; use embedded_graphics::{draw_target::DrawTarget, pixelcolor::BinaryColor, prelude::*}; /// A DrawTarget implementation that records pixel positions instead of drawing them. /// Useful for pre-computing pixel locations for animations. pub struct PixelRe...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_widgets/src/widget_color.rs
frostsnap_widgets/src/widget_color.rs
use crate::Frac; use embedded_graphics::pixelcolor::{ BinaryColor, Gray2, Gray4, GrayColor, PixelColor, Rgb565, RgbColor, }; /// Trait for colors that can be interpolated pub trait ColorInterpolate: PixelColor { /// Interpolate between two colors. Returns a color that is `frac` of the way from `self` to `other...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_widgets/src/layout/sized_box.rs
frostsnap_widgets/src/layout/sized_box.rs
use crate::super_draw_target::SuperDrawTarget; use crate::Widget; use embedded_graphics::{ draw_target::DrawTarget, pixelcolor::{PixelColor, Rgb565}, prelude::*, }; /// A simple widget that has a fixed size but no content #[derive(Debug, PartialEq)] pub struct SizedBox<C = Rgb565> { size: Size, _ph...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_widgets/src/layout/column.rs
frostsnap_widgets/src/layout/column.rs
use super::{AssociatedArray, CrossAxisAlignment, MainAxisAlignment, MainAxisSize}; use crate::super_draw_target::SuperDrawTarget; use crate::{Instant, Widget}; use alloc::vec::Vec; use embedded_graphics::{ draw_target::DrawTarget, geometry::{Point, Size}, primitives::Rectangle, }; /// A column widget that ...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false
frostsnap/frostsnap
https://github.com/frostsnap/frostsnap/blob/961deb080a81c754f402aaea24286bd141178e9d/frostsnap_widgets/src/layout/row.rs
frostsnap_widgets/src/layout/row.rs
use super::{AssociatedArray, CrossAxisAlignment, MainAxisAlignment, MainAxisSize}; use crate::super_draw_target::SuperDrawTarget; use crate::{Instant, Widget}; use alloc::vec::Vec; use embedded_graphics::{ draw_target::DrawTarget, geometry::{Point, Size}, primitives::Rectangle, }; /// A row widget that arr...
rust
MIT
961deb080a81c754f402aaea24286bd141178e9d
2026-01-04T20:21:09.467677Z
false