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
ProjectZKM/zkm
https://github.com/ProjectZKM/zkm/blob/eb09cf6c81bed9717bc98e4a4c9a61f54787a351/prover/src/arithmetic/lui.rs
prover/src/arithmetic/lui.rs
//! Support for the LUI instructions. rt = imm << 16 //! //! This crate verifies an LUI instruction, which takes two //! 32-bit inputs S and A, and produces a 32-bit output C satisfying //! //! C = A << 16 (mod 2^32) for LUI //! //! The way this computation is carried is by providing a third input //! B = 1 << 16...
rust
MIT
eb09cf6c81bed9717bc98e4a4c9a61f54787a351
2026-01-04T20:21:15.281276Z
false
ProjectZKM/zkm
https://github.com/ProjectZKM/zkm/blob/eb09cf6c81bed9717bc98e4a4c9a61f54787a351/prover/src/arithmetic/mod.rs
prover/src/arithmetic/mod.rs
pub mod addcy; pub mod arithmetic_stark; pub mod columns; pub mod div; pub mod lo_hi; pub mod lui; pub mod mul; pub mod mult; pub mod shift; pub mod slt; pub mod sra; pub mod utils; use crate::witness::util::sign_extend; use plonky2::field::types::PrimeField64; #[derive(Clone, Copy, Debug, Eq, PartialEq)] pub(crate) ...
rust
MIT
eb09cf6c81bed9717bc98e4a4c9a61f54787a351
2026-01-04T20:21:15.281276Z
false
ProjectZKM/zkm
https://github.com/ProjectZKM/zkm/blob/eb09cf6c81bed9717bc98e4a4c9a61f54787a351/prover/src/arithmetic/addcy.rs
prover/src/arithmetic/addcy.rs
//! Support for MIPS instructions ADD, SUB, LT and GT //! //! This crate verifies MIPS instructions ADD, SUB, LT and GT (i.e. for //! unsigned inputs). Each of these instructions can be verified using //! the "add with carry out" equation //! //! X + Y = Z + CY * 2^32 //! //! by an appropriate assignment of "inputs" ...
rust
MIT
eb09cf6c81bed9717bc98e4a4c9a61f54787a351
2026-01-04T20:21:15.281276Z
false
ProjectZKM/zkm
https://github.com/ProjectZKM/zkm/blob/eb09cf6c81bed9717bc98e4a4c9a61f54787a351/prover/src/arithmetic/arithmetic_stark.rs
prover/src/arithmetic/arithmetic_stark.rs
use std::marker::PhantomData; use std::ops::Range; use plonky2::field::extension::{Extendable, FieldExtension}; use plonky2::field::packed::PackedField; use plonky2::field::polynomial::PolynomialValues; use plonky2::field::types::Field; use plonky2::hash::hash_types::RichField; use plonky2::iop::ext_target::ExtensionT...
rust
MIT
eb09cf6c81bed9717bc98e4a4c9a61f54787a351
2026-01-04T20:21:15.281276Z
false
ProjectZKM/zkm
https://github.com/ProjectZKM/zkm/blob/eb09cf6c81bed9717bc98e4a4c9a61f54787a351/prover/src/arithmetic/mul.rs
prover/src/arithmetic/mul.rs
//! Support for the MIPS MUL instruction. //! //! This crate verifies an MIPS MUL instruction, which takes two //! 32-bit inputs A and B, and produces a 32-bit output C satisfying //! //! C = A*B (mod 2^32), //! //! i.e. C is the lower half of the usual long multiplication //! A*B. Inputs A and B, and output C, are ...
rust
MIT
eb09cf6c81bed9717bc98e4a4c9a61f54787a351
2026-01-04T20:21:15.281276Z
false
ProjectZKM/zkm
https://github.com/ProjectZKM/zkm/blob/eb09cf6c81bed9717bc98e4a4c9a61f54787a351/prover/src/generation/state.rs
prover/src/generation/state.rs
// use keccak_hash::keccak; use crate::cpu::kernel::assembler::Kernel; use crate::proof::PublicValues; use crate::witness::errors::ProgramError; use crate::witness::memory::MemoryState; use crate::witness::state::RegistersState; use crate::witness::traces::{TraceCheckpoint, Traces}; use plonky2::field::extension::Exten...
rust
MIT
eb09cf6c81bed9717bc98e4a4c9a61f54787a351
2026-01-04T20:21:15.281276Z
false
ProjectZKM/zkm
https://github.com/ProjectZKM/zkm/blob/eb09cf6c81bed9717bc98e4a4c9a61f54787a351/prover/src/generation/mod.rs
prover/src/generation/mod.rs
pub(crate) mod outputs; pub mod state; use crate::generation::state::{AssumptionReceipts, AssumptionUsage}; use crate::proof::{MemRoots, PublicValues}; use anyhow::anyhow; use plonky2::field::extension::Extendable; use plonky2::field::polynomial::PolynomialValues; use plonky2::hash::hash_types::RichField; use plonky2::...
rust
MIT
eb09cf6c81bed9717bc98e4a4c9a61f54787a351
2026-01-04T20:21:15.281276Z
false
ProjectZKM/zkm
https://github.com/ProjectZKM/zkm/blob/eb09cf6c81bed9717bc98e4a4c9a61f54787a351/prover/src/generation/outputs.rs
prover/src/generation/outputs.rs
use plonky2::field::extension::Extendable; use plonky2::hash::hash_types::RichField; use plonky2::plonk::config::GenericConfig; use crate::generation::state::GenerationState; use crate::witness::errors::ProgramError; #[derive(Clone, Debug)] pub struct GenerationOutputs { pub output: Vec<u8>, } pub(crate) fn get_...
rust
MIT
eb09cf6c81bed9717bc98e4a4c9a61f54787a351
2026-01-04T20:21:15.281276Z
false
ProjectZKM/zkm
https://github.com/ProjectZKM/zkm/blob/eb09cf6c81bed9717bc98e4a4c9a61f54787a351/prover/src/sha_compress_sponge/sha_compress_sponge_stark.rs
prover/src/sha_compress_sponge/sha_compress_sponge_stark.rs
use crate::constraint_consumer::{ConstraintConsumer, RecursiveConstraintConsumer}; use crate::cross_table_lookup::{Column, Filter}; use crate::evaluation_frame::{StarkEvaluationFrame, StarkFrame}; use crate::memory::segments::Segment; use crate::sha_compress::wrapping_add_2::{ wrapping_add_2_ext_circuit_constraints...
rust
MIT
eb09cf6c81bed9717bc98e4a4c9a61f54787a351
2026-01-04T20:21:15.281276Z
false
ProjectZKM/zkm
https://github.com/ProjectZKM/zkm/blob/eb09cf6c81bed9717bc98e4a4c9a61f54787a351/prover/src/sha_compress_sponge/columns.rs
prover/src/sha_compress_sponge/columns.rs
use crate::sha_compress::wrapping_add_2::WrappingAdd2Op; use crate::util::{indices_arr, transmute_no_compile_time_size_checks}; use std::borrow::{Borrow, BorrowMut}; use std::mem::transmute; pub(crate) struct ShaCompressSpongeColumnsView<T: Copy> { pub hx: [T; 32], // a, b, c,..., h after compress pub outp...
rust
MIT
eb09cf6c81bed9717bc98e4a4c9a61f54787a351
2026-01-04T20:21:15.281276Z
false
ProjectZKM/zkm
https://github.com/ProjectZKM/zkm/blob/eb09cf6c81bed9717bc98e4a4c9a61f54787a351/prover/src/sha_compress_sponge/mod.rs
prover/src/sha_compress_sponge/mod.rs
pub mod columns; pub mod constants; pub mod sha_compress_sponge_stark;
rust
MIT
eb09cf6c81bed9717bc98e4a4c9a61f54787a351
2026-01-04T20:21:15.281276Z
false
ProjectZKM/zkm
https://github.com/ProjectZKM/zkm/blob/eb09cf6c81bed9717bc98e4a4c9a61f54787a351/prover/src/sha_compress_sponge/constants.rs
prover/src/sha_compress_sponge/constants.rs
pub const SHA_COMPRESS_K: [u32; 64] = [ 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5c...
rust
MIT
eb09cf6c81bed9717bc98e4a4c9a61f54787a351
2026-01-04T20:21:15.281276Z
false
ProjectZKM/zkm
https://github.com/ProjectZKM/zkm/blob/eb09cf6c81bed9717bc98e4a4c9a61f54787a351/prover/src/poseidon/columns.rs
prover/src/poseidon/columns.rs
use crate::poseidon::constants::{HALF_N_FULL_ROUNDS, SPONGE_WIDTH}; use plonky2::hash::poseidon::N_PARTIAL_ROUNDS; pub const FILTER: usize = 0; const START_IN: usize = FILTER + 1; pub const fn reg_in(i: usize) -> usize { debug_assert!(i < SPONGE_WIDTH); START_IN + i } const START_OUT: usize = START_IN + SPONGE...
rust
MIT
eb09cf6c81bed9717bc98e4a4c9a61f54787a351
2026-01-04T20:21:15.281276Z
false
ProjectZKM/zkm
https://github.com/ProjectZKM/zkm/blob/eb09cf6c81bed9717bc98e4a4c9a61f54787a351/prover/src/poseidon/poseidon_stark.rs
prover/src/poseidon/poseidon_stark.rs
use std::marker::PhantomData; use itertools::Itertools; use plonky2::field::extension::{Extendable, FieldExtension}; use plonky2::field::packed::PackedField; use plonky2::field::polynomial::PolynomialValues; use plonky2::field::types::Field; use plonky2::field::types::PrimeField64; use plonky2::hash::hash_types::RichF...
rust
MIT
eb09cf6c81bed9717bc98e4a4c9a61f54787a351
2026-01-04T20:21:15.281276Z
false
ProjectZKM/zkm
https://github.com/ProjectZKM/zkm/blob/eb09cf6c81bed9717bc98e4a4c9a61f54787a351/prover/src/poseidon/mod.rs
prover/src/poseidon/mod.rs
pub mod columns; pub mod constants; pub mod poseidon_stark;
rust
MIT
eb09cf6c81bed9717bc98e4a4c9a61f54787a351
2026-01-04T20:21:15.281276Z
false
ProjectZKM/zkm
https://github.com/ProjectZKM/zkm/blob/eb09cf6c81bed9717bc98e4a4c9a61f54787a351/prover/src/poseidon/constants.rs
prover/src/poseidon/constants.rs
pub const SPONGE_RATE: usize = 8; pub const SPONGE_CAPACITY: usize = 4; pub const SPONGE_WIDTH: usize = SPONGE_RATE + SPONGE_CAPACITY; pub const HALF_N_FULL_ROUNDS: usize = 4; pub const N_FULL_ROUNDS_TOTAL: usize = 2 * HALF_N_FULL_ROUNDS; pub const N_PARTIAL_ROUNDS: usize = 22; pub const N_ROUNDS: usize = N_FULL_ROUNDS...
rust
MIT
eb09cf6c81bed9717bc98e4a4c9a61f54787a351
2026-01-04T20:21:15.281276Z
false
ProjectZKM/zkm
https://github.com/ProjectZKM/zkm/blob/eb09cf6c81bed9717bc98e4a4c9a61f54787a351/prover/src/keccak/keccak_stark.rs
prover/src/keccak/keccak_stark.rs
use std::marker::PhantomData; use itertools::Itertools; use plonky2::field::extension::{Extendable, FieldExtension}; use plonky2::field::packed::PackedField; use plonky2::field::polynomial::PolynomialValues; use plonky2::field::types::Field; use plonky2::hash::hash_types::RichField; use plonky2::iop::ext_target::Exten...
rust
MIT
eb09cf6c81bed9717bc98e4a4c9a61f54787a351
2026-01-04T20:21:15.281276Z
false
ProjectZKM/zkm
https://github.com/ProjectZKM/zkm/blob/eb09cf6c81bed9717bc98e4a4c9a61f54787a351/prover/src/keccak/round_flags.rs
prover/src/keccak/round_flags.rs
use plonky2::field::extension::Extendable; use plonky2::field::packed::PackedField; use plonky2::field::types::Field; use plonky2::hash::hash_types::RichField; use plonky2::iop::ext_target::ExtensionTarget; use plonky2::plonk::circuit_builder::CircuitBuilder; use crate::constraint_consumer::{ConstraintConsumer, Recurs...
rust
MIT
eb09cf6c81bed9717bc98e4a4c9a61f54787a351
2026-01-04T20:21:15.281276Z
false
ProjectZKM/zkm
https://github.com/ProjectZKM/zkm/blob/eb09cf6c81bed9717bc98e4a4c9a61f54787a351/prover/src/keccak/columns.rs
prover/src/keccak/columns.rs
use plonky2::field::types::Field; use crate::cross_table_lookup::Column; use crate::keccak::keccak_stark::{NUM_INPUTS, NUM_ROUNDS}; /// A register which is set to 1 if we are in the `i`th round, otherwise 0. pub const fn reg_step(i: usize) -> usize { debug_assert!(i < NUM_ROUNDS); i } /// Registers to hold p...
rust
MIT
eb09cf6c81bed9717bc98e4a4c9a61f54787a351
2026-01-04T20:21:15.281276Z
false
ProjectZKM/zkm
https://github.com/ProjectZKM/zkm/blob/eb09cf6c81bed9717bc98e4a4c9a61f54787a351/prover/src/keccak/mod.rs
prover/src/keccak/mod.rs
pub mod columns; pub mod constants; pub mod keccak_stark; pub mod logic; pub mod round_flags;
rust
MIT
eb09cf6c81bed9717bc98e4a4c9a61f54787a351
2026-01-04T20:21:15.281276Z
false
ProjectZKM/zkm
https://github.com/ProjectZKM/zkm/blob/eb09cf6c81bed9717bc98e4a4c9a61f54787a351/prover/src/keccak/constants.rs
prover/src/keccak/constants.rs
const RC: [u64; 24] = [ 0x0000000000000001, 0x0000000000008082, 0x800000000000808A, 0x8000000080008000, 0x000000000000808B, 0x0000000080000001, 0x8000000080008081, 0x8000000000008009, 0x000000000000008A, 0x0000000000000088, 0x0000000080008009, 0x000000008000000A, 0x00...
rust
MIT
eb09cf6c81bed9717bc98e4a4c9a61f54787a351
2026-01-04T20:21:15.281276Z
false
ProjectZKM/zkm
https://github.com/ProjectZKM/zkm/blob/eb09cf6c81bed9717bc98e4a4c9a61f54787a351/prover/src/keccak/logic.rs
prover/src/keccak/logic.rs
use plonky2::field::extension::Extendable; use plonky2::field::packed::PackedField; use plonky2::field::types::PrimeField64; use plonky2::hash::hash_types::RichField; use plonky2::iop::ext_target::ExtensionTarget; use plonky2::plonk::circuit_builder::CircuitBuilder; pub(crate) fn xor<F: PrimeField64, const N: usize>(x...
rust
MIT
eb09cf6c81bed9717bc98e4a4c9a61f54787a351
2026-01-04T20:21:15.281276Z
false
ProjectZKM/zkm
https://github.com/ProjectZKM/zkm/blob/eb09cf6c81bed9717bc98e4a4c9a61f54787a351/prover/tests/simple_recursion.rs
prover/tests/simple_recursion.rs
#![allow(clippy::upper_case_acronyms)] use plonky2::field::goldilocks_field::GoldilocksField; use plonky2::field::types::Field; use plonky2::iop::witness::{PartialWitness, WitnessWrite}; use plonky2::plonk::circuit_builder::CircuitBuilder; use plonky2::plonk::circuit_data::CircuitConfig; use plonky2::plonk::config::Pos...
rust
MIT
eb09cf6c81bed9717bc98e4a4c9a61f54787a351
2026-01-04T20:21:15.281276Z
false
ProjectZKM/zkm
https://github.com/ProjectZKM/zkm/blob/eb09cf6c81bed9717bc98e4a4c9a61f54787a351/prover/examples/prove-large-seg/src/main.rs
prover/examples/prove-large-seg/src/main.rs
use std::env; use zkm_emulator::utils::{get_block_path, split_seg_into_segs}; use zkm_utils::utils; fn prove_large_segment() { let basedir = env::var("BASEDIR").unwrap_or("/tmp/cannon".to_string()); let block = env::var("BLOCK_NO").unwrap_or("".to_string()); let file = env::var("BLOCK_FILE").unwrap_or(Stri...
rust
MIT
eb09cf6c81bed9717bc98e4a4c9a61f54787a351
2026-01-04T20:21:15.281276Z
false
ProjectZKM/zkm
https://github.com/ProjectZKM/zkm/blob/eb09cf6c81bed9717bc98e4a4c9a61f54787a351/prover/examples/prove-seg/src/main.rs
prover/examples/prove-seg/src/main.rs
use std::env; use zkm_utils::utils; fn prove_segments() { let basedir = env::var("BASEDIR").unwrap_or("/tmp/cannon".to_string()); let block = env::var("BLOCK_NO").unwrap_or("".to_string()); let file = env::var("BLOCK_FILE").unwrap_or(String::from("")); let seg_dir = env::var("SEG_FILE_DIR").expect("seg...
rust
MIT
eb09cf6c81bed9717bc98e4a4c9a61f54787a351
2026-01-04T20:21:15.281276Z
false
ProjectZKM/zkm
https://github.com/ProjectZKM/zkm/blob/eb09cf6c81bed9717bc98e4a4c9a61f54787a351/prover/examples/split-seg/src/main.rs
prover/examples/split-seg/src/main.rs
use std::env; use zkm_emulator::utils::{ get_block_path, load_elf_with_patch, split_prog_into_segs, SEGMENT_STEPS, }; fn split_segments() { // 1. split ELF into segs let basedir = env::var("BASEDIR").unwrap_or("/tmp/output".to_string()); let elf_path = env::var("ELF_PATH").expect("ELF file is missing")...
rust
MIT
eb09cf6c81bed9717bc98e4a4c9a61f54787a351
2026-01-04T20:21:15.281276Z
false
ProjectZKM/zkm
https://github.com/ProjectZKM/zkm/blob/eb09cf6c81bed9717bc98e4a4c9a61f54787a351/prover/examples/sha2-composition/guest/src/main.rs
prover/examples/sha2-composition/guest/src/main.rs
#![no_std] #![no_main] use sha2::{Digest, Sha256}; extern crate alloc; use alloc::vec::Vec; zkm_runtime::entrypoint!(main); pub fn main() { let public_input: Vec<u8> = zkm_runtime::io::read(); let input: [u8; 32] = zkm_runtime::io::read(); let elf_id: Vec<u8> = zkm_runtime::io::read(); zkm_runtime::...
rust
MIT
eb09cf6c81bed9717bc98e4a4c9a61f54787a351
2026-01-04T20:21:15.281276Z
false
ProjectZKM/zkm
https://github.com/ProjectZKM/zkm/blob/eb09cf6c81bed9717bc98e4a4c9a61f54787a351/prover/examples/sha2-composition/host/build.rs
prover/examples/sha2-composition/host/build.rs
fn main() { zkm_build::build_program(&format!("{}/../guest", env!("CARGO_MANIFEST_DIR"))); }
rust
MIT
eb09cf6c81bed9717bc98e4a4c9a61f54787a351
2026-01-04T20:21:15.281276Z
false
ProjectZKM/zkm
https://github.com/ProjectZKM/zkm/blob/eb09cf6c81bed9717bc98e4a4c9a61f54787a351/prover/examples/sha2-composition/host/src/main.rs
prover/examples/sha2-composition/host/src/main.rs
use std::env; use plonky2::plonk::config::{GenericConfig, PoseidonGoldilocksConfig}; use zkm_emulator::utils::{load_elf_with_patch, split_prog_into_segs}; use zkm_prover::generation::state::{AssumptionReceipts, Receipt}; use zkm_utils::utils::prove_segments; const D: usize = 2; type C = PoseidonGoldilocksConfig; typ...
rust
MIT
eb09cf6c81bed9717bc98e4a4c9a61f54787a351
2026-01-04T20:21:15.281276Z
false
ProjectZKM/zkm
https://github.com/ProjectZKM/zkm/blob/eb09cf6c81bed9717bc98e4a4c9a61f54787a351/prover/examples/sha2-rust/guest/src/main.rs
prover/examples/sha2-rust/guest/src/main.rs
#![no_std] #![no_main] use sha2::{Digest, Sha256}; extern crate alloc; use alloc::vec::Vec; zkm_runtime::entrypoint!(main); pub fn main() { let public_input: Vec<u8> = zkm_runtime::io::read(); let input: Vec<u8> = zkm_runtime::io::read(); let mut hasher = Sha256::new(); hasher.update(input); let...
rust
MIT
eb09cf6c81bed9717bc98e4a4c9a61f54787a351
2026-01-04T20:21:15.281276Z
false
ProjectZKM/zkm
https://github.com/ProjectZKM/zkm/blob/eb09cf6c81bed9717bc98e4a4c9a61f54787a351/prover/examples/sha2-rust/host/build.rs
prover/examples/sha2-rust/host/build.rs
fn main() { zkm_build::build_program(&format!("{}/../guest", env!("CARGO_MANIFEST_DIR"))); }
rust
MIT
eb09cf6c81bed9717bc98e4a4c9a61f54787a351
2026-01-04T20:21:15.281276Z
false
ProjectZKM/zkm
https://github.com/ProjectZKM/zkm/blob/eb09cf6c81bed9717bc98e4a4c9a61f54787a351/prover/examples/sha2-rust/host/src/main.rs
prover/examples/sha2-rust/host/src/main.rs
use std::env; use zkm_emulator::utils::{load_elf_with_patch, split_prog_into_segs}; use zkm_utils::utils::prove_segments; const ELF_PATH: &str = "../guest/elf/mips-zkm-zkvm-elf"; fn prove_sha2_rust() { // 1. split ELF into segs let seg_path = env::var("SEG_OUTPUT").expect("Segment output path is missing"); ...
rust
MIT
eb09cf6c81bed9717bc98e4a4c9a61f54787a351
2026-01-04T20:21:15.281276Z
false
ProjectZKM/zkm
https://github.com/ProjectZKM/zkm/blob/eb09cf6c81bed9717bc98e4a4c9a61f54787a351/prover/examples/utils/src/lib.rs
prover/examples/utils/src/lib.rs
pub mod utils;
rust
MIT
eb09cf6c81bed9717bc98e4a4c9a61f54787a351
2026-01-04T20:21:15.281276Z
false
ProjectZKM/zkm
https://github.com/ProjectZKM/zkm/blob/eb09cf6c81bed9717bc98e4a4c9a61f54787a351/prover/examples/utils/src/utils.rs
prover/examples/utils/src/utils.rs
use std::fs::File; use std::io::BufReader; use std::ops::Range; use std::time::Duration; use plonky2::plonk::config::{GenericConfig, PoseidonGoldilocksConfig}; use plonky2::util::timing::TimingTree; use plonky2x::backend::circuit::Groth16WrapperParameters; use plonky2x::backend::wrapper::wrap::WrappedCircuit; use plon...
rust
MIT
eb09cf6c81bed9717bc98e4a4c9a61f54787a351
2026-01-04T20:21:15.281276Z
false
ProjectZKM/zkm
https://github.com/ProjectZKM/zkm/blob/eb09cf6c81bed9717bc98e4a4c9a61f54787a351/prover/examples/sha2-syscall/guest/src/consts.rs
prover/examples/sha2-syscall/guest/src/consts.rs
#![allow(dead_code, clippy::unreadable_literal)] pub const STATE_LEN: usize = 8; pub const BLOCK_LEN: usize = 16; pub type State256 = [u32; STATE_LEN]; pub type State512 = [u64; STATE_LEN]; /// Constants necessary for SHA-256 family of digests. pub const K32: [u32; 64] = [ 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0x...
rust
MIT
eb09cf6c81bed9717bc98e4a4c9a61f54787a351
2026-01-04T20:21:15.281276Z
false
ProjectZKM/zkm
https://github.com/ProjectZKM/zkm/blob/eb09cf6c81bed9717bc98e4a4c9a61f54787a351/prover/examples/sha2-syscall/guest/src/lib.rs
prover/examples/sha2-syscall/guest/src/lib.rs
//! An implementation of the [SHA-2][1] cryptographic hash algorithms. //! //! There are 6 standard algorithms specified in the SHA-2 standard: [`Sha224`], //! [`Sha256`], [`Sha512_224`], [`Sha512_256`], [`Sha384`], and [`Sha512`]. //! //! Algorithmically, there are only 2 core algorithms: SHA-256 and SHA-512. //! All ...
rust
MIT
eb09cf6c81bed9717bc98e4a4c9a61f54787a351
2026-01-04T20:21:15.281276Z
false
ProjectZKM/zkm
https://github.com/ProjectZKM/zkm/blob/eb09cf6c81bed9717bc98e4a4c9a61f54787a351/prover/examples/sha2-syscall/guest/src/core_api.rs
prover/examples/sha2-syscall/guest/src/core_api.rs
use crate::consts; use core::{fmt, slice::from_ref}; use digest::{ block_buffer::Eager, core_api::{ AlgorithmName, Block, BlockSizeUser, Buffer, BufferKindUser, OutputSizeUser, TruncSide, UpdateCore, VariableOutputCore, }, typenum::{Unsigned, U32, U64}, HashMarker, InvalidOutputSize,...
rust
MIT
eb09cf6c81bed9717bc98e4a4c9a61f54787a351
2026-01-04T20:21:15.281276Z
false
ProjectZKM/zkm
https://github.com/ProjectZKM/zkm/blob/eb09cf6c81bed9717bc98e4a4c9a61f54787a351/prover/examples/sha2-syscall/guest/src/main.rs
prover/examples/sha2-syscall/guest/src/main.rs
#![no_std] #![no_main] extern crate alloc; use alloc::vec::Vec; pub use digest::{self, Digest}; #[cfg(feature = "oid")] use digest::const_oid::{AssociatedOid, ObjectIdentifier}; use digest::{ consts::{U28, U32}, core_api::{CoreWrapper, CtVariableCoreWrapper}, impl_oid_carrier, }; #[rustfmt::skip] mod co...
rust
MIT
eb09cf6c81bed9717bc98e4a4c9a61f54787a351
2026-01-04T20:21:15.281276Z
false
ProjectZKM/zkm
https://github.com/ProjectZKM/zkm/blob/eb09cf6c81bed9717bc98e4a4c9a61f54787a351/prover/examples/sha2-syscall/host/build.rs
prover/examples/sha2-syscall/host/build.rs
fn main() { zkm_build::build_program(&format!("{}/../guest", env!("CARGO_MANIFEST_DIR"))); }
rust
MIT
eb09cf6c81bed9717bc98e4a4c9a61f54787a351
2026-01-04T20:21:15.281276Z
false
ProjectZKM/zkm
https://github.com/ProjectZKM/zkm/blob/eb09cf6c81bed9717bc98e4a4c9a61f54787a351/prover/examples/sha2-syscall/host/src/main.rs
prover/examples/sha2-syscall/host/src/main.rs
use std::env; use zkm_emulator::utils::{load_elf_with_patch, split_prog_into_segs}; use zkm_utils::utils::prove_segments; const ELF_PATH: &str = "../guest/elf/mips-zkm-zkvm-elf"; fn prove_sha2_rust() { // 1. split ELF into segs let seg_path = env::var("SEG_OUTPUT").expect("Segment output path is missing"); ...
rust
MIT
eb09cf6c81bed9717bc98e4a4c9a61f54787a351
2026-01-04T20:21:15.281276Z
false
ProjectZKM/zkm
https://github.com/ProjectZKM/zkm/blob/eb09cf6c81bed9717bc98e4a4c9a61f54787a351/prover/examples/sha2-go/host/src/main.rs
prover/examples/sha2-go/host/src/main.rs
use serde::{Deserialize, Serialize}; use std::env; use zkm_emulator::utils::{load_elf_with_patch, split_prog_into_segs}; use zkm_utils::utils::prove_segments; #[derive(Debug, Clone, Deserialize, Serialize)] pub enum DataId { TYPE1, TYPE2, TYPE3, } #[derive(Debug, Clone, Deserialize, Serialize)] pub struc...
rust
MIT
eb09cf6c81bed9717bc98e4a4c9a61f54787a351
2026-01-04T20:21:15.281276Z
false
ProjectZKM/zkm
https://github.com/ProjectZKM/zkm/blob/eb09cf6c81bed9717bc98e4a4c9a61f54787a351/prover/examples/keccak/guest/src/main.rs
prover/examples/keccak/guest/src/main.rs
#![no_std] #![no_main] extern crate alloc; use alloc::vec::Vec; zkm_runtime::entrypoint!(main); pub fn main() { let public_input: Vec<u8> = zkm_runtime::io::read(); let input: Vec<u8> = zkm_runtime::io::read(); let output = zkm_runtime::io::keccak(&input.as_slice()); assert_eq!(output.to_vec(), pub...
rust
MIT
eb09cf6c81bed9717bc98e4a4c9a61f54787a351
2026-01-04T20:21:15.281276Z
false
ProjectZKM/zkm
https://github.com/ProjectZKM/zkm/blob/eb09cf6c81bed9717bc98e4a4c9a61f54787a351/prover/examples/keccak/host/build.rs
prover/examples/keccak/host/build.rs
fn main() { zkm_build::build_program(&format!("{}/../guest", env!("CARGO_MANIFEST_DIR"))); }
rust
MIT
eb09cf6c81bed9717bc98e4a4c9a61f54787a351
2026-01-04T20:21:15.281276Z
false
ProjectZKM/zkm
https://github.com/ProjectZKM/zkm/blob/eb09cf6c81bed9717bc98e4a4c9a61f54787a351/prover/examples/keccak/host/src/main.rs
prover/examples/keccak/host/src/main.rs
use alloy_primitives::keccak256; use std::env; use zkm_emulator::utils::{load_elf_with_patch, split_prog_into_segs}; use zkm_utils::utils::prove_segments; const ELF_PATH: &str = "../guest/elf/mips-zkm-zkvm-elf"; fn prove_keccak_rust() { // 1. split ELF into segs let seg_path = env::var("SEG_OUTPUT").expect("S...
rust
MIT
eb09cf6c81bed9717bc98e4a4c9a61f54787a351
2026-01-04T20:21:15.281276Z
false
ProjectZKM/zkm
https://github.com/ProjectZKM/zkm/blob/eb09cf6c81bed9717bc98e4a4c9a61f54787a351/prover/examples/revme/guest/src/main.rs
prover/examples/revme/guest/src/main.rs
#![no_std] #![no_main] extern crate alloc; use alloc::vec::Vec; use guest::verify_revm_tx; zkm_runtime::entrypoint!(main); pub fn main() { let input: Vec<u8> = zkm_runtime::io::read_vec(); assert!(verify_revm_tx(&input).unwrap()); }
rust
MIT
eb09cf6c81bed9717bc98e4a4c9a61f54787a351
2026-01-04T20:21:15.281276Z
false
ProjectZKM/zkm
https://github.com/ProjectZKM/zkm/blob/eb09cf6c81bed9717bc98e4a4c9a61f54787a351/prover/examples/revme/host/build.rs
prover/examples/revme/host/build.rs
fn main() { zkm_build::build_program(&format!("{}/../guest", env!("CARGO_MANIFEST_DIR"))); }
rust
MIT
eb09cf6c81bed9717bc98e4a4c9a61f54787a351
2026-01-04T20:21:15.281276Z
false
ProjectZKM/zkm
https://github.com/ProjectZKM/zkm/blob/eb09cf6c81bed9717bc98e4a4c9a61f54787a351/prover/examples/revme/host/src/main.rs
prover/examples/revme/host/src/main.rs
use std::env; use std::fs::File; use std::io::Read; use zkm_emulator::utils::{load_elf_with_patch, split_prog_into_segs}; use zkm_utils::utils::prove_segments; const ELF_PATH: &str = "../guest/elf/mips-zkm-zkvm-elf"; fn prove_revm() { // 1. split ELF into segs let seg_path = env::var("SEG_OUTPUT").unwrap_or(...
rust
MIT
eb09cf6c81bed9717bc98e4a4c9a61f54787a351
2026-01-04T20:21:15.281276Z
false
ProjectZKM/zkm
https://github.com/ProjectZKM/zkm/blob/eb09cf6c81bed9717bc98e4a4c9a61f54787a351/emulator/src/page.rs
emulator/src/page.rs
/// Note: 2**12 = 4 KiB, the minimum page-size in Unicorn for mmap pub const PAGE_ADDR_SIZE: usize = 12; pub const PAGE_KEY_SIZE: usize = 32 - PAGE_ADDR_SIZE; pub const PAGE_SIZE: usize = 1 << PAGE_ADDR_SIZE; pub const PAGE_ADDR_MASK: usize = PAGE_SIZE - 1; const MAX_PAGE_COUNT: usize = 1 << PAGE_KEY_SIZE; const PAGE_K...
rust
MIT
eb09cf6c81bed9717bc98e4a4c9a61f54787a351
2026-01-04T20:21:15.281276Z
false
ProjectZKM/zkm
https://github.com/ProjectZKM/zkm/blob/eb09cf6c81bed9717bc98e4a4c9a61f54787a351/emulator/src/lib.rs
emulator/src/lib.rs
#![allow(dead_code)] pub mod memory; pub mod opcode_id; pub mod page; pub mod state; pub mod tests; pub mod utils;
rust
MIT
eb09cf6c81bed9717bc98e4a4c9a61f54787a351
2026-01-04T20:21:15.281276Z
false
ProjectZKM/zkm
https://github.com/ProjectZKM/zkm/blob/eb09cf6c81bed9717bc98e4a4c9a61f54787a351/emulator/src/tests.rs
emulator/src/tests.rs
#[allow(clippy::module_inception)] #[cfg(test)] mod tests { use std::{ fs, path::{Path, PathBuf}, }; use crate::state::{InstrumentedState, State}; use crate::utils::{get_block_path, load_elf_with_patch, split_prog_into_segs, SEGMENT_STEPS}; const END_ADDR: u32 = 0xa7ef00d0; con...
rust
MIT
eb09cf6c81bed9717bc98e4a4c9a61f54787a351
2026-01-04T20:21:15.281276Z
false
ProjectZKM/zkm
https://github.com/ProjectZKM/zkm/blob/eb09cf6c81bed9717bc98e4a4c9a61f54787a351/emulator/src/memory.rs
emulator/src/memory.rs
#![allow(clippy::extra_unused_lifetimes)] use std::cell::RefCell; pub const WORD_SIZE: usize = core::mem::size_of::<u32>(); pub const INIT_SP: u32 = 0x7fffd000; use super::page::MAX_MEMORY; use crate::page::{CachedPage, PAGE_ADDR_MASK, PAGE_ADDR_SIZE, PAGE_SIZE}; use itertools::Itertools; use lazy_static::lazy_static; ...
rust
MIT
eb09cf6c81bed9717bc98e4a4c9a61f54787a351
2026-01-04T20:21:15.281276Z
false
ProjectZKM/zkm
https://github.com/ProjectZKM/zkm/blob/eb09cf6c81bed9717bc98e4a4c9a61f54787a351/emulator/src/state.rs
emulator/src/state.rs
use crate::memory::{Memory, INIT_SP, POSEIDON_RATE_BYTES}; use crate::page::{PAGE_ADDR_MASK, PAGE_SIZE}; use elf::abi::{PT_LOAD, PT_TLS}; use elf::endian::AnyEndian; use log::{trace, warn}; use serde::de::DeserializeOwned; use serde::{Deserialize, Serialize}; use std::collections::BTreeMap; use std::fmt::{Display, Form...
rust
MIT
eb09cf6c81bed9717bc98e4a4c9a61f54787a351
2026-01-04T20:21:15.281276Z
true
ProjectZKM/zkm
https://github.com/ProjectZKM/zkm/blob/eb09cf6c81bed9717bc98e4a4c9a61f54787a351/emulator/src/opcode_id.rs
emulator/src/opcode_id.rs
pub enum OpcodeId { // Arithmetic Logic Unit ADD, ADDU, SUB, SUBU, ADDI, ADDIU, AND, ANDI, XOR, XORI, OR, ORI, NOR, LUI, SLT, SLTI, SLTIU, SLTU, // Shifter SLL, SLLV, SRA, SRAV, SRL, SRLV, // Multiply MULT,...
rust
MIT
eb09cf6c81bed9717bc98e4a4c9a61f54787a351
2026-01-04T20:21:15.281276Z
false
ProjectZKM/zkm
https://github.com/ProjectZKM/zkm/blob/eb09cf6c81bed9717bc98e4a4c9a61f54787a351/emulator/src/utils.rs
emulator/src/utils.rs
use crate::state::{InstrumentedState, State}; use elf::{endian::AnyEndian, ElfBytes}; use std::fs; use std::fs::File; pub const SEGMENT_STEPS: usize = 65536; /// From the minigeth's rule, the `block` starts with `0_` pub fn get_block_path(basedir: &str, block: &str, file: &str) -> String { format!("{basedir}/0_{b...
rust
MIT
eb09cf6c81bed9717bc98e4a4c9a61f54787a351
2026-01-04T20:21:15.281276Z
false
ProjectZKM/zkm
https://github.com/ProjectZKM/zkm/blob/eb09cf6c81bed9717bc98e4a4c9a61f54787a351/recursion/build.rs
recursion/build.rs
use std::path::PathBuf; use std::process::Command; fn main() -> Result<(), Box<dyn std::error::Error>> { println!("cargo:rerun-if-changed=go"); let out_dir = std::env::var("OUT_DIR").unwrap(); let dest_path = PathBuf::from(&out_dir); let lib_name = "zkmgnark"; let dest = dest_path.join(format!("lib{...
rust
MIT
eb09cf6c81bed9717bc98e4a4c9a61f54787a351
2026-01-04T20:21:15.281276Z
false
ProjectZKM/zkm
https://github.com/ProjectZKM/zkm/blob/eb09cf6c81bed9717bc98e4a4c9a61f54787a351/recursion/src/lib.rs
recursion/src/lib.rs
mod snark; pub use snark::*; use std::env; use plonky2::field::goldilocks_field::GoldilocksField; use plonky2::plonk::config::PoseidonGoldilocksConfig; use plonky2::util::timing::TimingTree; use plonky2x::backend::circuit::Groth16WrapperParameters; use plonky2x::backend::wrapper::wrap::WrappedCircuit; use plonky2x::f...
rust
MIT
eb09cf6c81bed9717bc98e4a4c9a61f54787a351
2026-01-04T20:21:15.281276Z
false
ProjectZKM/zkm
https://github.com/ProjectZKM/zkm/blob/eb09cf6c81bed9717bc98e4a4c9a61f54787a351/recursion/src/snark/snarks.rs
recursion/src/snark/snarks.rs
extern crate libc; use anyhow::bail; use libc::c_int; use std::os::raw::c_char; use std::path::Path; extern "C" { fn Stark2Snark( keypath: *const c_char, inputdir: *const c_char, outputdir: *const c_char, result: *mut *mut libc::c_char, ) -> c_int; fn SetupAndGenerateSolVeri...
rust
MIT
eb09cf6c81bed9717bc98e4a4c9a61f54787a351
2026-01-04T20:21:15.281276Z
false
ProjectZKM/zkm
https://github.com/ProjectZKM/zkm/blob/eb09cf6c81bed9717bc98e4a4c9a61f54787a351/recursion/src/snark/mod.rs
recursion/src/snark/mod.rs
mod snarks; pub use snarks::*;
rust
MIT
eb09cf6c81bed9717bc98e4a4c9a61f54787a351
2026-01-04T20:21:15.281276Z
false
Roblox/tarmac
https://github.com/Roblox/tarmac/blob/01fa334ebc5dc5b72a17dd5182c500ffca7b2b00/src/alpha_bleed.rs
src/alpha_bleed.rs
//! Changes pixels in an image that are totally transparent to the color of //! their nearest non-transparent neighbor. This fixes artifacting when images //! are resized in some contexts. use std::collections::VecDeque; use crate::image::{Image, Pixel}; pub(crate) fn alpha_bleed(image: &mut Image) { let (w, h) ...
rust
MIT
01fa334ebc5dc5b72a17dd5182c500ffca7b2b00
2026-01-04T20:22:35.804591Z
false
Roblox/tarmac
https://github.com/Roblox/tarmac/blob/01fa334ebc5dc5b72a17dd5182c500ffca7b2b00/src/sync_backend.rs
src/sync_backend.rs
use std::{borrow::Cow, io, path::Path, thread, time::Duration}; use crate::roblox_web_api::{RobloxApiClient, RobloxApiError, IMAGE}; use crate::roblox_web_api_types::{ ImageUploadData, ImageUploadMetadata, RobloxAuthenticationError, }; use fs_err as fs; use reqwest::StatusCode; use thiserror::Error; pub trait Syn...
rust
MIT
01fa334ebc5dc5b72a17dd5182c500ffca7b2b00
2026-01-04T20:22:35.804591Z
false
Roblox/tarmac
https://github.com/Roblox/tarmac/blob/01fa334ebc5dc5b72a17dd5182c500ffca7b2b00/src/image.rs
src/image.rs
//! Simple containers to track images and perform operations on them. use std::io::{Read, Write}; #[derive(Debug, Clone, Copy, PartialEq, Eq)] enum ImageFormat { Rgba8, } impl ImageFormat { fn stride(&self) -> u32 { match self { ImageFormat::Rgba8 => 4, } } } #[derive(Debug, ...
rust
MIT
01fa334ebc5dc5b72a17dd5182c500ffca7b2b00
2026-01-04T20:22:35.804591Z
false
Roblox/tarmac
https://github.com/Roblox/tarmac/blob/01fa334ebc5dc5b72a17dd5182c500ffca7b2b00/src/lua_ast.rs
src/lua_ast.rs
//! Defines part of a Lua AST, used for generating human-readable code in a //! composable way for Tarmac. //! //! Eventually, it might be a good idea to replace this module with something //! like full-moon (https://github.com/Kampfkarren/full-moon) or another real //! Lua AST library. use std::fmt::{self, Write}; /...
rust
MIT
01fa334ebc5dc5b72a17dd5182c500ffca7b2b00
2026-01-04T20:22:35.804591Z
false
Roblox/tarmac
https://github.com/Roblox/tarmac/blob/01fa334ebc5dc5b72a17dd5182c500ffca7b2b00/src/dpi_scale.rs
src/dpi_scale.rs
use std::path::{Path, PathBuf}; use regex::Regex; #[derive(Debug, Clone, PartialEq, Eq)] pub(crate) struct DpiAwarePathInfo { pub(crate) path_without_dpi_scale: PathBuf, pub(crate) dpi_scale: u32, } impl DpiAwarePathInfo { #[cfg(test)] fn new(path_without_dpi_scale: &str, dpi_scale: u32) -> Self { ...
rust
MIT
01fa334ebc5dc5b72a17dd5182c500ffca7b2b00
2026-01-04T20:22:35.804591Z
false
Roblox/tarmac
https://github.com/Roblox/tarmac/blob/01fa334ebc5dc5b72a17dd5182c500ffca7b2b00/src/glob.rs
src/glob.rs
//! Wrapper around globset's Glob type that has better serialization //! characteristics by coupling Glob and GlobMatcher into a single type. use std::{ fmt, path::{Path, PathBuf}, }; use globset::{Glob as InnerGlob, GlobMatcher}; use serde::{de::Error as _, Deserialize, Deserializer, Serialize, Serializer}; ...
rust
MIT
01fa334ebc5dc5b72a17dd5182c500ffca7b2b00
2026-01-04T20:22:35.804591Z
false
Roblox/tarmac
https://github.com/Roblox/tarmac/blob/01fa334ebc5dc5b72a17dd5182c500ffca7b2b00/src/roblox_web_api_types.rs
src/roblox_web_api_types.rs
use serde::{Deserialize, Serialize}; use std::borrow::Cow; use thiserror::Error; #[derive(Debug, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct CreationContext { pub creator: Creator, } #[derive(Debug, Serialize, Deserialize)] #[serde(rename_all = "camelCase", untagged)] pub enum Creator {...
rust
MIT
01fa334ebc5dc5b72a17dd5182c500ffca7b2b00
2026-01-04T20:22:35.804591Z
false
Roblox/tarmac
https://github.com/Roblox/tarmac/blob/01fa334ebc5dc5b72a17dd5182c500ffca7b2b00/src/roblox_web_api.rs
src/roblox_web_api.rs
use crate::auth_cookie::get_auth_cookie; use crate::roblox_web_api_types::{ ImageUploadData, ImageUploadMetadata, RawOperationStatusResponse, RawOperationStatusResponseVariants, RawUploadResponse, RobloxAuthenticationError, UploadResponse, }; use log; use reqwest::{ header::{HeaderValue, COOKIE}, mu...
rust
MIT
01fa334ebc5dc5b72a17dd5182c500ffca7b2b00
2026-01-04T20:22:35.804591Z
false
Roblox/tarmac
https://github.com/Roblox/tarmac/blob/01fa334ebc5dc5b72a17dd5182c500ffca7b2b00/src/auth_cookie.rs
src/auth_cookie.rs
//! Implementation of automatically fetching authentication cookie from a Roblox //! Studio installation. #[cfg(windows)] pub fn get_auth_cookie() -> Option<String> { use winreg::{enums::HKEY_CURRENT_USER, RegKey}; let hkcu = RegKey::predef(HKEY_CURRENT_USER); let cookies = hkcu .open_subkey("Soft...
rust
MIT
01fa334ebc5dc5b72a17dd5182c500ffca7b2b00
2026-01-04T20:22:35.804591Z
false
Roblox/tarmac
https://github.com/Roblox/tarmac/blob/01fa334ebc5dc5b72a17dd5182c500ffca7b2b00/src/options.rs
src/options.rs
use std::{path::PathBuf, str::FromStr}; use structopt::StructOpt; #[derive(Debug, StructOpt)] #[structopt(about = env!("CARGO_PKG_DESCRIPTION"))] pub struct Options { #[structopt(flatten)] pub global: GlobalOptions, #[structopt(subcommand)] pub command: Subcommand, } #[derive(Debug, StructOpt)] pub ...
rust
MIT
01fa334ebc5dc5b72a17dd5182c500ffca7b2b00
2026-01-04T20:22:35.804591Z
false
Roblox/tarmac
https://github.com/Roblox/tarmac/blob/01fa334ebc5dc5b72a17dd5182c500ffca7b2b00/src/codegen.rs
src/codegen.rs
//! Defines how Tarmac generates Lua code for linking to assets. //! //! Tarmac uses a small Lua AST to build up generated code. use std::{ collections::BTreeMap, io::{self, Write}, path::{self, Path}, }; use fs_err::File; use crate::{ data::ImageSlice, data::SyncInput, lua_ast::{Block, Expre...
rust
MIT
01fa334ebc5dc5b72a17dd5182c500ffca7b2b00
2026-01-04T20:22:35.804591Z
false
Roblox/tarmac
https://github.com/Roblox/tarmac/blob/01fa334ebc5dc5b72a17dd5182c500ffca7b2b00/src/asset_name.rs
src/asset_name.rs
use std::{ fmt, path::{self, Path}, sync::Arc, }; use serde::{Deserialize, Serialize}; /// Represents a disambiguated and cleaned up path to an asset from a Tarmac /// project. /// /// This is really just a string, but by making it have an explicit type with /// known conversions, we can avoid some kinds ...
rust
MIT
01fa334ebc5dc5b72a17dd5182c500ffca7b2b00
2026-01-04T20:22:35.804591Z
false
Roblox/tarmac
https://github.com/Roblox/tarmac/blob/01fa334ebc5dc5b72a17dd5182c500ffca7b2b00/src/main.rs
src/main.rs
mod alpha_bleed; mod asset_name; mod auth_cookie; mod codegen; mod commands; mod data; mod dpi_scale; mod glob; mod image; mod lua_ast; mod options; mod roblox_web_api; mod roblox_web_api_types; mod sync_backend; use std::{env, panic, process}; use backtrace::Backtrace; use structopt::StructOpt; use crate::options::{...
rust
MIT
01fa334ebc5dc5b72a17dd5182c500ffca7b2b00
2026-01-04T20:22:35.804591Z
false
Roblox/tarmac
https://github.com/Roblox/tarmac/blob/01fa334ebc5dc5b72a17dd5182c500ffca7b2b00/src/commands/sync.rs
src/commands/sync.rs
use std::{ collections::{BTreeMap, BTreeSet, HashMap, HashSet, VecDeque}, env, io::{self, BufWriter, Write}, path::{Path, PathBuf}, time::Duration, }; use fs_err as fs; use packos::{InputItem, SimplePacker}; use thiserror::Error; use walkdir::WalkDir; use crate::{ alpha_bleed::alpha_bleed, ...
rust
MIT
01fa334ebc5dc5b72a17dd5182c500ffca7b2b00
2026-01-04T20:22:35.804591Z
false
Roblox/tarmac
https://github.com/Roblox/tarmac/blob/01fa334ebc5dc5b72a17dd5182c500ffca7b2b00/src/commands/asset_list.rs
src/commands/asset_list.rs
use std::collections::BTreeSet; use std::env; use std::io::{BufWriter, Write}; use fs_err as fs; use crate::data::Manifest; use crate::options::{AssetListOptions, GlobalOptions}; pub fn asset_list(_global: GlobalOptions, options: AssetListOptions) -> anyhow::Result<()> { let project_path = match options.project_...
rust
MIT
01fa334ebc5dc5b72a17dd5182c500ffca7b2b00
2026-01-04T20:22:35.804591Z
false
Roblox/tarmac
https://github.com/Roblox/tarmac/blob/01fa334ebc5dc5b72a17dd5182c500ffca7b2b00/src/commands/mod.rs
src/commands/mod.rs
mod asset_list; mod create_cache_map; mod sync; mod upload_image; pub use asset_list::*; pub use create_cache_map::*; pub use sync::*; pub use upload_image::*;
rust
MIT
01fa334ebc5dc5b72a17dd5182c500ffca7b2b00
2026-01-04T20:22:35.804591Z
false
Roblox/tarmac
https://github.com/Roblox/tarmac/blob/01fa334ebc5dc5b72a17dd5182c500ffca7b2b00/src/commands/upload_image.rs
src/commands/upload_image.rs
use fs_err as fs; use crate::{ options::{GlobalOptions, UploadImageOptions}, roblox_web_api::{RobloxApiClient, RobloxOpenCloudCredentials, IMAGE}, roblox_web_api_types::{ImageUploadData, ImageUploadMetadata}, }; pub fn upload_image( global: GlobalOptions, options: UploadImageOptions, ) -> Result<(...
rust
MIT
01fa334ebc5dc5b72a17dd5182c500ffca7b2b00
2026-01-04T20:22:35.804591Z
false
Roblox/tarmac
https://github.com/Roblox/tarmac/blob/01fa334ebc5dc5b72a17dd5182c500ffca7b2b00/src/commands/create_cache_map.rs
src/commands/create_cache_map.rs
use std::collections::BTreeMap; use std::env; use std::io::{BufWriter, Write}; use fs_err as fs; use crate::asset_name::AssetName; use crate::data::Manifest; use crate::options::{CreateCacheMapOptions, GlobalOptions}; use crate::roblox_web_api::{RobloxApiClient, RobloxOpenCloudCredentials}; pub fn create_cache_map( ...
rust
MIT
01fa334ebc5dc5b72a17dd5182c500ffca7b2b00
2026-01-04T20:22:35.804591Z
false
Roblox/tarmac
https://github.com/Roblox/tarmac/blob/01fa334ebc5dc5b72a17dd5182c500ffca7b2b00/src/data/config.rs
src/data/config.rs
use std::{ io, path::{Path, PathBuf}, }; use fs_err as fs; use serde::{Deserialize, Serialize}; use thiserror::Error; use crate::glob::Glob; static CONFIG_FILENAME: &str = "tarmac.toml"; /// Configuration for Tarmac, contained in a tarmac.toml file. /// /// Tarmac is started from a top-level tarmac.toml fil...
rust
MIT
01fa334ebc5dc5b72a17dd5182c500ffca7b2b00
2026-01-04T20:22:35.804591Z
false
Roblox/tarmac
https://github.com/Roblox/tarmac/blob/01fa334ebc5dc5b72a17dd5182c500ffca7b2b00/src/data/sync.rs
src/data/sync.rs
use std::path::PathBuf; use crate::{ asset_name::AssetName, data::{ImageSlice, InputConfig, InputManifest}, }; /// In-memory representation of a Tarmac Input during the sync process. /// /// SyncInput structs are gradually created and filled in from the filesystem, /// results of network I/O, and from the pre...
rust
MIT
01fa334ebc5dc5b72a17dd5182c500ffca7b2b00
2026-01-04T20:22:35.804591Z
false
Roblox/tarmac
https://github.com/Roblox/tarmac/blob/01fa334ebc5dc5b72a17dd5182c500ffca7b2b00/src/data/manifest.rs
src/data/manifest.rs
use std::{ collections::BTreeMap, io, path::{Path, PathBuf}, }; use fs_err as fs; use serde::{Deserialize, Serialize}; use thiserror::Error; use crate::asset_name::AssetName; static MANIFEST_FILENAME: &str = "tarmac-manifest.toml"; /// Tracks the status of all configuration, inputs, and outputs as of th...
rust
MIT
01fa334ebc5dc5b72a17dd5182c500ffca7b2b00
2026-01-04T20:22:35.804591Z
false
Roblox/tarmac
https://github.com/Roblox/tarmac/blob/01fa334ebc5dc5b72a17dd5182c500ffca7b2b00/src/data/mod.rs
src/data/mod.rs
mod config; mod manifest; mod sync; pub use config::*; pub use manifest::*; pub use sync::*;
rust
MIT
01fa334ebc5dc5b72a17dd5182c500ffca7b2b00
2026-01-04T20:22:35.804591Z
false
Roblox/tarmac
https://github.com/Roblox/tarmac/blob/01fa334ebc5dc5b72a17dd5182c500ffca7b2b00/packos/src/packer.rs
packos/src/packer.rs
use std::{borrow::Borrow, cmp::Reverse}; use crate::{ geometry::Rect, types::{Bucket, InputItem, OutputItem, PackOutput}, }; /// A configurable rectangle packer using a simple packing algorithm. #[derive(Debug, Clone)] pub struct SimplePacker { min_size: (u32, u32), max_size: (u32, u32), padding: ...
rust
MIT
01fa334ebc5dc5b72a17dd5182c500ffca7b2b00
2026-01-04T20:22:35.804591Z
false
Roblox/tarmac
https://github.com/Roblox/tarmac/blob/01fa334ebc5dc5b72a17dd5182c500ffca7b2b00/packos/src/lib.rs
packos/src/lib.rs
//! Packos is a small library for packing rectangles. It was built for //! [Tarmac](https://github.com/Roblox/tarmac), a tool that manages assets for //! Roblox projects, including packing images into spritesheets. //! //! Packos currently exposes a single packing implementation, //! [`SimplePacker`][SimplePacker]. Mor...
rust
MIT
01fa334ebc5dc5b72a17dd5182c500ffca7b2b00
2026-01-04T20:22:35.804591Z
false
Roblox/tarmac
https://github.com/Roblox/tarmac/blob/01fa334ebc5dc5b72a17dd5182c500ffca7b2b00/packos/src/id.rs
packos/src/id.rs
use std::{ num::NonZeroUsize, sync::atomic::{AtomicUsize, Ordering}, }; static LAST_ID: AtomicUsize = AtomicUsize::new(1); /// Represents an item tracked by Packos. #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub struct Id(NonZeroUsize); impl Id { pub(crate) fn new() -> Self { let id = LAS...
rust
MIT
01fa334ebc5dc5b72a17dd5182c500ffca7b2b00
2026-01-04T20:22:35.804591Z
false
Roblox/tarmac
https://github.com/Roblox/tarmac/blob/01fa334ebc5dc5b72a17dd5182c500ffca7b2b00/packos/src/geometry.rs
packos/src/geometry.rs
#[derive(Debug, Clone, Copy)] pub(crate) struct Rect { pub pos: (u32, u32), pub size: (u32, u32), } impl Rect { pub fn intersects(&self, other: &Rect) -> bool { let self_max = self.max(); let other_max = other.max(); let x_intersect = self.pos.0 < other_max.0 && self_max.0 > other....
rust
MIT
01fa334ebc5dc5b72a17dd5182c500ffca7b2b00
2026-01-04T20:22:35.804591Z
false
Roblox/tarmac
https://github.com/Roblox/tarmac/blob/01fa334ebc5dc5b72a17dd5182c500ffca7b2b00/packos/src/types.rs
packos/src/types.rs
use crate::{geometry::Rect, id::Id}; /// An input to the rectangle packing routines. /// /// `InputItem` is just a 2D size and a Packos-generated unique identifier. It's /// expected that consumers will assign meaning to the given IDs and then use /// them to associate the packing results back to the application's own...
rust
MIT
01fa334ebc5dc5b72a17dd5182c500ffca7b2b00
2026-01-04T20:22:35.804591Z
false
Roblox/tarmac
https://github.com/Roblox/tarmac/blob/01fa334ebc5dc5b72a17dd5182c500ffca7b2b00/packos/examples/simple-uniform.rs
packos/examples/simple-uniform.rs
use packos::{InputItem, SimplePacker}; fn main() { env_logger::init(); let inputs: Vec<_> = (0..5).map(|_| InputItem::new((128, 128))).collect(); let packer = SimplePacker::new().max_size((256, 256)); let result = packer.pack(inputs); println!("Pack result: {:#?}", result); }
rust
MIT
01fa334ebc5dc5b72a17dd5182c500ffca7b2b00
2026-01-04T20:22:35.804591Z
false
djc/tokio-imap
https://github.com/djc/tokio-imap/blob/82c6967ad529e5f9cfa6b0c59aecb2f0b5f6bd8c/imap-proto/src/lib.rs
imap-proto/src/lib.rs
pub mod builders; pub mod parser; pub mod types; pub use parser::ParseResult; pub use types::*;
rust
Apache-2.0
82c6967ad529e5f9cfa6b0c59aecb2f0b5f6bd8c
2026-01-04T20:22:37.594708Z
false
djc/tokio-imap
https://github.com/djc/tokio-imap/blob/82c6967ad529e5f9cfa6b0c59aecb2f0b5f6bd8c/imap-proto/src/types.rs
imap-proto/src/types.rs
use std::borrow::Cow; use std::collections::HashMap; use std::ops::RangeInclusive; pub mod acls; pub use acls::*; fn to_owned_cow<T: ?Sized + ToOwned>(c: Cow<'_, T>) -> Cow<'static, T> { Cow::Owned(c.into_owned()) } #[derive(Clone, Debug, Eq, PartialEq)] pub struct Request<'a>(pub Cow<'a, [u8]>, pub Cow<'a, [u8]...
rust
Apache-2.0
82c6967ad529e5f9cfa6b0c59aecb2f0b5f6bd8c
2026-01-04T20:22:37.594708Z
false
djc/tokio-imap
https://github.com/djc/tokio-imap/blob/82c6967ad529e5f9cfa6b0c59aecb2f0b5f6bd8c/imap-proto/src/types/acls.rs
imap-proto/src/types/acls.rs
use super::to_owned_cow; use std::borrow::Cow; // IMAP4 ACL Extension 4313/2086 #[derive(Debug, Eq, PartialEq)] pub struct Acl<'a> { pub mailbox: Cow<'a, str>, pub acls: Vec<AclEntry<'a>>, } impl<'a> Acl<'a> { pub fn into_owned(self) -> Acl<'static> { Acl { mailbox: to_owned_cow(self...
rust
Apache-2.0
82c6967ad529e5f9cfa6b0c59aecb2f0b5f6bd8c
2026-01-04T20:22:37.594708Z
false
djc/tokio-imap
https://github.com/djc/tokio-imap/blob/82c6967ad529e5f9cfa6b0c59aecb2f0b5f6bd8c/imap-proto/src/builders/command.rs
imap-proto/src/builders/command.rs
use std::borrow::Cow; use std::marker::PhantomData; use std::ops::{RangeFrom, RangeInclusive}; use std::str; use crate::types::{AttrMacro, Attribute, State}; pub struct CommandBuilder {} impl CommandBuilder { pub fn check() -> Command { let args = b"CHECK".to_vec(); Command { args, ...
rust
Apache-2.0
82c6967ad529e5f9cfa6b0c59aecb2f0b5f6bd8c
2026-01-04T20:22:37.594708Z
false
djc/tokio-imap
https://github.com/djc/tokio-imap/blob/82c6967ad529e5f9cfa6b0c59aecb2f0b5f6bd8c/imap-proto/src/builders/mod.rs
imap-proto/src/builders/mod.rs
pub mod command;
rust
Apache-2.0
82c6967ad529e5f9cfa6b0c59aecb2f0b5f6bd8c
2026-01-04T20:22:37.594708Z
false
djc/tokio-imap
https://github.com/djc/tokio-imap/blob/82c6967ad529e5f9cfa6b0c59aecb2f0b5f6bd8c/imap-proto/src/parser/rfc7162.rs
imap-proto/src/parser/rfc7162.rs
//! //! //! https://tools.ietf.org/html/rfc7162 //! //! The IMAP QRESYNC Extensions //! use nom::{ bytes::streaming::tag_no_case, character::streaming::space1, combinator::opt, sequence::tuple, IResult, }; use crate::parser::core::sequence_set; use crate::types::*; // The VANISHED response reports that the s...
rust
Apache-2.0
82c6967ad529e5f9cfa6b0c59aecb2f0b5f6bd8c
2026-01-04T20:22:37.594708Z
false
djc/tokio-imap
https://github.com/djc/tokio-imap/blob/82c6967ad529e5f9cfa6b0c59aecb2f0b5f6bd8c/imap-proto/src/parser/rfc2971.rs
imap-proto/src/parser/rfc2971.rs
//! //! //! https://tools.ietf.org/html/rfc2971 //! //! The IMAP4 ID extension //! use std::{borrow::Cow, collections::HashMap}; use nom::{ branch::alt, bytes::complete::tag_no_case, character::complete::{char, space0, space1}, combinator::map, multi::many0, sequence::{preceded, separated_pair...
rust
Apache-2.0
82c6967ad529e5f9cfa6b0c59aecb2f0b5f6bd8c
2026-01-04T20:22:37.594708Z
false
djc/tokio-imap
https://github.com/djc/tokio-imap/blob/82c6967ad529e5f9cfa6b0c59aecb2f0b5f6bd8c/imap-proto/src/parser/rfc5464.rs
imap-proto/src/parser/rfc5464.rs
//! //! https://tools.ietf.org/html/rfc5464 //! //! IMAP METADATA extension //! use nom::{ branch::alt, bytes::streaming::{tag, tag_no_case}, combinator::map, multi::separated_list0, sequence::tuple, IResult, }; use std::borrow::Cow; use crate::{parser::core::*, types::*}; fn is_entry_compone...
rust
Apache-2.0
82c6967ad529e5f9cfa6b0c59aecb2f0b5f6bd8c
2026-01-04T20:22:37.594708Z
false
djc/tokio-imap
https://github.com/djc/tokio-imap/blob/82c6967ad529e5f9cfa6b0c59aecb2f0b5f6bd8c/imap-proto/src/parser/tests.rs
imap-proto/src/parser/tests.rs
use super::{bodystructure::BodyStructParser, parse_response}; use crate::types::*; use std::borrow::Cow; use std::num::NonZeroUsize; #[test] fn test_mailbox_data_response() { match parse_response(b"* LIST (\\HasNoChildren) \".\" INBOX.Tests\r\n") { Ok((_, Response::MailboxData(_))) => {} rsp => pan...
rust
Apache-2.0
82c6967ad529e5f9cfa6b0c59aecb2f0b5f6bd8c
2026-01-04T20:22:37.594708Z
false
djc/tokio-imap
https://github.com/djc/tokio-imap/blob/82c6967ad529e5f9cfa6b0c59aecb2f0b5f6bd8c/imap-proto/src/parser/rfc4551.rs
imap-proto/src/parser/rfc4551.rs
//! //! https://tools.ietf.org/html/rfc4551 //! //! IMAP Extension for Conditional STORE Operation //! or Quick Flag Changes Resynchronization //! use nom::{bytes::streaming::tag_no_case, sequence::tuple, IResult}; use crate::{ parser::core::{number_64, paren_delimited}, types::*, }; // The highest mod-seque...
rust
Apache-2.0
82c6967ad529e5f9cfa6b0c59aecb2f0b5f6bd8c
2026-01-04T20:22:37.594708Z
false
djc/tokio-imap
https://github.com/djc/tokio-imap/blob/82c6967ad529e5f9cfa6b0c59aecb2f0b5f6bd8c/imap-proto/src/parser/rfc5256.rs
imap-proto/src/parser/rfc5256.rs
//! //! https://tools.ietf.org/html/rfc5256 //! //! SORT extension //! use nom::{ bytes::streaming::{tag, tag_no_case}, combinator::{map, opt}, multi::many0, sequence::{preceded, terminated}, IResult, }; use crate::{parser::core::number, types::MailboxDatum}; /// BASE.7.2.SORT. SORT Response /// ...
rust
Apache-2.0
82c6967ad529e5f9cfa6b0c59aecb2f0b5f6bd8c
2026-01-04T20:22:37.594708Z
false
djc/tokio-imap
https://github.com/djc/tokio-imap/blob/82c6967ad529e5f9cfa6b0c59aecb2f0b5f6bd8c/imap-proto/src/parser/core.rs
imap-proto/src/parser/core.rs
use nom::{ branch::alt, bytes::streaming::{escaped, tag, tag_no_case, take, take_while, take_while1}, character::streaming::{char, digit1, one_of}, combinator::{map, map_res, opt}, multi::{separated_list0, separated_list1}, sequence::{delimited, preceded, tuple}, IResult, }; use std::str::{...
rust
Apache-2.0
82c6967ad529e5f9cfa6b0c59aecb2f0b5f6bd8c
2026-01-04T20:22:37.594708Z
false
djc/tokio-imap
https://github.com/djc/tokio-imap/blob/82c6967ad529e5f9cfa6b0c59aecb2f0b5f6bd8c/imap-proto/src/parser/gmail.rs
imap-proto/src/parser/gmail.rs
use std::borrow::Cow; use nom::branch::alt; use nom::bytes::streaming::tag_no_case; use nom::combinator::map; use nom::sequence::preceded; use nom::IResult; use crate::{AttributeValue, MailboxDatum}; use super::core::{number_64, parenthesized_list, quoted_utf8}; use super::rfc3501::flag; pub(crate) fn gmail_label_l...
rust
Apache-2.0
82c6967ad529e5f9cfa6b0c59aecb2f0b5f6bd8c
2026-01-04T20:22:37.594708Z
false
djc/tokio-imap
https://github.com/djc/tokio-imap/blob/82c6967ad529e5f9cfa6b0c59aecb2f0b5f6bd8c/imap-proto/src/parser/mod.rs
imap-proto/src/parser/mod.rs
use crate::types::Response; use nom::{branch::alt, IResult}; pub mod core; pub mod bodystructure; pub mod gmail; pub mod rfc2087; pub mod rfc2971; pub mod rfc3501; pub mod rfc4314; pub mod rfc4315; pub mod rfc4551; pub mod rfc5161; pub mod rfc5256; pub mod rfc5464; pub mod rfc7162; #[cfg(test)] mod tests; pub fn pa...
rust
Apache-2.0
82c6967ad529e5f9cfa6b0c59aecb2f0b5f6bd8c
2026-01-04T20:22:37.594708Z
false