c2sp/wycheproof
Composer 安装命令:
composer require --dev c2sp/wycheproof
包简介
Wycheproof test vectors for cryptographic software
README 文档
README
Project Wycheproof is a community managed repository of test vectors that can be used by cryptography library developers to test against known attacks, specification inconsistencies, and other various implementation bugs.
Test vectors are maintained as JSON test vector data, with accompanying JSON schema files that document the structure of the test vector data.
Getting started
- Clone this repository. You may also want to integrate Wycheproof as a Git submodule or otherwise set up automation to keep track of changes over time.
- Write (or generate from the JSON schema files) code to load the vector data as appropriate for your implementation language/project.
- For each algorithm of interest, identify the inputs to your cryptography APIs, and the produced outputs, mapping back to what the test vectors provide.
- Iterate through applicable test vectors, ensuring that the results produced by your API when given the relevant input data matches the test vector expected results.
- For best results, integrate this process into your continuous integration (CI) process so tests are run for all new contributions/changes.
You may find it helpful to examine how other projects like pyca/cryptography have integrated Wycheproof's test vectors.
Coverage
Project Wycheproof has test vectors for the most popular crypto algorithms, including
- AEGIS
- AES-EAX
- AES-FF1
- AES-GCM
- AES-SIV
- ARIA
- ASCON
- Camellia
- ChaCha20-Poly1305
- XChaCha20-Poly1305
- DH
- DHIES
- DSA
- ECDH
- ECDSA
- EdDSA
- ECIES
- HKDF
- HMAC
- KMAC
- MORUS
- PBKDF2
- RSA
- SEED
- SipHash
- SM4
- VMAC
- X25519, X448
- BLS-12-381
- ML-KEM (CRYSTALS-Kyber)
- ML-DSA (CRYSTALS-Dilithium)
The test vectors detect whether a library is vulnerable to many attacks, including
- Invalid curve attacks
- Biased nonces in digital signature schemes
- Of course, all Bleichenbacher’s attacks
- And many more -- we have over 80 test cases
We welcome contribution of new test vector data, and algorithms.
Contributing
If you want to contribute, please read CONTRIBUTING and send us pull requests. You can also report bugs or request new tests as GitHub issues.
Development Priorities
We're in the process of revitalizing development and maintenance of Project Wycheproof as a C2SP project with a renewed focus on the test vector data. Our immediate priorities are:
- Completing JSON schema descriptions of all test vectors.
- Improving documentation and tooling support for external contributors to provide new test data to existing vector files.
- Developing a community of downstream consumers who can help sheppard maintenance and review of new test vector data.
- Adding additional algorithm and test case coverage to the test vector data.
FAQ
Why is the project called "Wycheproof"?
Project Wycheproof is named after Mount Wycheproof, the smallest mountain in the world. The main motivation for the project at the time of its creation was to have a goal that is achievable. The smaller the mountain the more likely it is to be able to climb it.
What downstream projects use Wycheproof testvectors?
Wycheproof test vectors are used in some form by a number of important cryptography projects and libraries. In no particular order these include:
- OpenSSL
- BoringSSL
- aws-lc
- LibreSSL
- NSS
- pyca/cryptography
- Botan
- Go cryptography
- swift-crypto
- RustCrypto
- Graviola
- Tink
- PyCryptdome
- OpenTitan
- Zig
- liboqs
- bc-rust
If your project uses test vectors from Wycheproof, feel free to open a PR to add it to the list above!
Has Wycheproof testing found notable bugs?
See doc/bugs.md for some notable historic bugs found using Wycheproof's test harnesses, or test vector data.
Where is the testvectors/ directory?
We recently combined the testvectors/ and testvectors_v1/ directories into
a single unified directory with one consistent approach to schemas.
Users requiring the original ("v0") test vector data can clone this repo from
the wycheproof-v0-vectors tag, but are encouraged to consider updating to
use testvectors_v1/ to benefit from future updates. If there are features/test
coverage from testvectors/ missing from testvectors_v1/, or there's another
issue blocking your update please open an issue describing your needs.
Do all vectors have schemas?
At the time of writing, the following testvectors_v1 files are missing schemas:
testvectors_v1/aes_ff1_base*_test.jsontestvectors_v1/aes_ff1_radix*_test.jsontestvectors_v1/ecdsa_secp256k1_sha256_bitcoin_test.jsontestvectors_v1/pbes2_hmacsha*_aes_*_test.jsontestvectors_v1/pbkdf2_hmacsha*_test.jsontestvectors_v1/rsa_pss_*_sha*_mgf*_params_test.jsontestvectors_v1/rsa_pss_misc_params_test.json
Contribution of schemas for the above vectors would be most welcome.
Is there additional documentation about test vectors?
Some legacy documentation for files, formats and types are available, but not necessarily in-sync with the current test vector state.
In general, prefer referencing the schema files since these are tested in CI to ensure vector file contents match their advertised schema.
Where is the test harness code?
Historically Wycheproof also included test harnesses (e.g. for Java and
Javascript cryptography implementations) that tested a variety of attacks
directly against implementations. Since transitioning to community support
these harnesses have been removed (but still exist in git
history for interested parties at cd27d64). Our current focus is on
implementation-agnostic test vectors.
Testing 3rd party cryptography libraries directly means flaws are only uncovered after they have been committed, and potentially released, by the projects under test. Instead, we encourage downstream projects to regularly test their code using Wycheproof test vectors as part of their development process. This approach helps catch flaws before they can become CVEs, means new features get tested immediately, and helps distribute the maintenance burden. This allows the Wycheproof maintainers to focus on test vectors instead of tracking downstream development of many projects while simultaneously maintaining an ever-increasing number of language & project-specific test harnesses.
Parties interested in test harnesses may find continued work by Daniel Bleichenbacher in Rooterberg of interest.
Who created Wycheproof?
Project Wycheproof was originally created and maintained by:
- Daniel Bleichenbacher
- Thai Duong
- Emilia Kasper
- Quan Nguyen
- Charles Lee
c2sp/wycheproof 适用场景与选型建议
c2sp/wycheproof 是一款 基于 Go 开发的 Composer 扩展包,目前已累计 431 次下载、GitHub Stars 达 3.08k, 最近一次更新时间为 2025 年 09 月 02 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「testing」 「cryptography」 「crypto」 「wycheproof」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 c2sp/wycheproof 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 c2sp/wycheproof 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 c2sp/wycheproof 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
DUKPT implementation in PHP
Testing Suite For Lumen like Laravel does.
High-level cryptographic primitives and security utilities for Maatify systems including password hashing, reversible encryption, HKDF key derivation, and key rotation.
A library for reading KeePass 2.x databases
The PHP SDK for Checkmango
Laravel authentication middleware for UZI passes.
统计信息
- 总下载量: 431
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3079
- 点击次数: 23
- 依赖项目数: 4
- 推荐数: 0
其他信息
- 授权协议: Apache-2.0
- 更新时间: 2025-09-02