摩乔-V:RISC-V的秘密计算
Mojo-V: Secret Computation for RISC-V

原始链接: https://github.com/toddmaustin/mojo-v

## Mojo-V:RISC-V 的隐私保护 Mojo-V 是一种新的 RISC-V 扩展,旨在实现安全高效的隐私计算。它通过引入“秘密寄存器”并使用第三方密钥加密内存来实现这一点,从而防止数据泄露和侧信道攻击——确保计算既“盲”又“静”。 Mojo-V 通过最少的添加(一个模式位和四条指令)无缝集成到 RISC-V ISA 中,并提供接近原生速度的性能。这代表着一个显著的改进——比完全同态加密 (FHE) 快 5-7 个数量级。 目前版本为 0.91,参考平台支持 64 位秘密整数和浮点运算,并使用固定的对称密钥密码。未来的开发重点是添加 PKI 支持、LLVM 编译器集成以及 32 位 RISC-V 兼容性。开发者可以通过项目的 GitHub 仓库 ([https://github.com/toddmaustin/mojo-v](https://github.com/toddmaustin/mojo-v)) 访问 ISA 规范、Spike 模拟器实现和基准测试。 欢迎通过 [email protected] 提出问题和贡献。

Hacker News 新闻 | 过去 | 评论 | 提问 | 展示 | 招聘 | 提交 登录 Mojo-V: 针对RISC-V的秘密计算 (github.com/toddmaustin) 4 分,来自 fork-bomber 1小时前 | 隐藏 | 过去 | 收藏 | 1 条评论 pjmlp 2分钟前 [–] 与Mojo编程语言有什么关系?回复 指南 | 常见问题 | 列表 | API | 安全 | 法律 | 申请YC | 联系 搜索:
相关文章

原文

Mojo-V Logo

Mojo-V (pronounced “mojo-five”) is a new RISC-V extension that introduces privacy-oriented programming capabilities for RISC-V. Mojo-V implements secret computation, enabling secure, efficient, and data-oblivious execution without reliance on fragile software and programmer trust. By sequestering sensitive data in dedicated secret registers and encrypting memory under a third-party key, Mojo-V prevents disclosures and enforces computation that is both blind (no direct disclosures) and silent (no side channel leakage). The design integrates seamlessly into the existing RISC-V ISA with only a mode bit and four new instructions, enforced entirely at decode. Early results show near-native execution speeds while offering over 5-7 orders of magnitude performance improvement compared to fully homomorphic encryption (FHE), with a clear roadmap for integration into CPUs, GPUs, and specialized accelerators.

To learn more...

The current Mojo-V ISA Extension Specification (release 0.91):

To contact the developers of Mojo-V:

The Mojo-V reference platform release 0.91 implements secret integer and floating-point computation using a fixed symmetric key cipher. As of this release, 64-bit secret computation is fully secretized and this early reference platform can be used for software development and red-teaming. Additional capabilities will be rolled out in future releases, including PKI support, LLVM compiler support, 32-bit RISC-V support, VIP-Bench benchmarks support, etc.

Specification Version: 0.91 (October 2025)
Contact: [email protected]

  1. Mojo-V ISA Spec v0.91
  2. Spike (Instruction Set Simulator) Implementation
    • Mojo-V integrated into riscv-isa-sim, nearly feature-complete
    • Missing only: Public-Key Infrastructure (PKI) support (currently uses fixed keys with a Simon-128 cipher)
    • To run Spike with Mojo-V extensions enabled, add the --isa=rv64gc_zicond_zkmojov_zicntr flag when running spike
  3. Mojo-V Bringup-Bench Benchmarks
    • Hand-coded examples (e.g., bubble-sort) showing Mojo-V working secret computation
    • Full battery of security tests for RV64GC+Mojo-V

Note, the remainder of the Bringup-bench benchmarks have NOT been ported to Mojo-V, as yet.

⚙️ Building and Running the Mojo-V Reference Platform

A. Install a RISC-V LLVM Compiler

You’ll need an LLVM-based RISC-V cross-compiler capable of producing RV64GC binaries.

Here is a good place to start: https://clang.llvm.org/get_started.html

B. Clone the Mojo-V Repository

git clone https://github.com/toddmaustin/mojo-v.git
cd mojo-v

C. Build the RISC-V Spike simulator with Mojo-V Support

sudo apt-get install device-tree-compiler libboost-regex-dev libboost-system-dev
cd riscv-isa-sim
mkdir build
cd build
../configure --prefix=$RISCV
make

D. Build and Run Mojo-V Bringup-Bench Benchmark Tests

  1. Build the Spike device driver

    cd bringup-bench/target
    make
  2. Configure your compiler

    Edit ../Makefile and set TARGET_CC for the mojov target to the location of your LVM Clang-based RISC-V compiler.

  3. Build and test

    cd ..                # go to the top-level bringup-bench directory
    make mojov-tests     # run all Mojo-V tests

    As an alternative, you can run an individual benchmark by going into its directory and running the following command.

    cd ../mojov-test
    make TARGET=mojov clean build test

🧪 Mojo-V Bringup-Bench Benchmarks Overview

Program Description
mojov-test Intro example from slides
mojov-test1 Secret-register and encrypted-memory semantics tests
mojov-test2 Hand-coded data-oblivious integer bubble-sort benchmark with Mojo-V fast encryption (int,fast)
mojov-test3 Hand-coded data-oblivious floating-point bubble-sort benchmark with Mojo-V fast encryption (fp,fast)
mojov-test4 Hand-coded data-oblivious integer bubble-sort benchmark with Mojo-V strong encryption (int,strong)
mojov-test5 Hand-coded data-oblivious floating-point bubble-sort benchmark with Mojo-V strong encryption (fp,strong)
mojov-sectests Hand-coded security test suite for RV64GC+Mojo-V that includes 130 pos + 245 neg tests == 375 total (int,fp,fast,strong)

All test benchmarks are hand-coded assembly programs demonstrating Mojo-V ISA rules and security semantics. The other Bringup-Bench benchmarks have not yet been ported to Mojo-V.


💬 Questions & Feedback

We welcome contributions, bug reports, and suggestions!

📧 Email: [email protected]
🌐 Project Home: https://github.com/toddmaustin/mojo-v

联系我们 contact @ memedata.com