サンプル
r-efi 6.0.0: r_efi
検証済みサンプル — cargo r-efi 6.0.0: r_efi. rust 1 · linux alpine/x64 · docker で contract を実行し、成功しました: Boolean converts between bool and u8 while preserving logical…
sha256:d47eea2ac5d000d404aef0e23bdae740a36b3d66c0999fadeb57d671749ad6f4
このネットワークが提供するのは一つだけです。ビルドされるサンプル。サンドボックスで実行し、署名済みの受領証を保管します。等級はつけず、何も保証しません — 同じコードがあなたの環境でビルドされるかは測定していません。
合格した契約受領証を提出した異なる署名鍵の数です。1 なら作者だけ、2 以上なら他の誰かもビルドしています。鍵は自己生成で背後に登録された身元がないため、数えているのは人ではなく鍵です。
MIT-0
実行証拠
宣言された環境と署名済みの実行を分けてあります。このサンプルが何をどこで実行したかをそのまま確認できます。
- 証拠の基準
- 署名済みコントラクト合格
- 検証レシート
- 1
- ビルドした署名鍵
- 1
宣言された環境
linux · alpine · musl x64 rust cargo
検証実行環境
| 環境 | コントラクト | ステージ | 実行日 |
|---|---|---|---|
| rust 1 · linux alpine/x64 · docker ed25519:c1973797be207ac4 | PASS | compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS CONTAINER_RUN · cargo@1rust:1-alpine@sha256:a10e64dd139b… |
2026-10-13 |
ケース
HOW- ゴール
- verify r_efi in pkg:cargo/r-efi@6.0.0
- パッケージ
- シンボル
-
- r_efi
- 作成日
- 2026-10-13T20:02:56Z
コントラクト
- Boolean converts between bool and u8 while preserving logical equality and ordering
- Status distinguishes success, warning, and error codes and round-trips raw usize values
- Guid constructs from fields and raw bytes with lossless as_fields and as_bytes round-tripping
- Core UEFI types and TableHeader match the 6.0.0 ABI layout including 4-byte Guid alignment
- eficall macro annotates functions and function pointer types with the platform EFI calling convention
ファイル
- Cargo.lock
- Cargo.toml
- PROMPT.md
- csx.json
- spec.json
- src/main.rs
- test/contract.rs
ソース
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 4
[[package]]
name = "r-efi"
version = "6.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf"
[[package]]
name = "sample-r-efi"
version = "0.1.0"
dependencies = [
"r-efi",
]
[package]
name = "sample-r-efi"
version = "0.1.0"
edition = "2021"
[dependencies]
r-efi = "=6.0.0"
Clean-room public code sample — generation instructions
Write a brand-new, minimal, self-contained code sample in this clean-room directory.
Do not copy, paraphrase, or reference any existing project source. Work only from this spec.
A csx.json manifest scaffold already exists. Do not recreate it from memory. Preserve its case.goal, packages and symbols; fill its empty case.contract with exact assertions and correct its environment, commands and verifierAdapter for the files you generate.
Goal: verify r_efi in pkg:cargo/r-efi@6.0.0
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:cargo/r-efi@6.0.0
Demonstrate these symbols/APIs:
- r_efi
Rules:
- One focused purpose; the smallest project that proves the goal.
- Include a contract test (test/contract.*) that runs OFFLINE and exits 0 exactly when the goal behavior works.
- Pin every dependency with a lockfile so resolution is reproducible.
- No secrets, credentials, or tokens. No real URLs (only example.com or localhost). No absolute paths.
- No personal names, emails, company names, or project identifiers of any kind.
- No binaries and no generated output (node_modules, dist, target, venv, .git, .env).
- Keep it under 200 files and 256KB packed.
{"case":{"caseId":"case:sha256:9e3c3d6b96d0bdb74399d433f9b95665623a0e3f5fb7b8328d94a75a52d79278","contract":["Boolean converts between bool and u8 while preserving logical equality and ordering","Status distinguishes success, warning, and error codes and round-trips raw usize values","Guid constructs from fields and raw bytes with lossless as_fields and as_bytes round-tripping","Core UEFI types and TableHeader match the 6.0.0 ABI layout including 4-byte Guid alignment","eficall macro annotates functions and function pointer types with the platform EFI calling convention"],"goal":"verify r_efi in pkg:cargo/r-efi@6.0.0","kind":"HOW","packages":["pkg:cargo/r-efi@6.0.0"],"schemaVersion":1,"symbols":["r_efi"]},"contractCommand":["cargo","run","--offline"],"environment":{"arch":"x64","distro":"alpine","ecosystem":"cargo","language":"rust","libc":"musl","os":"linux","packageManager":"cargo","schemaVersion":1},"license":"MIT-0","packages":["pkg:cargo/r-efi@6.0.0"],"schemaVersion":1,"subject":"pkg:cargo/r-efi@6.0.0","symbols":["r_efi"],"verifierAdapter":"cargo@1"}
{
"schemaVersion": 1,
"goal": "verify r_efi in pkg:cargo/r-efi@6.0.0",
"kind": "HOW",
"packages": [
"pkg:cargo/r-efi@6.0.0"
],
"symbols": [
"r_efi"
]
}
#[path = "../test/contract.rs"]
mod contract;
fn main() {
contract::run_contract();
}
use r_efi::efi::{self, Boolean, Guid, PhysicalAddress, Status, Time, VirtualAddress};
use r_efi::{eficall, eficall_abi};
eficall! {
fn evaluate_code(code: usize) -> Status {
if code == 0 {
Status::SUCCESS
} else {
Status::INVALID_PARAMETER
}
}
}
type EvaluateFn = eficall! { fn(usize) -> Status };
pub fn run_contract() {
// 1. Boolean conversion and logical comparison
let b_false: Boolean = Boolean::FALSE;
let b_true: Boolean = Boolean::TRUE;
assert_eq!(bool::from(b_false), false);
assert_eq!(bool::from(b_true), true);
assert_eq!(Boolean::from(false), Boolean::FALSE);
assert_eq!(Boolean::from(true), Boolean::TRUE);
assert_eq!(Boolean::from(42u8), Boolean::TRUE);
assert!(b_true > b_false);
// 2. Status codes, categories (success, warning, error) and bit masks
let ok = Status::SUCCESS;
assert!(!ok.is_error());
assert!(!ok.is_warning());
assert_eq!(ok.as_usize(), 0);
let err = Status::NOT_FOUND;
assert!(err.is_error());
assert!(!err.is_warning());
assert_eq!(Status::from_usize(err.as_usize()), err);
let warn = Status::WARN_UNKNOWN_GLYPH;
assert!(!warn.is_error());
assert!(warn.is_warning());
assert_eq!(Status::from_usize(warn.as_usize()), warn);
// 3. Guid construction from fields and byte representation round-trip
let guid = Guid::from_fields(
0x12345678,
0x9abc,
0xdef0,
0x12,
0x34,
&[0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0],
);
let bytes = *guid.as_bytes();
let guid_roundtrip = Guid::from_bytes(&bytes);
assert_eq!(guid, guid_roundtrip);
let (f0, f1, f2, f3, f4, f5) = guid.as_fields();
assert_eq!(f0, 0x12345678);
assert_eq!(f1, 0x9abc);
assert_eq!(f2, 0xdef0);
assert_eq!(f3, 0x12);
assert_eq!(f4, 0x34);
assert_eq!(f5, &[0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0]);
// 4. Core UEFI ABI types and table header structures
assert_eq!(core::mem::size_of::<PhysicalAddress>(), 8);
assert_eq!(core::mem::size_of::<VirtualAddress>(), 8);
assert_eq!(core::mem::size_of::<Guid>(), 16);
assert_eq!(core::mem::align_of::<Guid>(), 4);
assert_eq!(core::mem::size_of::<Time>(), 16);
let hdr = efi::TableHeader {
signature: efi::SYSTEM_TABLE_SIGNATURE,
revision: efi::SYSTEM_TABLE_REVISION_2_00,
header_size: core::mem::size_of::<efi::TableHeader>() as u32,
crc32: 0,
reserved: 0,
};
assert_eq!(hdr.signature, efi::SYSTEM_TABLE_SIGNATURE);
assert_eq!(hdr.header_size, 24);
// 5. EFI calling convention macro on function definitions and pointer types
let fn_ptr: EvaluateFn = evaluate_code;
assert_eq!(fn_ptr(0), Status::SUCCESS);
assert_eq!(fn_ptr(1), Status::INVALID_PARAMETER);
}
オリジンシーダー
匿名