Skip to content

Update EIP-7885: Migrate to liboqs implementation#2

Merged
simonmasson merged 3 commits intoZKNoxHQ:eip/NTT-proposalfrom
yhl125:eip/NTT-proposal
Nov 14, 2025
Merged

Update EIP-7885: Migrate to liboqs implementation#2
simonmasson merged 3 commits intoZKNoxHQ:eip/NTT-proposalfrom
yhl125:eip/NTT-proposal

Conversation

@yhl125
Copy link
Copy Markdown

@yhl125 yhl125 commented Sep 30, 2025

Summary

This PR updates EIP-7885 to reflect the liboqs-based implementation with improved performance metrics.

Changes

Implementation Migration

  • Library Change: Migrated from Lattigo v6 to liboqs with NTT CGO bindings
  • Key Addition: Custom NTT CGO bindings added to liboqs for efficient Number Theoretic Transform operations

Supported Schemes

  • Falcon-512 (n=512, q=12289)
  • Falcon-1024 (n=1024, q=12289)
  • ML-DSA/Dilithium (n=256, q=8380417)

Gas Cost Updates

NTT Precompiles (0x12, 0x13)

  • Scheme-specific costs:
  • Falcon-512: 500 gas
  • Falcon-1024: 1,080 gas
  • ML-DSA (Dilithium): 256 gas (FW), 340 gas (INV)

Vector Operations (0x14, 0x15)

  • VECMULMOD: ceil(0.32 × N)
  • VECADDMOD: ceil(0.3 × N)

Documentation Updates

EIP-7885.md

  • Updated Gas Cost Analysis section with scheme-specific model
  • Updated Native Client Implementation section with liboqs details
  • Updated benchmark results

Testing

  • All test cases updated with correct gas costs
  • Benchmark results validated on Intel(R) Xeon(R) CPU @ 2.20GHz
  • Round-trip verification (INTT(NTT(x)) = x) passes for all schemes

Related Files

  • EIPS/eip-7885.md - Main EIP specification
  • assets/eip-7885/op-geth - Update implementation

@yhl125 yhl125 changed the title Fix EIP-7885 formatting and linking errors, add co-author Update EIP-7885: add VECMULMOD and VECADDMOD go implementation and fix markdown errors, add co-author Oct 1, 2025
@yhl125 yhl125 marked this pull request as draft October 31, 2025 05:27
- Replace Lattigo-based implementation with liboqs library implementation
- Update gas costs: NTT (scheme-specific: 256-1080 gas), VECMULMOD (ceil(0.32×N)), VECADDMOD (ceil(0.3×N))
- Update benchmark results
@yhl125 yhl125 changed the title Update EIP-7885: add VECMULMOD and VECADDMOD go implementation and fix markdown errors, add co-author Update EIP-7885: Migrate to liboqs implementation Nov 6, 2025
@yhl125 yhl125 marked this pull request as ready for review November 7, 2025 04:57
@simonmasson simonmasson merged commit c50b0e1 into ZKNoxHQ:eip/NTT-proposal Nov 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants