[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-trail-of-bits-wycheproof":3,"mdc-e2ghbr-key":35,"related-org-trail-of-bits-wycheproof":5145,"related-repo-trail-of-bits-wycheproof":5300},{"slug":4,"name":4,"fn":5,"description":6,"org":7,"tags":12,"stars":23,"repoUrl":24,"updatedAt":25,"license":26,"forks":27,"topics":28,"repo":30,"sourceUrl":33,"mdContent":34},"wycheproof","validate cryptographic implementations with test vectors","Wycheproof provides test vectors for validating cryptographic implementations. Use when testing crypto code for known attacks and edge cases.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},"trail-of-bits","Trail of Bits","https:\u002F\u002Fpexgzepcugksgbtrxkhf.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Forg-logos\u002Ftrail-of-bits.png","trailofbits",[13,17,20],{"name":14,"slug":15,"type":16},"Security","security","tag",{"name":18,"slug":19,"type":16},"Cryptography","cryptography",{"name":21,"slug":22,"type":16},"Testing","testing",6139,"https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Fskills","2026-07-17T06:05:19.482549",null,541,[29],"agent-skills",{"repoUrl":24,"stars":23,"forks":27,"topics":31,"description":32},[29],"Trail of Bits Claude Code skills for security research, vulnerability detection, and audit workflows","https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Fskills\u002Ftree\u002FHEAD\u002Fplugins\u002Ftesting-handbook-skills\u002Fskills\u002Fwycheproof","---\nname: wycheproof\ntype: domain\ndescription: >\n  Wycheproof provides test vectors for validating cryptographic implementations.\n  Use when testing crypto code for known attacks and edge cases.\n---\n\n# Wycheproof\n\nWycheproof is an extensive collection of test vectors designed to verify the correctness of cryptographic implementations and test against known attacks. Originally developed by Google, it is now a community-managed project where contributors can add test vectors for specific cryptographic constructions.\n\n## Background\n\n### Key Concepts\n\n| Concept | Description |\n|---------|-------------|\n| Test vector | Input\u002Foutput pair for validating crypto implementation correctness |\n| Test group | Collection of test vectors sharing attributes (key size, IV size, curve) |\n| Result flag | Indicates if test should pass (valid), fail (invalid), or is acceptable |\n| Edge case testing | Testing for known vulnerabilities and attack patterns |\n\n### Why This Matters\n\nCryptographic implementations are notoriously difficult to get right. Even small bugs can:\n- Expose private keys\n- Allow signature forgery\n- Enable message decryption\n- Create consensus problems when different implementations accept\u002Freject the same inputs\n\nWycheproof has found vulnerabilities in major libraries including OpenJDK's SHA1withDSA, Bouncy Castle's ECDHC, and the elliptic npm package.\n\n## When to Use\n\n**Apply Wycheproof when:**\n- Testing cryptographic implementations (AES-GCM, ECDSA, ECDH, RSA, etc.)\n- Validating that crypto code handles edge cases correctly\n- Verifying implementations against known attack vectors\n- Setting up CI\u002FCD for cryptographic libraries\n- Auditing third-party crypto code for correctness\n\n**Consider alternatives when:**\n- Testing for timing side-channels (use constant-time testing tools instead)\n- Finding new unknown bugs (use fuzzing instead)\n- Testing custom\u002Fexperimental cryptographic algorithms (Wycheproof only covers established algorithms)\n\n## Quick Reference\n\n| Scenario | Recommended Approach | Notes |\n|----------|---------------------|-------|\n| AES-GCM implementation | Use `aes_gcm_test.json` | 316 test vectors across 44 test groups |\n| ECDSA verification | Use `ecdsa_*_test.json` for specific curves | Tests signature malleability, DER encoding |\n| ECDH key exchange | Use `ecdh_*_test.json` | Tests invalid curve attacks |\n| RSA signatures | Use `rsa_*_test.json` | Tests padding oracle attacks |\n| ChaCha20-Poly1305 | Use `chacha20_poly1305_test.json` | Tests AEAD implementation |\n\n## Testing Workflow\n\n```\nPhase 1: Setup                 Phase 2: Parse Test Vectors\n┌─────────────────┐          ┌─────────────────┐\n│ Add Wycheproof  │    →     │ Load JSON file  │\n│ as submodule    │          │ Filter by params│\n└─────────────────┘          └─────────────────┘\n         ↓                            ↓\nPhase 4: CI Integration        Phase 3: Write Harness\n┌─────────────────┐          ┌─────────────────┐\n│ Auto-update     │    ←     │ Test valid &    │\n│ test vectors    │          │ invalid cases   │\n└─────────────────┘          └─────────────────┘\n```\n\n## Repository Structure\n\nThe Wycheproof repository is organized as follows:\n\n```text\n┣ 📜 README.md       : Project overview\n┣ 📂 doc             : Documentation\n┣ 📂 java            : Java JCE interface testing harness\n┣ 📂 javascript      : JavaScript testing harness\n┣ 📂 schemas         : Test vector schemas\n┣ 📂 testvectors     : Test vectors\n┗ 📂 testvectors_v1  : Updated test vectors (more detailed)\n```\n\nThe essential folders are `testvectors` and `testvectors_v1`. While both contain similar files, `testvectors_v1` includes more detailed information and is recommended for new integrations.\n\n## Supported Algorithms\n\nWycheproof provides test vectors for a wide range of cryptographic algorithms:\n\n| Category | Algorithms |\n|----------|------------|\n| **Symmetric Encryption** | AES-GCM, AES-EAX, ChaCha20-Poly1305 |\n| **Signatures** | ECDSA, EdDSA, RSA-PSS, RSA-PKCS1 |\n| **Key Exchange** | ECDH, X25519, X448 |\n| **Hashing** | HMAC, HKDF |\n| **Curves** | secp256k1, secp256r1, secp384r1, secp521r1, ed25519, ed448 |\n\n## Test File Structure\n\nEach JSON test file tests a specific cryptographic construction. All test files share common attributes:\n\n```json\n\"algorithm\"         : The name of the algorithm tested\n\"schema\"            : The JSON schema (found in schemas folder)\n\"generatorVersion\"  : The version number\n\"numberOfTests\"     : The total number of test vectors in this file\n\"header\"            : Detailed description of test vectors\n\"notes\"             : In-depth explanation of flags in test vectors\n\"testGroups\"        : Array of one or multiple test groups\n```\n\n### Test Groups\n\nTest groups group sets of tests based on shared attributes such as:\n- Key sizes\n- IV sizes\n- Public keys\n- Curves\n\nThis classification allows extracting tests that meet specific criteria relevant to the construction being tested.\n\n### Test Vector Attributes\n\n#### Shared Attributes\n\nAll test vectors contain four common fields:\n\n- **tcId**: Unique identifier for the test vector within a file\n- **comment**: Additional information about the test case\n- **flags**: Descriptions of specific test case types and potential dangers (referenced in `notes` field)\n- **result**: Expected outcome of the test\n\nThe `result` field can take three values:\n\n| Result | Meaning |\n|--------|---------|\n| **valid** | Test case should succeed |\n| **acceptable** | Test case is allowed to succeed but contains non-ideal attributes |\n| **invalid** | Test case should fail |\n\n#### Unique Attributes\n\nUnique attributes are specific to the algorithm being tested:\n\n| Algorithm | Unique Attributes |\n|-----------|-------------------|\n| AES-GCM | `key`, `iv`, `aad`, `msg`, `ct`, `tag` |\n| ECDH secp256k1 | `public`, `private`, `shared` |\n| ECDSA | `msg`, `sig`, `result` |\n| EdDSA | `msg`, `sig`, `pk` |\n\n## Implementation Guide\n\n### Phase 1: Add Wycheproof to Your Project\n\n**Option 1: Git Submodule (Recommended)**\n\nAdding Wycheproof as a git submodule ensures automatic updates:\n\n```bash\ngit submodule add https:\u002F\u002Fgithub.com\u002FC2SP\u002Fwycheproof.git\n```\n\n**Option 2: Fetch Specific Test Vectors**\n\nIf submodules aren't possible, fetch specific JSON files:\n\n```bash\n#!\u002Fbin\u002Fbash\n\nTMP_WYCHEPROOF_FOLDER=\".wycheproof\u002F\"\nTEST_VECTORS=('aes_gcm_test.json' 'aes_eax_test.json')\nBASE_URL=\"https:\u002F\u002Fraw.githubusercontent.com\u002FC2SP\u002Fwycheproof\u002Fmaster\u002Ftestvectors_v1\u002F\"\n\n# Create wycheproof folder\nmkdir -p $TMP_WYCHEPROOF_FOLDER\n\n# Request all test vector files if they don't exist\nfor i in \"${TEST_VECTORS[@]}\"; do\n  if [ ! -f \"${TMP_WYCHEPROOF_FOLDER}${i}\" ]; then\n    curl -o \"${TMP_WYCHEPROOF_FOLDER}${i}\" \"${BASE_URL}${i}\"\n    if [ $? -ne 0 ]; then\n      echo \"Failed to download ${i}\"\n      exit 1\n    fi\n  fi\ndone\n```\n\n### Phase 2: Parse Test Vectors\n\nIdentify the test file for your algorithm and parse the JSON:\n\n**Python Example:**\n\n```python\nimport json\n\ndef load_wycheproof_test_vectors(path: str):\n    testVectors = []\n    try:\n        with open(path, \"r\") as f:\n            wycheproof_json = json.loads(f.read())\n    except FileNotFoundError:\n        print(f\"No Wycheproof file found at: {path}\")\n        return testVectors\n\n    # Attributes that need hex-to-bytes conversion\n    convert_attr = {\"key\", \"aad\", \"iv\", \"msg\", \"ct\", \"tag\"}\n\n    for testGroup in wycheproof_json[\"testGroups\"]:\n        # Filter test groups based on implementation constraints\n        if testGroup[\"ivSize\"] \u003C 64 or testGroup[\"ivSize\"] > 1024:\n            continue\n\n        for tv in testGroup[\"tests\"]:\n            # Convert hex strings to bytes\n            for attr in convert_attr:\n                if attr in tv:\n                    tv[attr] = bytes.fromhex(tv[attr])\n            testVectors.append(tv)\n\n    return testVectors\n```\n\n**JavaScript Example:**\n\n```javascript\nconst fs = require('fs').promises;\n\nasync function loadWycheproofTestVectors(path) {\n  const tests = [];\n\n  try {\n    const fileContent = await fs.readFile(path);\n    const data = JSON.parse(fileContent.toString());\n\n    data.testGroups.forEach(testGroup => {\n      testGroup.tests.forEach(test => {\n        \u002F\u002F Add shared test group properties to each test\n        test['pk'] = testGroup.publicKey.pk;\n        tests.push(test);\n      });\n    });\n  } catch (err) {\n    console.error('Error reading or parsing file:', err);\n    throw err;\n  }\n\n  return tests;\n}\n```\n\n### Phase 3: Write Testing Harness\n\nCreate test functions that handle both valid and invalid test cases.\n\n**Python\u002Fpytest Example:**\n\n```python\nimport pytest\nfrom cryptography.hazmat.primitives.ciphers.aead import AESGCM\n\ntvs = load_wycheproof_test_vectors(\"wycheproof\u002Ftestvectors_v1\u002Faes_gcm_test.json\")\n\n@pytest.mark.parametrize(\"tv\", tvs, ids=[str(tv['tcId']) for tv in tvs])\ndef test_encryption(tv):\n    try:\n        aesgcm = AESGCM(tv['key'])\n        ct = aesgcm.encrypt(tv['iv'], tv['msg'], tv['aad'])\n    except ValueError as e:\n        # Implementation raised error - verify test was expected to fail\n        assert tv['result'] != 'valid', tv['comment']\n        return\n\n    if tv['result'] == 'valid':\n        assert ct[:-16] == tv['ct'], f\"Ciphertext mismatch: {tv['comment']}\"\n        assert ct[-16:] == tv['tag'], f\"Tag mismatch: {tv['comment']}\"\n    elif tv['result'] == 'invalid' or tv['result'] == 'acceptable':\n        assert ct[:-16] != tv['ct'] or ct[-16:] != tv['tag']\n\n@pytest.mark.parametrize(\"tv\", tvs, ids=[str(tv['tcId']) for tv in tvs])\ndef test_decryption(tv):\n    try:\n        aesgcm = AESGCM(tv['key'])\n        decrypted_msg = aesgcm.decrypt(tv['iv'], tv['ct'] + tv['tag'], tv['aad'])\n    except ValueError:\n        assert tv['result'] != 'valid', tv['comment']\n        return\n    except InvalidTag:\n        assert tv['result'] != 'valid', tv['comment']\n        assert 'ModifiedTag' in tv['flags'], f\"Expected 'ModifiedTag' flag: {tv['comment']}\"\n        return\n\n    assert tv['result'] == 'valid', f\"No invalid test case should pass: {tv['comment']}\"\n    assert decrypted_msg == tv['msg'], f\"Decryption mismatch: {tv['comment']}\"\n```\n\n**JavaScript\u002FMocha Example:**\n\n```javascript\nconst assert = require('assert');\n\nfunction testFactory(tcId, tests) {\n  it(`[${tcId + 1}] ${tests[tcId].comment}`, function () {\n    const test = tests[tcId];\n    const ed25519 = new eddsa('ed25519');\n    const key = ed25519.keyFromPublic(toArray(test.pk, 'hex'));\n\n    let sig;\n    if (test.result === 'valid') {\n      sig = key.verify(test.msg, test.sig);\n      assert.equal(sig, true, `[${test.tcId}] ${test.comment}`);\n    } else if (test.result === 'invalid') {\n      try {\n        sig = key.verify(test.msg, test.sig);\n      } catch (err) {\n        \u002F\u002F Point could not be decoded\n        sig = false;\n      }\n      assert.equal(sig, false, `[${test.tcId}] ${test.comment}`);\n    }\n  });\n}\n\n\u002F\u002F Generate tests for all test vectors\nfor (var tcId = 0; tcId \u003C tests.length; tcId++) {\n  testFactory(tcId, tests);\n}\n```\n\n### Phase 4: CI Integration\n\nEnsure test vectors stay up to date by:\n\n1. **Using git submodules**: Update submodule in CI before running tests\n2. **Fetching latest vectors**: Run fetch script before test execution\n3. **Scheduled updates**: Set up weekly\u002Fmonthly updates to catch new test vectors\n\n## Common Vulnerabilities Detected\n\nWycheproof test vectors are designed to catch specific vulnerability patterns:\n\n| Vulnerability | Description | Affected Algorithms | Example CVE |\n|---------------|-------------|---------------------|-------------|\n| Signature malleability | Multiple valid signatures for same message | ECDSA, EdDSA | CVE-2024-42459 |\n| Invalid DER encoding | Accepting non-canonical DER signatures | ECDSA | CVE-2024-42460, CVE-2024-42461 |\n| Invalid curve attacks | ECDH with invalid curve points | ECDH | Common in many libraries |\n| Padding oracle | Timing leaks in padding validation | RSA-PKCS1 | Historical OpenSSL issues |\n| Tag forgery | Accepting modified authentication tags | AES-GCM, ChaCha20-Poly1305 | Various implementations |\n\n### Signature Malleability: Deep Dive\n\n**Problem:** Implementations that don't validate signature encoding can accept multiple valid signatures for the same message.\n\n**Example (EdDSA):** Appending or removing zeros from signature:\n```text\nValid signature:   ...6a5c51eb6f946b30d\nInvalid signature: ...6a5c51eb6f946b30d0000  (should be rejected)\n```\n\n**How to detect:**\n```python\n# Add signature length check\nif len(sig) != 128:  # EdDSA signatures must be exactly 64 bytes (128 hex chars)\n    return False\n```\n\n**Impact:** Can lead to consensus problems when different implementations accept\u002Freject the same signatures.\n\n**Related Wycheproof tests:**\n- EdDSA: tcId 37 - \"removing 0 byte from signature\"\n- ECDSA: tcId 06 - \"Legacy: ASN encoding of r misses leading 0\"\n\n## Case Study: Elliptic npm Package\n\nThis case study demonstrates how Wycheproof found three CVEs in the popular elliptic npm package (3000+ dependents, millions of weekly downloads).\n\n### Overview\n\nThe [elliptic](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Felliptic) library is an elliptic-curve cryptography library written in JavaScript, supporting ECDH, ECDSA, and EdDSA. Using Wycheproof test vectors on version 6.5.6 revealed multiple vulnerabilities:\n\n- **CVE-2024-42459**: EdDSA signature malleability (appending\u002Fremoving zeros)\n- **CVE-2024-42460**: ECDSA DER encoding - invalid bit placement\n- **CVE-2024-42461**: ECDSA DER encoding - leading zero in length field\n\n### Methodology\n\n1. **Identify supported curves**: ed25519 for EdDSA\n2. **Find test vectors**: `testvectors_v1\u002Fed25519_test.json`\n3. **Parse test vectors**: Load JSON and extract tests\n4. **Write test harness**: Create parameterized tests\n5. **Run tests**: Identify failures\n6. **Analyze root causes**: Examine implementation code\n7. **Propose fixes**: Add validation checks\n\n### Key Findings\n\n**EdDSA Issue (CVE-2024-42459):**\n- Missing signature length validation\n- Allowed trailing zeros in signatures\n- Fix: Add `if(sig.length !== 128) return false;`\n\n**ECDSA Issue 1 (CVE-2024-42460):**\n- Missing check for first bit being zero in DER-encoded r and s values\n- Fix: Add `if ((data[p.place] & 128) !== 0) return false;`\n\n**ECDSA Issue 2 (CVE-2024-42461):**\n- DER length field accepted leading zeros\n- Fix: Add `if(buf[p.place] === 0x00) return false;`\n\n### Impact\n\nAll three vulnerabilities allowed multiple valid signatures for a single message, leading to consensus problems across implementations.\n\n**Lessons learned:**\n- Wycheproof catches subtle encoding bugs\n- Reusable test harnesses pay dividends\n- Test vector comments and flags help diagnose issues\n- Even popular libraries benefit from systematic test vector validation\n\n## Advanced Usage\n\n### Tips and Tricks\n\n| Tip | Why It Helps |\n|-----|--------------|\n| Filter test groups by parameters | Focus on test vectors relevant to your implementation constraints |\n| Use test vector flags | Understand specific vulnerability patterns being tested |\n| Check the `notes` field | Get detailed explanations of flag meanings |\n| Test both encrypt\u002Fdecrypt and sign\u002Fverify | Ensure bidirectional correctness |\n| Run tests in CI | Catch regressions and benefit from new test vectors |\n| Use parameterized tests | Get clear failure messages with tcId and comment |\n\n### Common Mistakes\n\n| Mistake | Why It's Wrong | Correct Approach |\n|---------|----------------|------------------|\n| Only testing valid cases | Misses vulnerabilities where invalid inputs are accepted | Test all result types: valid, invalid, acceptable |\n| Ignoring \"acceptable\" result | Implementation might have subtle bugs | Treat acceptable as warnings worth investigating |\n| Not filtering test groups | Wastes time on unsupported parameters | Filter by keySize, ivSize, etc. based on your implementation |\n| Not updating test vectors | Miss new vulnerability patterns | Use submodules or scheduled fetches |\n| Testing only one direction | Encrypt\u002Fsign might work but decrypt\u002Fverify fails | Test both operations |\n\n## Related Skills\n\n### Tool Skills\n\n| Skill | Primary Use in Wycheproof Testing |\n|-------|-----------------------------------|\n| **pytest** | Python testing framework for parameterized tests |\n| **mocha** | JavaScript testing framework for test generation |\n| **constant-time-testing** | Complement Wycheproof with timing side-channel testing |\n| **cryptofuzz** | Fuzz-based crypto testing to find additional bugs |\n\n### Technique Skills\n\n| Skill | When to Apply |\n|-------|---------------|\n| **coverage-analysis** | Ensure test vectors cover all code paths in crypto implementation |\n| **property-based-testing** | Test mathematical properties (e.g., encrypt\u002Fdecrypt round-trip) |\n| **fuzz-harness-writing** | Create harnesses for crypto parsers (complements Wycheproof) |\n\n### Related Domain Skills\n\n| Skill | Relationship |\n|-------|--------------|\n| **crypto-testing** | Wycheproof is a key tool in comprehensive crypto testing methodology |\n| **fuzzing** | Use fuzzing to find bugs Wycheproof doesn't cover (new edge cases) |\n\n## Skill Dependency Map\n\n```\n                    ┌─────────────────────┐\n                    │    wycheproof       │\n                    │   (this skill)      │\n                    └──────────┬──────────┘\n                               │\n           ┌───────────────────┼───────────────────┐\n           │                   │                   │\n           ▼                   ▼                   ▼\n┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐\n│  pytest\u002Fmocha   │ │ constant-time   │ │   cryptofuzz    │\n│ (test framework)│ │   testing       │ │   (fuzzing)     │\n└────────┬────────┘ └────────┬────────┘ └────────┬────────┘\n         │                   │                   │\n         └───────────────────┼───────────────────┘\n                             │\n                             ▼\n              ┌──────────────────────────┐\n              │   Technique Skills       │\n              │ coverage, harness, PBT   │\n              └──────────────────────────┘\n```\n\n## Resources\n\n### Official Repository\n\n**[Wycheproof GitHub Repository](https:\u002F\u002Fgithub.com\u002FC2SP\u002Fwycheproof)**\n\nThe official repository contains:\n- All test vectors in `testvectors\u002F` and `testvectors_v1\u002F`\n- JSON schemas in `schemas\u002F`\n- Reference implementations in Java and JavaScript\n- Documentation in `doc\u002F`\n\n### Real-World Examples\n\n**[pycryptodome](https:\u002F\u002Fpypi.org\u002Fproject\u002Fpycryptodome\u002F)**\n\nThe pycryptodome library integrates Wycheproof test vectors in their test suite, demonstrating best practices for Python crypto implementations.\n\n### Community Resources\n\n- [C2SP Community](https:\u002F\u002Fc2sp.org\u002F) - Cryptographic specifications and standards community maintaining Wycheproof\n- Wycheproof issues tracker - Report bugs in test vectors or suggest new constructions\n\n## Summary\n\nWycheproof is an essential tool for validating cryptographic implementations against known attack vectors and edge cases. By integrating Wycheproof test vectors into your testing workflow:\n\n1. Catch subtle encoding and validation bugs\n2. Prevent signature malleability issues\n3. Ensure consistent behavior across implementations\n4. Benefit from community-contributed test vectors\n5. Protect against known cryptographic vulnerabilities\n\nThe investment in writing a reusable testing harness pays dividends through continuous validation as new test vectors are added to the Wycheproof repository.\n",{"data":36,"body":38},{"name":4,"type":37,"description":6},"domain",{"type":39,"children":40},"root",[41,49,55,62,69,149,155,160,185,190,196,205,233,241,259,265,411,417,429,435,440,449,477,483,488,590,596,601,770,776,781,803,808,814,821,826,876,888,958,964,969,1131,1137,1143,1151,1156,1189,1197,1202,1642,1648,1653,1661,1889,1897,2532,2538,2543,2551,2842,2850,3891,3897,3902,3936,3942,3947,4092,4098,4108,4118,4127,4135,4166,4176,4184,4197,4203,4208,4214,4229,4261,4267,4346,4352,4360,4384,4392,4410,4418,4436,4442,4447,4455,4478,4484,4490,4597,4603,4720,4726,4732,4818,4824,4893,4899,4952,4958,4967,4973,4979,4992,4997,5045,5051,5064,5069,5075,5095,5101,5106,5134,5139],{"type":42,"tag":43,"props":44,"children":45},"element","h1",{"id":4},[46],{"type":47,"value":48},"text","Wycheproof",{"type":42,"tag":50,"props":51,"children":52},"p",{},[53],{"type":47,"value":54},"Wycheproof is an extensive collection of test vectors designed to verify the correctness of cryptographic implementations and test against known attacks. Originally developed by Google, it is now a community-managed project where contributors can add test vectors for specific cryptographic constructions.",{"type":42,"tag":56,"props":57,"children":59},"h2",{"id":58},"background",[60],{"type":47,"value":61},"Background",{"type":42,"tag":63,"props":64,"children":66},"h3",{"id":65},"key-concepts",[67],{"type":47,"value":68},"Key Concepts",{"type":42,"tag":70,"props":71,"children":72},"table",{},[73,92],{"type":42,"tag":74,"props":75,"children":76},"thead",{},[77],{"type":42,"tag":78,"props":79,"children":80},"tr",{},[81,87],{"type":42,"tag":82,"props":83,"children":84},"th",{},[85],{"type":47,"value":86},"Concept",{"type":42,"tag":82,"props":88,"children":89},{},[90],{"type":47,"value":91},"Description",{"type":42,"tag":93,"props":94,"children":95},"tbody",{},[96,110,123,136],{"type":42,"tag":78,"props":97,"children":98},{},[99,105],{"type":42,"tag":100,"props":101,"children":102},"td",{},[103],{"type":47,"value":104},"Test vector",{"type":42,"tag":100,"props":106,"children":107},{},[108],{"type":47,"value":109},"Input\u002Foutput pair for validating crypto implementation correctness",{"type":42,"tag":78,"props":111,"children":112},{},[113,118],{"type":42,"tag":100,"props":114,"children":115},{},[116],{"type":47,"value":117},"Test group",{"type":42,"tag":100,"props":119,"children":120},{},[121],{"type":47,"value":122},"Collection of test vectors sharing attributes (key size, IV size, curve)",{"type":42,"tag":78,"props":124,"children":125},{},[126,131],{"type":42,"tag":100,"props":127,"children":128},{},[129],{"type":47,"value":130},"Result flag",{"type":42,"tag":100,"props":132,"children":133},{},[134],{"type":47,"value":135},"Indicates if test should pass (valid), fail (invalid), or is acceptable",{"type":42,"tag":78,"props":137,"children":138},{},[139,144],{"type":42,"tag":100,"props":140,"children":141},{},[142],{"type":47,"value":143},"Edge case testing",{"type":42,"tag":100,"props":145,"children":146},{},[147],{"type":47,"value":148},"Testing for known vulnerabilities and attack patterns",{"type":42,"tag":63,"props":150,"children":152},{"id":151},"why-this-matters",[153],{"type":47,"value":154},"Why This Matters",{"type":42,"tag":50,"props":156,"children":157},{},[158],{"type":47,"value":159},"Cryptographic implementations are notoriously difficult to get right. Even small bugs can:",{"type":42,"tag":161,"props":162,"children":163},"ul",{},[164,170,175,180],{"type":42,"tag":165,"props":166,"children":167},"li",{},[168],{"type":47,"value":169},"Expose private keys",{"type":42,"tag":165,"props":171,"children":172},{},[173],{"type":47,"value":174},"Allow signature forgery",{"type":42,"tag":165,"props":176,"children":177},{},[178],{"type":47,"value":179},"Enable message decryption",{"type":42,"tag":165,"props":181,"children":182},{},[183],{"type":47,"value":184},"Create consensus problems when different implementations accept\u002Freject the same inputs",{"type":42,"tag":50,"props":186,"children":187},{},[188],{"type":47,"value":189},"Wycheproof has found vulnerabilities in major libraries including OpenJDK's SHA1withDSA, Bouncy Castle's ECDHC, and the elliptic npm package.",{"type":42,"tag":56,"props":191,"children":193},{"id":192},"when-to-use",[194],{"type":47,"value":195},"When to Use",{"type":42,"tag":50,"props":197,"children":198},{},[199],{"type":42,"tag":200,"props":201,"children":202},"strong",{},[203],{"type":47,"value":204},"Apply Wycheproof when:",{"type":42,"tag":161,"props":206,"children":207},{},[208,213,218,223,228],{"type":42,"tag":165,"props":209,"children":210},{},[211],{"type":47,"value":212},"Testing cryptographic implementations (AES-GCM, ECDSA, ECDH, RSA, etc.)",{"type":42,"tag":165,"props":214,"children":215},{},[216],{"type":47,"value":217},"Validating that crypto code handles edge cases correctly",{"type":42,"tag":165,"props":219,"children":220},{},[221],{"type":47,"value":222},"Verifying implementations against known attack vectors",{"type":42,"tag":165,"props":224,"children":225},{},[226],{"type":47,"value":227},"Setting up CI\u002FCD for cryptographic libraries",{"type":42,"tag":165,"props":229,"children":230},{},[231],{"type":47,"value":232},"Auditing third-party crypto code for correctness",{"type":42,"tag":50,"props":234,"children":235},{},[236],{"type":42,"tag":200,"props":237,"children":238},{},[239],{"type":47,"value":240},"Consider alternatives when:",{"type":42,"tag":161,"props":242,"children":243},{},[244,249,254],{"type":42,"tag":165,"props":245,"children":246},{},[247],{"type":47,"value":248},"Testing for timing side-channels (use constant-time testing tools instead)",{"type":42,"tag":165,"props":250,"children":251},{},[252],{"type":47,"value":253},"Finding new unknown bugs (use fuzzing instead)",{"type":42,"tag":165,"props":255,"children":256},{},[257],{"type":47,"value":258},"Testing custom\u002Fexperimental cryptographic algorithms (Wycheproof only covers established algorithms)",{"type":42,"tag":56,"props":260,"children":262},{"id":261},"quick-reference",[263],{"type":47,"value":264},"Quick Reference",{"type":42,"tag":70,"props":266,"children":267},{},[268,289],{"type":42,"tag":74,"props":269,"children":270},{},[271],{"type":42,"tag":78,"props":272,"children":273},{},[274,279,284],{"type":42,"tag":82,"props":275,"children":276},{},[277],{"type":47,"value":278},"Scenario",{"type":42,"tag":82,"props":280,"children":281},{},[282],{"type":47,"value":283},"Recommended Approach",{"type":42,"tag":82,"props":285,"children":286},{},[287],{"type":47,"value":288},"Notes",{"type":42,"tag":93,"props":290,"children":291},{},[292,317,342,365,388],{"type":42,"tag":78,"props":293,"children":294},{},[295,300,312],{"type":42,"tag":100,"props":296,"children":297},{},[298],{"type":47,"value":299},"AES-GCM implementation",{"type":42,"tag":100,"props":301,"children":302},{},[303,305],{"type":47,"value":304},"Use ",{"type":42,"tag":306,"props":307,"children":309},"code",{"className":308},[],[310],{"type":47,"value":311},"aes_gcm_test.json",{"type":42,"tag":100,"props":313,"children":314},{},[315],{"type":47,"value":316},"316 test vectors across 44 test groups",{"type":42,"tag":78,"props":318,"children":319},{},[320,325,337],{"type":42,"tag":100,"props":321,"children":322},{},[323],{"type":47,"value":324},"ECDSA verification",{"type":42,"tag":100,"props":326,"children":327},{},[328,329,335],{"type":47,"value":304},{"type":42,"tag":306,"props":330,"children":332},{"className":331},[],[333],{"type":47,"value":334},"ecdsa_*_test.json",{"type":47,"value":336}," for specific curves",{"type":42,"tag":100,"props":338,"children":339},{},[340],{"type":47,"value":341},"Tests signature malleability, DER encoding",{"type":42,"tag":78,"props":343,"children":344},{},[345,350,360],{"type":42,"tag":100,"props":346,"children":347},{},[348],{"type":47,"value":349},"ECDH key exchange",{"type":42,"tag":100,"props":351,"children":352},{},[353,354],{"type":47,"value":304},{"type":42,"tag":306,"props":355,"children":357},{"className":356},[],[358],{"type":47,"value":359},"ecdh_*_test.json",{"type":42,"tag":100,"props":361,"children":362},{},[363],{"type":47,"value":364},"Tests invalid curve attacks",{"type":42,"tag":78,"props":366,"children":367},{},[368,373,383],{"type":42,"tag":100,"props":369,"children":370},{},[371],{"type":47,"value":372},"RSA signatures",{"type":42,"tag":100,"props":374,"children":375},{},[376,377],{"type":47,"value":304},{"type":42,"tag":306,"props":378,"children":380},{"className":379},[],[381],{"type":47,"value":382},"rsa_*_test.json",{"type":42,"tag":100,"props":384,"children":385},{},[386],{"type":47,"value":387},"Tests padding oracle attacks",{"type":42,"tag":78,"props":389,"children":390},{},[391,396,406],{"type":42,"tag":100,"props":392,"children":393},{},[394],{"type":47,"value":395},"ChaCha20-Poly1305",{"type":42,"tag":100,"props":397,"children":398},{},[399,400],{"type":47,"value":304},{"type":42,"tag":306,"props":401,"children":403},{"className":402},[],[404],{"type":47,"value":405},"chacha20_poly1305_test.json",{"type":42,"tag":100,"props":407,"children":408},{},[409],{"type":47,"value":410},"Tests AEAD implementation",{"type":42,"tag":56,"props":412,"children":414},{"id":413},"testing-workflow",[415],{"type":47,"value":416},"Testing Workflow",{"type":42,"tag":418,"props":419,"children":423},"pre",{"className":420,"code":422,"language":47},[421],"language-text","Phase 1: Setup                 Phase 2: Parse Test Vectors\n┌─────────────────┐          ┌─────────────────┐\n│ Add Wycheproof  │    →     │ Load JSON file  │\n│ as submodule    │          │ Filter by params│\n└─────────────────┘          └─────────────────┘\n         ↓                            ↓\nPhase 4: CI Integration        Phase 3: Write Harness\n┌─────────────────┐          ┌─────────────────┐\n│ Auto-update     │    ←     │ Test valid &    │\n│ test vectors    │          │ invalid cases   │\n└─────────────────┘          └─────────────────┘\n",[424],{"type":42,"tag":306,"props":425,"children":427},{"__ignoreMap":426},"",[428],{"type":47,"value":422},{"type":42,"tag":56,"props":430,"children":432},{"id":431},"repository-structure",[433],{"type":47,"value":434},"Repository Structure",{"type":42,"tag":50,"props":436,"children":437},{},[438],{"type":47,"value":439},"The Wycheproof repository is organized as follows:",{"type":42,"tag":418,"props":441,"children":444},{"className":442,"code":443,"language":47,"meta":426},[421],"┣ 📜 README.md       : Project overview\n┣ 📂 doc             : Documentation\n┣ 📂 java            : Java JCE interface testing harness\n┣ 📂 javascript      : JavaScript testing harness\n┣ 📂 schemas         : Test vector schemas\n┣ 📂 testvectors     : Test vectors\n┗ 📂 testvectors_v1  : Updated test vectors (more detailed)\n",[445],{"type":42,"tag":306,"props":446,"children":447},{"__ignoreMap":426},[448],{"type":47,"value":443},{"type":42,"tag":50,"props":450,"children":451},{},[452,454,460,462,468,470,475],{"type":47,"value":453},"The essential folders are ",{"type":42,"tag":306,"props":455,"children":457},{"className":456},[],[458],{"type":47,"value":459},"testvectors",{"type":47,"value":461}," and ",{"type":42,"tag":306,"props":463,"children":465},{"className":464},[],[466],{"type":47,"value":467},"testvectors_v1",{"type":47,"value":469},". While both contain similar files, ",{"type":42,"tag":306,"props":471,"children":473},{"className":472},[],[474],{"type":47,"value":467},{"type":47,"value":476}," includes more detailed information and is recommended for new integrations.",{"type":42,"tag":56,"props":478,"children":480},{"id":479},"supported-algorithms",[481],{"type":47,"value":482},"Supported Algorithms",{"type":42,"tag":50,"props":484,"children":485},{},[486],{"type":47,"value":487},"Wycheproof provides test vectors for a wide range of cryptographic algorithms:",{"type":42,"tag":70,"props":489,"children":490},{},[491,507],{"type":42,"tag":74,"props":492,"children":493},{},[494],{"type":42,"tag":78,"props":495,"children":496},{},[497,502],{"type":42,"tag":82,"props":498,"children":499},{},[500],{"type":47,"value":501},"Category",{"type":42,"tag":82,"props":503,"children":504},{},[505],{"type":47,"value":506},"Algorithms",{"type":42,"tag":93,"props":508,"children":509},{},[510,526,542,558,574],{"type":42,"tag":78,"props":511,"children":512},{},[513,521],{"type":42,"tag":100,"props":514,"children":515},{},[516],{"type":42,"tag":200,"props":517,"children":518},{},[519],{"type":47,"value":520},"Symmetric Encryption",{"type":42,"tag":100,"props":522,"children":523},{},[524],{"type":47,"value":525},"AES-GCM, AES-EAX, ChaCha20-Poly1305",{"type":42,"tag":78,"props":527,"children":528},{},[529,537],{"type":42,"tag":100,"props":530,"children":531},{},[532],{"type":42,"tag":200,"props":533,"children":534},{},[535],{"type":47,"value":536},"Signatures",{"type":42,"tag":100,"props":538,"children":539},{},[540],{"type":47,"value":541},"ECDSA, EdDSA, RSA-PSS, RSA-PKCS1",{"type":42,"tag":78,"props":543,"children":544},{},[545,553],{"type":42,"tag":100,"props":546,"children":547},{},[548],{"type":42,"tag":200,"props":549,"children":550},{},[551],{"type":47,"value":552},"Key Exchange",{"type":42,"tag":100,"props":554,"children":555},{},[556],{"type":47,"value":557},"ECDH, X25519, X448",{"type":42,"tag":78,"props":559,"children":560},{},[561,569],{"type":42,"tag":100,"props":562,"children":563},{},[564],{"type":42,"tag":200,"props":565,"children":566},{},[567],{"type":47,"value":568},"Hashing",{"type":42,"tag":100,"props":570,"children":571},{},[572],{"type":47,"value":573},"HMAC, HKDF",{"type":42,"tag":78,"props":575,"children":576},{},[577,585],{"type":42,"tag":100,"props":578,"children":579},{},[580],{"type":42,"tag":200,"props":581,"children":582},{},[583],{"type":47,"value":584},"Curves",{"type":42,"tag":100,"props":586,"children":587},{},[588],{"type":47,"value":589},"secp256k1, secp256r1, secp384r1, secp521r1, ed25519, ed448",{"type":42,"tag":56,"props":591,"children":593},{"id":592},"test-file-structure",[594],{"type":47,"value":595},"Test File Structure",{"type":42,"tag":50,"props":597,"children":598},{},[599],{"type":47,"value":600},"Each JSON test file tests a specific cryptographic construction. All test files share common attributes:",{"type":42,"tag":418,"props":602,"children":606},{"className":603,"code":604,"language":605,"meta":426,"style":426},"language-json shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","\"algorithm\"         : The name of the algorithm tested\n\"schema\"            : The JSON schema (found in schemas folder)\n\"generatorVersion\"  : The version number\n\"numberOfTests\"     : The total number of test vectors in this file\n\"header\"            : Detailed description of test vectors\n\"notes\"             : In-depth explanation of flags in test vectors\n\"testGroups\"        : Array of one or multiple test groups\n","json",[607],{"type":42,"tag":306,"props":608,"children":609},{"__ignoreMap":426},[610,638,660,682,704,726,748],{"type":42,"tag":611,"props":612,"children":615},"span",{"class":613,"line":614},"line",1,[616,622,628,632],{"type":42,"tag":611,"props":617,"children":619},{"style":618},"--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF",[620],{"type":47,"value":621},"\"",{"type":42,"tag":611,"props":623,"children":625},{"style":624},"--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D",[626],{"type":47,"value":627},"algorithm",{"type":42,"tag":611,"props":629,"children":630},{"style":618},[631],{"type":47,"value":621},{"type":42,"tag":611,"props":633,"children":635},{"style":634},"--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8",[636],{"type":47,"value":637},"         : The name of the algorithm tested\n",{"type":42,"tag":611,"props":639,"children":641},{"class":613,"line":640},2,[642,646,651,655],{"type":42,"tag":611,"props":643,"children":644},{"style":618},[645],{"type":47,"value":621},{"type":42,"tag":611,"props":647,"children":648},{"style":624},[649],{"type":47,"value":650},"schema",{"type":42,"tag":611,"props":652,"children":653},{"style":618},[654],{"type":47,"value":621},{"type":42,"tag":611,"props":656,"children":657},{"style":634},[658],{"type":47,"value":659},"            : The JSON schema (found in schemas folder)\n",{"type":42,"tag":611,"props":661,"children":663},{"class":613,"line":662},3,[664,668,673,677],{"type":42,"tag":611,"props":665,"children":666},{"style":618},[667],{"type":47,"value":621},{"type":42,"tag":611,"props":669,"children":670},{"style":624},[671],{"type":47,"value":672},"generatorVersion",{"type":42,"tag":611,"props":674,"children":675},{"style":618},[676],{"type":47,"value":621},{"type":42,"tag":611,"props":678,"children":679},{"style":634},[680],{"type":47,"value":681},"  : The version number\n",{"type":42,"tag":611,"props":683,"children":685},{"class":613,"line":684},4,[686,690,695,699],{"type":42,"tag":611,"props":687,"children":688},{"style":618},[689],{"type":47,"value":621},{"type":42,"tag":611,"props":691,"children":692},{"style":624},[693],{"type":47,"value":694},"numberOfTests",{"type":42,"tag":611,"props":696,"children":697},{"style":618},[698],{"type":47,"value":621},{"type":42,"tag":611,"props":700,"children":701},{"style":634},[702],{"type":47,"value":703},"     : The total number of test vectors in this file\n",{"type":42,"tag":611,"props":705,"children":707},{"class":613,"line":706},5,[708,712,717,721],{"type":42,"tag":611,"props":709,"children":710},{"style":618},[711],{"type":47,"value":621},{"type":42,"tag":611,"props":713,"children":714},{"style":624},[715],{"type":47,"value":716},"header",{"type":42,"tag":611,"props":718,"children":719},{"style":618},[720],{"type":47,"value":621},{"type":42,"tag":611,"props":722,"children":723},{"style":634},[724],{"type":47,"value":725},"            : Detailed description of test vectors\n",{"type":42,"tag":611,"props":727,"children":729},{"class":613,"line":728},6,[730,734,739,743],{"type":42,"tag":611,"props":731,"children":732},{"style":618},[733],{"type":47,"value":621},{"type":42,"tag":611,"props":735,"children":736},{"style":624},[737],{"type":47,"value":738},"notes",{"type":42,"tag":611,"props":740,"children":741},{"style":618},[742],{"type":47,"value":621},{"type":42,"tag":611,"props":744,"children":745},{"style":634},[746],{"type":47,"value":747},"             : In-depth explanation of flags in test vectors\n",{"type":42,"tag":611,"props":749,"children":751},{"class":613,"line":750},7,[752,756,761,765],{"type":42,"tag":611,"props":753,"children":754},{"style":618},[755],{"type":47,"value":621},{"type":42,"tag":611,"props":757,"children":758},{"style":624},[759],{"type":47,"value":760},"testGroups",{"type":42,"tag":611,"props":762,"children":763},{"style":618},[764],{"type":47,"value":621},{"type":42,"tag":611,"props":766,"children":767},{"style":634},[768],{"type":47,"value":769},"        : Array of one or multiple test groups\n",{"type":42,"tag":63,"props":771,"children":773},{"id":772},"test-groups",[774],{"type":47,"value":775},"Test Groups",{"type":42,"tag":50,"props":777,"children":778},{},[779],{"type":47,"value":780},"Test groups group sets of tests based on shared attributes such as:",{"type":42,"tag":161,"props":782,"children":783},{},[784,789,794,799],{"type":42,"tag":165,"props":785,"children":786},{},[787],{"type":47,"value":788},"Key sizes",{"type":42,"tag":165,"props":790,"children":791},{},[792],{"type":47,"value":793},"IV sizes",{"type":42,"tag":165,"props":795,"children":796},{},[797],{"type":47,"value":798},"Public keys",{"type":42,"tag":165,"props":800,"children":801},{},[802],{"type":47,"value":584},{"type":42,"tag":50,"props":804,"children":805},{},[806],{"type":47,"value":807},"This classification allows extracting tests that meet specific criteria relevant to the construction being tested.",{"type":42,"tag":63,"props":809,"children":811},{"id":810},"test-vector-attributes",[812],{"type":47,"value":813},"Test Vector Attributes",{"type":42,"tag":815,"props":816,"children":818},"h4",{"id":817},"shared-attributes",[819],{"type":47,"value":820},"Shared Attributes",{"type":42,"tag":50,"props":822,"children":823},{},[824],{"type":47,"value":825},"All test vectors contain four common fields:",{"type":42,"tag":161,"props":827,"children":828},{},[829,839,849,866],{"type":42,"tag":165,"props":830,"children":831},{},[832,837],{"type":42,"tag":200,"props":833,"children":834},{},[835],{"type":47,"value":836},"tcId",{"type":47,"value":838},": Unique identifier for the test vector within a file",{"type":42,"tag":165,"props":840,"children":841},{},[842,847],{"type":42,"tag":200,"props":843,"children":844},{},[845],{"type":47,"value":846},"comment",{"type":47,"value":848},": Additional information about the test case",{"type":42,"tag":165,"props":850,"children":851},{},[852,857,859,864],{"type":42,"tag":200,"props":853,"children":854},{},[855],{"type":47,"value":856},"flags",{"type":47,"value":858},": Descriptions of specific test case types and potential dangers (referenced in ",{"type":42,"tag":306,"props":860,"children":862},{"className":861},[],[863],{"type":47,"value":738},{"type":47,"value":865}," field)",{"type":42,"tag":165,"props":867,"children":868},{},[869,874],{"type":42,"tag":200,"props":870,"children":871},{},[872],{"type":47,"value":873},"result",{"type":47,"value":875},": Expected outcome of the test",{"type":42,"tag":50,"props":877,"children":878},{},[879,881,886],{"type":47,"value":880},"The ",{"type":42,"tag":306,"props":882,"children":884},{"className":883},[],[885],{"type":47,"value":873},{"type":47,"value":887}," field can take three values:",{"type":42,"tag":70,"props":889,"children":890},{},[891,907],{"type":42,"tag":74,"props":892,"children":893},{},[894],{"type":42,"tag":78,"props":895,"children":896},{},[897,902],{"type":42,"tag":82,"props":898,"children":899},{},[900],{"type":47,"value":901},"Result",{"type":42,"tag":82,"props":903,"children":904},{},[905],{"type":47,"value":906},"Meaning",{"type":42,"tag":93,"props":908,"children":909},{},[910,926,942],{"type":42,"tag":78,"props":911,"children":912},{},[913,921],{"type":42,"tag":100,"props":914,"children":915},{},[916],{"type":42,"tag":200,"props":917,"children":918},{},[919],{"type":47,"value":920},"valid",{"type":42,"tag":100,"props":922,"children":923},{},[924],{"type":47,"value":925},"Test case should succeed",{"type":42,"tag":78,"props":927,"children":928},{},[929,937],{"type":42,"tag":100,"props":930,"children":931},{},[932],{"type":42,"tag":200,"props":933,"children":934},{},[935],{"type":47,"value":936},"acceptable",{"type":42,"tag":100,"props":938,"children":939},{},[940],{"type":47,"value":941},"Test case is allowed to succeed but contains non-ideal attributes",{"type":42,"tag":78,"props":943,"children":944},{},[945,953],{"type":42,"tag":100,"props":946,"children":947},{},[948],{"type":42,"tag":200,"props":949,"children":950},{},[951],{"type":47,"value":952},"invalid",{"type":42,"tag":100,"props":954,"children":955},{},[956],{"type":47,"value":957},"Test case should fail",{"type":42,"tag":815,"props":959,"children":961},{"id":960},"unique-attributes",[962],{"type":47,"value":963},"Unique Attributes",{"type":42,"tag":50,"props":965,"children":966},{},[967],{"type":47,"value":968},"Unique attributes are specific to the algorithm being tested:",{"type":42,"tag":70,"props":970,"children":971},{},[972,987],{"type":42,"tag":74,"props":973,"children":974},{},[975],{"type":42,"tag":78,"props":976,"children":977},{},[978,983],{"type":42,"tag":82,"props":979,"children":980},{},[981],{"type":47,"value":982},"Algorithm",{"type":42,"tag":82,"props":984,"children":985},{},[986],{"type":47,"value":963},{"type":42,"tag":93,"props":988,"children":989},{},[990,1042,1073,1102],{"type":42,"tag":78,"props":991,"children":992},{},[993,998],{"type":42,"tag":100,"props":994,"children":995},{},[996],{"type":47,"value":997},"AES-GCM",{"type":42,"tag":100,"props":999,"children":1000},{},[1001,1007,1009,1015,1016,1022,1023,1029,1030,1036,1037],{"type":42,"tag":306,"props":1002,"children":1004},{"className":1003},[],[1005],{"type":47,"value":1006},"key",{"type":47,"value":1008},", ",{"type":42,"tag":306,"props":1010,"children":1012},{"className":1011},[],[1013],{"type":47,"value":1014},"iv",{"type":47,"value":1008},{"type":42,"tag":306,"props":1017,"children":1019},{"className":1018},[],[1020],{"type":47,"value":1021},"aad",{"type":47,"value":1008},{"type":42,"tag":306,"props":1024,"children":1026},{"className":1025},[],[1027],{"type":47,"value":1028},"msg",{"type":47,"value":1008},{"type":42,"tag":306,"props":1031,"children":1033},{"className":1032},[],[1034],{"type":47,"value":1035},"ct",{"type":47,"value":1008},{"type":42,"tag":306,"props":1038,"children":1040},{"className":1039},[],[1041],{"type":47,"value":16},{"type":42,"tag":78,"props":1043,"children":1044},{},[1045,1050],{"type":42,"tag":100,"props":1046,"children":1047},{},[1048],{"type":47,"value":1049},"ECDH secp256k1",{"type":42,"tag":100,"props":1051,"children":1052},{},[1053,1059,1060,1066,1067],{"type":42,"tag":306,"props":1054,"children":1056},{"className":1055},[],[1057],{"type":47,"value":1058},"public",{"type":47,"value":1008},{"type":42,"tag":306,"props":1061,"children":1063},{"className":1062},[],[1064],{"type":47,"value":1065},"private",{"type":47,"value":1008},{"type":42,"tag":306,"props":1068,"children":1070},{"className":1069},[],[1071],{"type":47,"value":1072},"shared",{"type":42,"tag":78,"props":1074,"children":1075},{},[1076,1081],{"type":42,"tag":100,"props":1077,"children":1078},{},[1079],{"type":47,"value":1080},"ECDSA",{"type":42,"tag":100,"props":1082,"children":1083},{},[1084,1089,1090,1096,1097],{"type":42,"tag":306,"props":1085,"children":1087},{"className":1086},[],[1088],{"type":47,"value":1028},{"type":47,"value":1008},{"type":42,"tag":306,"props":1091,"children":1093},{"className":1092},[],[1094],{"type":47,"value":1095},"sig",{"type":47,"value":1008},{"type":42,"tag":306,"props":1098,"children":1100},{"className":1099},[],[1101],{"type":47,"value":873},{"type":42,"tag":78,"props":1103,"children":1104},{},[1105,1110],{"type":42,"tag":100,"props":1106,"children":1107},{},[1108],{"type":47,"value":1109},"EdDSA",{"type":42,"tag":100,"props":1111,"children":1112},{},[1113,1118,1119,1124,1125],{"type":42,"tag":306,"props":1114,"children":1116},{"className":1115},[],[1117],{"type":47,"value":1028},{"type":47,"value":1008},{"type":42,"tag":306,"props":1120,"children":1122},{"className":1121},[],[1123],{"type":47,"value":1095},{"type":47,"value":1008},{"type":42,"tag":306,"props":1126,"children":1128},{"className":1127},[],[1129],{"type":47,"value":1130},"pk",{"type":42,"tag":56,"props":1132,"children":1134},{"id":1133},"implementation-guide",[1135],{"type":47,"value":1136},"Implementation Guide",{"type":42,"tag":63,"props":1138,"children":1140},{"id":1139},"phase-1-add-wycheproof-to-your-project",[1141],{"type":47,"value":1142},"Phase 1: Add Wycheproof to Your Project",{"type":42,"tag":50,"props":1144,"children":1145},{},[1146],{"type":42,"tag":200,"props":1147,"children":1148},{},[1149],{"type":47,"value":1150},"Option 1: Git Submodule (Recommended)",{"type":42,"tag":50,"props":1152,"children":1153},{},[1154],{"type":47,"value":1155},"Adding Wycheproof as a git submodule ensures automatic updates:",{"type":42,"tag":418,"props":1157,"children":1161},{"className":1158,"code":1159,"language":1160,"meta":426,"style":426},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","git submodule add https:\u002F\u002Fgithub.com\u002FC2SP\u002Fwycheproof.git\n","bash",[1162],{"type":42,"tag":306,"props":1163,"children":1164},{"__ignoreMap":426},[1165],{"type":42,"tag":611,"props":1166,"children":1167},{"class":613,"line":614},[1168,1174,1179,1184],{"type":42,"tag":611,"props":1169,"children":1171},{"style":1170},"--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B",[1172],{"type":47,"value":1173},"git",{"type":42,"tag":611,"props":1175,"children":1176},{"style":624},[1177],{"type":47,"value":1178}," submodule",{"type":42,"tag":611,"props":1180,"children":1181},{"style":624},[1182],{"type":47,"value":1183}," add",{"type":42,"tag":611,"props":1185,"children":1186},{"style":624},[1187],{"type":47,"value":1188}," https:\u002F\u002Fgithub.com\u002FC2SP\u002Fwycheproof.git\n",{"type":42,"tag":50,"props":1190,"children":1191},{},[1192],{"type":42,"tag":200,"props":1193,"children":1194},{},[1195],{"type":47,"value":1196},"Option 2: Fetch Specific Test Vectors",{"type":42,"tag":50,"props":1198,"children":1199},{},[1200],{"type":47,"value":1201},"If submodules aren't possible, fetch specific JSON files:",{"type":42,"tag":418,"props":1203,"children":1205},{"className":1158,"code":1204,"language":1160,"meta":426,"style":426},"#!\u002Fbin\u002Fbash\n\nTMP_WYCHEPROOF_FOLDER=\".wycheproof\u002F\"\nTEST_VECTORS=('aes_gcm_test.json' 'aes_eax_test.json')\nBASE_URL=\"https:\u002F\u002Fraw.githubusercontent.com\u002FC2SP\u002Fwycheproof\u002Fmaster\u002Ftestvectors_v1\u002F\"\n\n# Create wycheproof folder\nmkdir -p $TMP_WYCHEPROOF_FOLDER\n\n# Request all test vector files if they don't exist\nfor i in \"${TEST_VECTORS[@]}\"; do\n  if [ ! -f \"${TMP_WYCHEPROOF_FOLDER}${i}\" ]; then\n    curl -o \"${TMP_WYCHEPROOF_FOLDER}${i}\" \"${BASE_URL}${i}\"\n    if [ $? -ne 0 ]; then\n      echo \"Failed to download ${i}\"\n      exit 1\n    fi\n  fi\ndone\n",[1206],{"type":42,"tag":306,"props":1207,"children":1208},{"__ignoreMap":426},[1209,1218,1227,1254,1299,1324,1331,1339,1358,1366,1375,1419,1476,1531,1568,1601,1615,1624,1633],{"type":42,"tag":611,"props":1210,"children":1211},{"class":613,"line":614},[1212],{"type":42,"tag":611,"props":1213,"children":1215},{"style":1214},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic",[1216],{"type":47,"value":1217},"#!\u002Fbin\u002Fbash\n",{"type":42,"tag":611,"props":1219,"children":1220},{"class":613,"line":640},[1221],{"type":42,"tag":611,"props":1222,"children":1224},{"emptyLinePlaceholder":1223},true,[1225],{"type":47,"value":1226},"\n",{"type":42,"tag":611,"props":1228,"children":1229},{"class":613,"line":662},[1230,1235,1240,1244,1249],{"type":42,"tag":611,"props":1231,"children":1232},{"style":634},[1233],{"type":47,"value":1234},"TMP_WYCHEPROOF_FOLDER",{"type":42,"tag":611,"props":1236,"children":1237},{"style":618},[1238],{"type":47,"value":1239},"=",{"type":42,"tag":611,"props":1241,"children":1242},{"style":618},[1243],{"type":47,"value":621},{"type":42,"tag":611,"props":1245,"children":1246},{"style":624},[1247],{"type":47,"value":1248},".wycheproof\u002F",{"type":42,"tag":611,"props":1250,"children":1251},{"style":618},[1252],{"type":47,"value":1253},"\"\n",{"type":42,"tag":611,"props":1255,"children":1256},{"class":613,"line":684},[1257,1262,1267,1272,1276,1280,1285,1290,1294],{"type":42,"tag":611,"props":1258,"children":1259},{"style":634},[1260],{"type":47,"value":1261},"TEST_VECTORS",{"type":42,"tag":611,"props":1263,"children":1264},{"style":618},[1265],{"type":47,"value":1266},"=(",{"type":42,"tag":611,"props":1268,"children":1269},{"style":618},[1270],{"type":47,"value":1271},"'",{"type":42,"tag":611,"props":1273,"children":1274},{"style":624},[1275],{"type":47,"value":311},{"type":42,"tag":611,"props":1277,"children":1278},{"style":618},[1279],{"type":47,"value":1271},{"type":42,"tag":611,"props":1281,"children":1282},{"style":618},[1283],{"type":47,"value":1284}," '",{"type":42,"tag":611,"props":1286,"children":1287},{"style":624},[1288],{"type":47,"value":1289},"aes_eax_test.json",{"type":42,"tag":611,"props":1291,"children":1292},{"style":618},[1293],{"type":47,"value":1271},{"type":42,"tag":611,"props":1295,"children":1296},{"style":618},[1297],{"type":47,"value":1298},")\n",{"type":42,"tag":611,"props":1300,"children":1301},{"class":613,"line":706},[1302,1307,1311,1315,1320],{"type":42,"tag":611,"props":1303,"children":1304},{"style":634},[1305],{"type":47,"value":1306},"BASE_URL",{"type":42,"tag":611,"props":1308,"children":1309},{"style":618},[1310],{"type":47,"value":1239},{"type":42,"tag":611,"props":1312,"children":1313},{"style":618},[1314],{"type":47,"value":621},{"type":42,"tag":611,"props":1316,"children":1317},{"style":624},[1318],{"type":47,"value":1319},"https:\u002F\u002Fraw.githubusercontent.com\u002FC2SP\u002Fwycheproof\u002Fmaster\u002Ftestvectors_v1\u002F",{"type":42,"tag":611,"props":1321,"children":1322},{"style":618},[1323],{"type":47,"value":1253},{"type":42,"tag":611,"props":1325,"children":1326},{"class":613,"line":728},[1327],{"type":42,"tag":611,"props":1328,"children":1329},{"emptyLinePlaceholder":1223},[1330],{"type":47,"value":1226},{"type":42,"tag":611,"props":1332,"children":1333},{"class":613,"line":750},[1334],{"type":42,"tag":611,"props":1335,"children":1336},{"style":1214},[1337],{"type":47,"value":1338},"# Create wycheproof folder\n",{"type":42,"tag":611,"props":1340,"children":1342},{"class":613,"line":1341},8,[1343,1348,1353],{"type":42,"tag":611,"props":1344,"children":1345},{"style":1170},[1346],{"type":47,"value":1347},"mkdir",{"type":42,"tag":611,"props":1349,"children":1350},{"style":624},[1351],{"type":47,"value":1352}," -p",{"type":42,"tag":611,"props":1354,"children":1355},{"style":634},[1356],{"type":47,"value":1357}," $TMP_WYCHEPROOF_FOLDER\n",{"type":42,"tag":611,"props":1359,"children":1361},{"class":613,"line":1360},9,[1362],{"type":42,"tag":611,"props":1363,"children":1364},{"emptyLinePlaceholder":1223},[1365],{"type":47,"value":1226},{"type":42,"tag":611,"props":1367,"children":1369},{"class":613,"line":1368},10,[1370],{"type":42,"tag":611,"props":1371,"children":1372},{"style":1214},[1373],{"type":47,"value":1374},"# Request all test vector files if they don't exist\n",{"type":42,"tag":611,"props":1376,"children":1378},{"class":613,"line":1377},11,[1379,1385,1390,1395,1400,1404,1409,1414],{"type":42,"tag":611,"props":1380,"children":1382},{"style":1381},"--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic",[1383],{"type":47,"value":1384},"for",{"type":42,"tag":611,"props":1386,"children":1387},{"style":634},[1388],{"type":47,"value":1389}," i ",{"type":42,"tag":611,"props":1391,"children":1392},{"style":1381},[1393],{"type":47,"value":1394},"in",{"type":42,"tag":611,"props":1396,"children":1397},{"style":618},[1398],{"type":47,"value":1399}," \"${",{"type":42,"tag":611,"props":1401,"children":1402},{"style":634},[1403],{"type":47,"value":1261},{"type":42,"tag":611,"props":1405,"children":1406},{"style":618},[1407],{"type":47,"value":1408},"[@]}\"",{"type":42,"tag":611,"props":1410,"children":1411},{"style":618},[1412],{"type":47,"value":1413},";",{"type":42,"tag":611,"props":1415,"children":1416},{"style":1381},[1417],{"type":47,"value":1418}," do\n",{"type":42,"tag":611,"props":1420,"children":1422},{"class":613,"line":1421},12,[1423,1428,1433,1438,1443,1447,1451,1456,1461,1466,1471],{"type":42,"tag":611,"props":1424,"children":1425},{"style":1381},[1426],{"type":47,"value":1427},"  if",{"type":42,"tag":611,"props":1429,"children":1430},{"style":618},[1431],{"type":47,"value":1432}," [",{"type":42,"tag":611,"props":1434,"children":1435},{"style":618},[1436],{"type":47,"value":1437}," !",{"type":42,"tag":611,"props":1439,"children":1440},{"style":618},[1441],{"type":47,"value":1442}," -f",{"type":42,"tag":611,"props":1444,"children":1445},{"style":618},[1446],{"type":47,"value":1399},{"type":42,"tag":611,"props":1448,"children":1449},{"style":634},[1450],{"type":47,"value":1234},{"type":42,"tag":611,"props":1452,"children":1453},{"style":618},[1454],{"type":47,"value":1455},"}${",{"type":42,"tag":611,"props":1457,"children":1458},{"style":634},[1459],{"type":47,"value":1460},"i",{"type":42,"tag":611,"props":1462,"children":1463},{"style":618},[1464],{"type":47,"value":1465},"}\"",{"type":42,"tag":611,"props":1467,"children":1468},{"style":618},[1469],{"type":47,"value":1470}," ];",{"type":42,"tag":611,"props":1472,"children":1473},{"style":1381},[1474],{"type":47,"value":1475}," then\n",{"type":42,"tag":611,"props":1477,"children":1479},{"class":613,"line":1478},13,[1480,1485,1490,1494,1498,1502,1506,1510,1514,1518,1522,1526],{"type":42,"tag":611,"props":1481,"children":1482},{"style":1170},[1483],{"type":47,"value":1484},"    curl",{"type":42,"tag":611,"props":1486,"children":1487},{"style":624},[1488],{"type":47,"value":1489}," -o",{"type":42,"tag":611,"props":1491,"children":1492},{"style":618},[1493],{"type":47,"value":1399},{"type":42,"tag":611,"props":1495,"children":1496},{"style":634},[1497],{"type":47,"value":1234},{"type":42,"tag":611,"props":1499,"children":1500},{"style":618},[1501],{"type":47,"value":1455},{"type":42,"tag":611,"props":1503,"children":1504},{"style":634},[1505],{"type":47,"value":1460},{"type":42,"tag":611,"props":1507,"children":1508},{"style":618},[1509],{"type":47,"value":1465},{"type":42,"tag":611,"props":1511,"children":1512},{"style":618},[1513],{"type":47,"value":1399},{"type":42,"tag":611,"props":1515,"children":1516},{"style":634},[1517],{"type":47,"value":1306},{"type":42,"tag":611,"props":1519,"children":1520},{"style":618},[1521],{"type":47,"value":1455},{"type":42,"tag":611,"props":1523,"children":1524},{"style":634},[1525],{"type":47,"value":1460},{"type":42,"tag":611,"props":1527,"children":1528},{"style":618},[1529],{"type":47,"value":1530},"}\"\n",{"type":42,"tag":611,"props":1532,"children":1534},{"class":613,"line":1533},14,[1535,1540,1544,1549,1554,1560,1564],{"type":42,"tag":611,"props":1536,"children":1537},{"style":1381},[1538],{"type":47,"value":1539},"    if",{"type":42,"tag":611,"props":1541,"children":1542},{"style":618},[1543],{"type":47,"value":1432},{"type":42,"tag":611,"props":1545,"children":1546},{"style":634},[1547],{"type":47,"value":1548}," $? ",{"type":42,"tag":611,"props":1550,"children":1551},{"style":618},[1552],{"type":47,"value":1553},"-ne",{"type":42,"tag":611,"props":1555,"children":1557},{"style":1556},"--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C",[1558],{"type":47,"value":1559}," 0",{"type":42,"tag":611,"props":1561,"children":1562},{"style":618},[1563],{"type":47,"value":1470},{"type":42,"tag":611,"props":1565,"children":1566},{"style":1381},[1567],{"type":47,"value":1475},{"type":42,"tag":611,"props":1569,"children":1571},{"class":613,"line":1570},15,[1572,1578,1583,1588,1593,1597],{"type":42,"tag":611,"props":1573,"children":1575},{"style":1574},"--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF",[1576],{"type":47,"value":1577},"      echo",{"type":42,"tag":611,"props":1579,"children":1580},{"style":618},[1581],{"type":47,"value":1582}," \"",{"type":42,"tag":611,"props":1584,"children":1585},{"style":624},[1586],{"type":47,"value":1587},"Failed to download ",{"type":42,"tag":611,"props":1589,"children":1590},{"style":618},[1591],{"type":47,"value":1592},"${",{"type":42,"tag":611,"props":1594,"children":1595},{"style":634},[1596],{"type":47,"value":1460},{"type":42,"tag":611,"props":1598,"children":1599},{"style":618},[1600],{"type":47,"value":1530},{"type":42,"tag":611,"props":1602,"children":1604},{"class":613,"line":1603},16,[1605,1610],{"type":42,"tag":611,"props":1606,"children":1607},{"style":1574},[1608],{"type":47,"value":1609},"      exit",{"type":42,"tag":611,"props":1611,"children":1612},{"style":1556},[1613],{"type":47,"value":1614}," 1\n",{"type":42,"tag":611,"props":1616,"children":1618},{"class":613,"line":1617},17,[1619],{"type":42,"tag":611,"props":1620,"children":1621},{"style":1381},[1622],{"type":47,"value":1623},"    fi\n",{"type":42,"tag":611,"props":1625,"children":1627},{"class":613,"line":1626},18,[1628],{"type":42,"tag":611,"props":1629,"children":1630},{"style":1381},[1631],{"type":47,"value":1632},"  fi\n",{"type":42,"tag":611,"props":1634,"children":1636},{"class":613,"line":1635},19,[1637],{"type":42,"tag":611,"props":1638,"children":1639},{"style":1381},[1640],{"type":47,"value":1641},"done\n",{"type":42,"tag":63,"props":1643,"children":1645},{"id":1644},"phase-2-parse-test-vectors",[1646],{"type":47,"value":1647},"Phase 2: Parse Test Vectors",{"type":42,"tag":50,"props":1649,"children":1650},{},[1651],{"type":47,"value":1652},"Identify the test file for your algorithm and parse the JSON:",{"type":42,"tag":50,"props":1654,"children":1655},{},[1656],{"type":42,"tag":200,"props":1657,"children":1658},{},[1659],{"type":47,"value":1660},"Python Example:",{"type":42,"tag":418,"props":1662,"children":1666},{"className":1663,"code":1664,"language":1665,"meta":426,"style":426},"language-python shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import json\n\ndef load_wycheproof_test_vectors(path: str):\n    testVectors = []\n    try:\n        with open(path, \"r\") as f:\n            wycheproof_json = json.loads(f.read())\n    except FileNotFoundError:\n        print(f\"No Wycheproof file found at: {path}\")\n        return testVectors\n\n    # Attributes that need hex-to-bytes conversion\n    convert_attr = {\"key\", \"aad\", \"iv\", \"msg\", \"ct\", \"tag\"}\n\n    for testGroup in wycheproof_json[\"testGroups\"]:\n        # Filter test groups based on implementation constraints\n        if testGroup[\"ivSize\"] \u003C 64 or testGroup[\"ivSize\"] > 1024:\n            continue\n\n        for tv in testGroup[\"tests\"]:\n            # Convert hex strings to bytes\n            for attr in convert_attr:\n                if attr in tv:\n                    tv[attr] = bytes.fromhex(tv[attr])\n            testVectors.append(tv)\n\n    return testVectors\n","python",[1667],{"type":42,"tag":306,"props":1668,"children":1669},{"__ignoreMap":426},[1670,1678,1685,1693,1701,1709,1717,1725,1733,1741,1749,1756,1764,1772,1779,1787,1795,1803,1811,1818,1827,1836,1845,1854,1863,1872,1880],{"type":42,"tag":611,"props":1671,"children":1672},{"class":613,"line":614},[1673],{"type":42,"tag":611,"props":1674,"children":1675},{},[1676],{"type":47,"value":1677},"import json\n",{"type":42,"tag":611,"props":1679,"children":1680},{"class":613,"line":640},[1681],{"type":42,"tag":611,"props":1682,"children":1683},{"emptyLinePlaceholder":1223},[1684],{"type":47,"value":1226},{"type":42,"tag":611,"props":1686,"children":1687},{"class":613,"line":662},[1688],{"type":42,"tag":611,"props":1689,"children":1690},{},[1691],{"type":47,"value":1692},"def load_wycheproof_test_vectors(path: str):\n",{"type":42,"tag":611,"props":1694,"children":1695},{"class":613,"line":684},[1696],{"type":42,"tag":611,"props":1697,"children":1698},{},[1699],{"type":47,"value":1700},"    testVectors = []\n",{"type":42,"tag":611,"props":1702,"children":1703},{"class":613,"line":706},[1704],{"type":42,"tag":611,"props":1705,"children":1706},{},[1707],{"type":47,"value":1708},"    try:\n",{"type":42,"tag":611,"props":1710,"children":1711},{"class":613,"line":728},[1712],{"type":42,"tag":611,"props":1713,"children":1714},{},[1715],{"type":47,"value":1716},"        with open(path, \"r\") as f:\n",{"type":42,"tag":611,"props":1718,"children":1719},{"class":613,"line":750},[1720],{"type":42,"tag":611,"props":1721,"children":1722},{},[1723],{"type":47,"value":1724},"            wycheproof_json = json.loads(f.read())\n",{"type":42,"tag":611,"props":1726,"children":1727},{"class":613,"line":1341},[1728],{"type":42,"tag":611,"props":1729,"children":1730},{},[1731],{"type":47,"value":1732},"    except FileNotFoundError:\n",{"type":42,"tag":611,"props":1734,"children":1735},{"class":613,"line":1360},[1736],{"type":42,"tag":611,"props":1737,"children":1738},{},[1739],{"type":47,"value":1740},"        print(f\"No Wycheproof file found at: {path}\")\n",{"type":42,"tag":611,"props":1742,"children":1743},{"class":613,"line":1368},[1744],{"type":42,"tag":611,"props":1745,"children":1746},{},[1747],{"type":47,"value":1748},"        return testVectors\n",{"type":42,"tag":611,"props":1750,"children":1751},{"class":613,"line":1377},[1752],{"type":42,"tag":611,"props":1753,"children":1754},{"emptyLinePlaceholder":1223},[1755],{"type":47,"value":1226},{"type":42,"tag":611,"props":1757,"children":1758},{"class":613,"line":1421},[1759],{"type":42,"tag":611,"props":1760,"children":1761},{},[1762],{"type":47,"value":1763},"    # Attributes that need hex-to-bytes conversion\n",{"type":42,"tag":611,"props":1765,"children":1766},{"class":613,"line":1478},[1767],{"type":42,"tag":611,"props":1768,"children":1769},{},[1770],{"type":47,"value":1771},"    convert_attr = {\"key\", \"aad\", \"iv\", \"msg\", \"ct\", \"tag\"}\n",{"type":42,"tag":611,"props":1773,"children":1774},{"class":613,"line":1533},[1775],{"type":42,"tag":611,"props":1776,"children":1777},{"emptyLinePlaceholder":1223},[1778],{"type":47,"value":1226},{"type":42,"tag":611,"props":1780,"children":1781},{"class":613,"line":1570},[1782],{"type":42,"tag":611,"props":1783,"children":1784},{},[1785],{"type":47,"value":1786},"    for testGroup in wycheproof_json[\"testGroups\"]:\n",{"type":42,"tag":611,"props":1788,"children":1789},{"class":613,"line":1603},[1790],{"type":42,"tag":611,"props":1791,"children":1792},{},[1793],{"type":47,"value":1794},"        # Filter test groups based on implementation constraints\n",{"type":42,"tag":611,"props":1796,"children":1797},{"class":613,"line":1617},[1798],{"type":42,"tag":611,"props":1799,"children":1800},{},[1801],{"type":47,"value":1802},"        if testGroup[\"ivSize\"] \u003C 64 or testGroup[\"ivSize\"] > 1024:\n",{"type":42,"tag":611,"props":1804,"children":1805},{"class":613,"line":1626},[1806],{"type":42,"tag":611,"props":1807,"children":1808},{},[1809],{"type":47,"value":1810},"            continue\n",{"type":42,"tag":611,"props":1812,"children":1813},{"class":613,"line":1635},[1814],{"type":42,"tag":611,"props":1815,"children":1816},{"emptyLinePlaceholder":1223},[1817],{"type":47,"value":1226},{"type":42,"tag":611,"props":1819,"children":1821},{"class":613,"line":1820},20,[1822],{"type":42,"tag":611,"props":1823,"children":1824},{},[1825],{"type":47,"value":1826},"        for tv in testGroup[\"tests\"]:\n",{"type":42,"tag":611,"props":1828,"children":1830},{"class":613,"line":1829},21,[1831],{"type":42,"tag":611,"props":1832,"children":1833},{},[1834],{"type":47,"value":1835},"            # Convert hex strings to bytes\n",{"type":42,"tag":611,"props":1837,"children":1839},{"class":613,"line":1838},22,[1840],{"type":42,"tag":611,"props":1841,"children":1842},{},[1843],{"type":47,"value":1844},"            for attr in convert_attr:\n",{"type":42,"tag":611,"props":1846,"children":1848},{"class":613,"line":1847},23,[1849],{"type":42,"tag":611,"props":1850,"children":1851},{},[1852],{"type":47,"value":1853},"                if attr in tv:\n",{"type":42,"tag":611,"props":1855,"children":1857},{"class":613,"line":1856},24,[1858],{"type":42,"tag":611,"props":1859,"children":1860},{},[1861],{"type":47,"value":1862},"                    tv[attr] = bytes.fromhex(tv[attr])\n",{"type":42,"tag":611,"props":1864,"children":1866},{"class":613,"line":1865},25,[1867],{"type":42,"tag":611,"props":1868,"children":1869},{},[1870],{"type":47,"value":1871},"            testVectors.append(tv)\n",{"type":42,"tag":611,"props":1873,"children":1875},{"class":613,"line":1874},26,[1876],{"type":42,"tag":611,"props":1877,"children":1878},{"emptyLinePlaceholder":1223},[1879],{"type":47,"value":1226},{"type":42,"tag":611,"props":1881,"children":1883},{"class":613,"line":1882},27,[1884],{"type":42,"tag":611,"props":1885,"children":1886},{},[1887],{"type":47,"value":1888},"    return testVectors\n",{"type":42,"tag":50,"props":1890,"children":1891},{},[1892],{"type":42,"tag":200,"props":1893,"children":1894},{},[1895],{"type":47,"value":1896},"JavaScript Example:",{"type":42,"tag":418,"props":1898,"children":1902},{"className":1899,"code":1900,"language":1901,"meta":426,"style":426},"language-javascript shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","const fs = require('fs').promises;\n\nasync function loadWycheproofTestVectors(path) {\n  const tests = [];\n\n  try {\n    const fileContent = await fs.readFile(path);\n    const data = JSON.parse(fileContent.toString());\n\n    data.testGroups.forEach(testGroup => {\n      testGroup.tests.forEach(test => {\n        \u002F\u002F Add shared test group properties to each test\n        test['pk'] = testGroup.publicKey.pk;\n        tests.push(test);\n      });\n    });\n  } catch (err) {\n    console.error('Error reading or parsing file:', err);\n    throw err;\n  }\n\n  return tests;\n}\n","javascript",[1903],{"type":42,"tag":306,"props":1904,"children":1905},{"__ignoreMap":426},[1906,1967,1974,2011,2039,2046,2058,2110,2167,2174,2217,2259,2267,2327,2360,2376,2392,2425,2477,2493,2501,2508,2524],{"type":42,"tag":611,"props":1907,"children":1908},{"class":613,"line":614},[1909,1915,1920,1924,1929,1934,1938,1943,1947,1952,1957,1962],{"type":42,"tag":611,"props":1910,"children":1912},{"style":1911},"--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA",[1913],{"type":47,"value":1914},"const",{"type":42,"tag":611,"props":1916,"children":1917},{"style":634},[1918],{"type":47,"value":1919}," fs ",{"type":42,"tag":611,"props":1921,"children":1922},{"style":618},[1923],{"type":47,"value":1239},{"type":42,"tag":611,"props":1925,"children":1926},{"style":1574},[1927],{"type":47,"value":1928}," require",{"type":42,"tag":611,"props":1930,"children":1931},{"style":634},[1932],{"type":47,"value":1933},"(",{"type":42,"tag":611,"props":1935,"children":1936},{"style":618},[1937],{"type":47,"value":1271},{"type":42,"tag":611,"props":1939,"children":1940},{"style":624},[1941],{"type":47,"value":1942},"fs",{"type":42,"tag":611,"props":1944,"children":1945},{"style":618},[1946],{"type":47,"value":1271},{"type":42,"tag":611,"props":1948,"children":1949},{"style":634},[1950],{"type":47,"value":1951},")",{"type":42,"tag":611,"props":1953,"children":1954},{"style":618},[1955],{"type":47,"value":1956},".",{"type":42,"tag":611,"props":1958,"children":1959},{"style":634},[1960],{"type":47,"value":1961},"promises",{"type":42,"tag":611,"props":1963,"children":1964},{"style":618},[1965],{"type":47,"value":1966},";\n",{"type":42,"tag":611,"props":1968,"children":1969},{"class":613,"line":640},[1970],{"type":42,"tag":611,"props":1971,"children":1972},{"emptyLinePlaceholder":1223},[1973],{"type":47,"value":1226},{"type":42,"tag":611,"props":1975,"children":1976},{"class":613,"line":662},[1977,1982,1987,1992,1996,2002,2006],{"type":42,"tag":611,"props":1978,"children":1979},{"style":1911},[1980],{"type":47,"value":1981},"async",{"type":42,"tag":611,"props":1983,"children":1984},{"style":1911},[1985],{"type":47,"value":1986}," function",{"type":42,"tag":611,"props":1988,"children":1989},{"style":1574},[1990],{"type":47,"value":1991}," loadWycheproofTestVectors",{"type":42,"tag":611,"props":1993,"children":1994},{"style":618},[1995],{"type":47,"value":1933},{"type":42,"tag":611,"props":1997,"children":1999},{"style":1998},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic",[2000],{"type":47,"value":2001},"path",{"type":42,"tag":611,"props":2003,"children":2004},{"style":618},[2005],{"type":47,"value":1951},{"type":42,"tag":611,"props":2007,"children":2008},{"style":618},[2009],{"type":47,"value":2010}," {\n",{"type":42,"tag":611,"props":2012,"children":2013},{"class":613,"line":684},[2014,2019,2024,2029,2035],{"type":42,"tag":611,"props":2015,"children":2016},{"style":1911},[2017],{"type":47,"value":2018},"  const",{"type":42,"tag":611,"props":2020,"children":2021},{"style":634},[2022],{"type":47,"value":2023}," tests",{"type":42,"tag":611,"props":2025,"children":2026},{"style":618},[2027],{"type":47,"value":2028}," =",{"type":42,"tag":611,"props":2030,"children":2032},{"style":2031},"--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178",[2033],{"type":47,"value":2034}," []",{"type":42,"tag":611,"props":2036,"children":2037},{"style":618},[2038],{"type":47,"value":1966},{"type":42,"tag":611,"props":2040,"children":2041},{"class":613,"line":706},[2042],{"type":42,"tag":611,"props":2043,"children":2044},{"emptyLinePlaceholder":1223},[2045],{"type":47,"value":1226},{"type":42,"tag":611,"props":2047,"children":2048},{"class":613,"line":728},[2049,2054],{"type":42,"tag":611,"props":2050,"children":2051},{"style":1381},[2052],{"type":47,"value":2053},"  try",{"type":42,"tag":611,"props":2055,"children":2056},{"style":618},[2057],{"type":47,"value":2010},{"type":42,"tag":611,"props":2059,"children":2060},{"class":613,"line":750},[2061,2066,2071,2075,2080,2085,2089,2094,2098,2102,2106],{"type":42,"tag":611,"props":2062,"children":2063},{"style":1911},[2064],{"type":47,"value":2065},"    const",{"type":42,"tag":611,"props":2067,"children":2068},{"style":634},[2069],{"type":47,"value":2070}," fileContent",{"type":42,"tag":611,"props":2072,"children":2073},{"style":618},[2074],{"type":47,"value":2028},{"type":42,"tag":611,"props":2076,"children":2077},{"style":1381},[2078],{"type":47,"value":2079}," await",{"type":42,"tag":611,"props":2081,"children":2082},{"style":634},[2083],{"type":47,"value":2084}," fs",{"type":42,"tag":611,"props":2086,"children":2087},{"style":618},[2088],{"type":47,"value":1956},{"type":42,"tag":611,"props":2090,"children":2091},{"style":1574},[2092],{"type":47,"value":2093},"readFile",{"type":42,"tag":611,"props":2095,"children":2096},{"style":2031},[2097],{"type":47,"value":1933},{"type":42,"tag":611,"props":2099,"children":2100},{"style":634},[2101],{"type":47,"value":2001},{"type":42,"tag":611,"props":2103,"children":2104},{"style":2031},[2105],{"type":47,"value":1951},{"type":42,"tag":611,"props":2107,"children":2108},{"style":618},[2109],{"type":47,"value":1966},{"type":42,"tag":611,"props":2111,"children":2112},{"class":613,"line":1341},[2113,2117,2122,2126,2131,2135,2140,2144,2149,2153,2158,2163],{"type":42,"tag":611,"props":2114,"children":2115},{"style":1911},[2116],{"type":47,"value":2065},{"type":42,"tag":611,"props":2118,"children":2119},{"style":634},[2120],{"type":47,"value":2121}," data",{"type":42,"tag":611,"props":2123,"children":2124},{"style":618},[2125],{"type":47,"value":2028},{"type":42,"tag":611,"props":2127,"children":2128},{"style":634},[2129],{"type":47,"value":2130}," JSON",{"type":42,"tag":611,"props":2132,"children":2133},{"style":618},[2134],{"type":47,"value":1956},{"type":42,"tag":611,"props":2136,"children":2137},{"style":1574},[2138],{"type":47,"value":2139},"parse",{"type":42,"tag":611,"props":2141,"children":2142},{"style":2031},[2143],{"type":47,"value":1933},{"type":42,"tag":611,"props":2145,"children":2146},{"style":634},[2147],{"type":47,"value":2148},"fileContent",{"type":42,"tag":611,"props":2150,"children":2151},{"style":618},[2152],{"type":47,"value":1956},{"type":42,"tag":611,"props":2154,"children":2155},{"style":1574},[2156],{"type":47,"value":2157},"toString",{"type":42,"tag":611,"props":2159,"children":2160},{"style":2031},[2161],{"type":47,"value":2162},"())",{"type":42,"tag":611,"props":2164,"children":2165},{"style":618},[2166],{"type":47,"value":1966},{"type":42,"tag":611,"props":2168,"children":2169},{"class":613,"line":1360},[2170],{"type":42,"tag":611,"props":2171,"children":2172},{"emptyLinePlaceholder":1223},[2173],{"type":47,"value":1226},{"type":42,"tag":611,"props":2175,"children":2176},{"class":613,"line":1368},[2177,2182,2186,2190,2194,2199,2203,2208,2213],{"type":42,"tag":611,"props":2178,"children":2179},{"style":634},[2180],{"type":47,"value":2181},"    data",{"type":42,"tag":611,"props":2183,"children":2184},{"style":618},[2185],{"type":47,"value":1956},{"type":42,"tag":611,"props":2187,"children":2188},{"style":634},[2189],{"type":47,"value":760},{"type":42,"tag":611,"props":2191,"children":2192},{"style":618},[2193],{"type":47,"value":1956},{"type":42,"tag":611,"props":2195,"children":2196},{"style":1574},[2197],{"type":47,"value":2198},"forEach",{"type":42,"tag":611,"props":2200,"children":2201},{"style":2031},[2202],{"type":47,"value":1933},{"type":42,"tag":611,"props":2204,"children":2205},{"style":1998},[2206],{"type":47,"value":2207},"testGroup",{"type":42,"tag":611,"props":2209,"children":2210},{"style":1911},[2211],{"type":47,"value":2212}," =>",{"type":42,"tag":611,"props":2214,"children":2215},{"style":618},[2216],{"type":47,"value":2010},{"type":42,"tag":611,"props":2218,"children":2219},{"class":613,"line":1377},[2220,2225,2229,2234,2238,2242,2246,2251,2255],{"type":42,"tag":611,"props":2221,"children":2222},{"style":634},[2223],{"type":47,"value":2224},"      testGroup",{"type":42,"tag":611,"props":2226,"children":2227},{"style":618},[2228],{"type":47,"value":1956},{"type":42,"tag":611,"props":2230,"children":2231},{"style":634},[2232],{"type":47,"value":2233},"tests",{"type":42,"tag":611,"props":2235,"children":2236},{"style":618},[2237],{"type":47,"value":1956},{"type":42,"tag":611,"props":2239,"children":2240},{"style":1574},[2241],{"type":47,"value":2198},{"type":42,"tag":611,"props":2243,"children":2244},{"style":2031},[2245],{"type":47,"value":1933},{"type":42,"tag":611,"props":2247,"children":2248},{"style":1998},[2249],{"type":47,"value":2250},"test",{"type":42,"tag":611,"props":2252,"children":2253},{"style":1911},[2254],{"type":47,"value":2212},{"type":42,"tag":611,"props":2256,"children":2257},{"style":618},[2258],{"type":47,"value":2010},{"type":42,"tag":611,"props":2260,"children":2261},{"class":613,"line":1421},[2262],{"type":42,"tag":611,"props":2263,"children":2264},{"style":1214},[2265],{"type":47,"value":2266},"        \u002F\u002F Add shared test group properties to each test\n",{"type":42,"tag":611,"props":2268,"children":2269},{"class":613,"line":1478},[2270,2275,2280,2284,2288,2292,2297,2301,2306,2310,2315,2319,2323],{"type":42,"tag":611,"props":2271,"children":2272},{"style":634},[2273],{"type":47,"value":2274},"        test",{"type":42,"tag":611,"props":2276,"children":2277},{"style":2031},[2278],{"type":47,"value":2279},"[",{"type":42,"tag":611,"props":2281,"children":2282},{"style":618},[2283],{"type":47,"value":1271},{"type":42,"tag":611,"props":2285,"children":2286},{"style":624},[2287],{"type":47,"value":1130},{"type":42,"tag":611,"props":2289,"children":2290},{"style":618},[2291],{"type":47,"value":1271},{"type":42,"tag":611,"props":2293,"children":2294},{"style":2031},[2295],{"type":47,"value":2296},"] ",{"type":42,"tag":611,"props":2298,"children":2299},{"style":618},[2300],{"type":47,"value":1239},{"type":42,"tag":611,"props":2302,"children":2303},{"style":634},[2304],{"type":47,"value":2305}," testGroup",{"type":42,"tag":611,"props":2307,"children":2308},{"style":618},[2309],{"type":47,"value":1956},{"type":42,"tag":611,"props":2311,"children":2312},{"style":634},[2313],{"type":47,"value":2314},"publicKey",{"type":42,"tag":611,"props":2316,"children":2317},{"style":618},[2318],{"type":47,"value":1956},{"type":42,"tag":611,"props":2320,"children":2321},{"style":634},[2322],{"type":47,"value":1130},{"type":42,"tag":611,"props":2324,"children":2325},{"style":618},[2326],{"type":47,"value":1966},{"type":42,"tag":611,"props":2328,"children":2329},{"class":613,"line":1533},[2330,2335,2339,2344,2348,2352,2356],{"type":42,"tag":611,"props":2331,"children":2332},{"style":634},[2333],{"type":47,"value":2334},"        tests",{"type":42,"tag":611,"props":2336,"children":2337},{"style":618},[2338],{"type":47,"value":1956},{"type":42,"tag":611,"props":2340,"children":2341},{"style":1574},[2342],{"type":47,"value":2343},"push",{"type":42,"tag":611,"props":2345,"children":2346},{"style":2031},[2347],{"type":47,"value":1933},{"type":42,"tag":611,"props":2349,"children":2350},{"style":634},[2351],{"type":47,"value":2250},{"type":42,"tag":611,"props":2353,"children":2354},{"style":2031},[2355],{"type":47,"value":1951},{"type":42,"tag":611,"props":2357,"children":2358},{"style":618},[2359],{"type":47,"value":1966},{"type":42,"tag":611,"props":2361,"children":2362},{"class":613,"line":1570},[2363,2368,2372],{"type":42,"tag":611,"props":2364,"children":2365},{"style":618},[2366],{"type":47,"value":2367},"      }",{"type":42,"tag":611,"props":2369,"children":2370},{"style":2031},[2371],{"type":47,"value":1951},{"type":42,"tag":611,"props":2373,"children":2374},{"style":618},[2375],{"type":47,"value":1966},{"type":42,"tag":611,"props":2377,"children":2378},{"class":613,"line":1603},[2379,2384,2388],{"type":42,"tag":611,"props":2380,"children":2381},{"style":618},[2382],{"type":47,"value":2383},"    }",{"type":42,"tag":611,"props":2385,"children":2386},{"style":2031},[2387],{"type":47,"value":1951},{"type":42,"tag":611,"props":2389,"children":2390},{"style":618},[2391],{"type":47,"value":1966},{"type":42,"tag":611,"props":2393,"children":2394},{"class":613,"line":1617},[2395,2400,2405,2410,2415,2420],{"type":42,"tag":611,"props":2396,"children":2397},{"style":618},[2398],{"type":47,"value":2399},"  }",{"type":42,"tag":611,"props":2401,"children":2402},{"style":1381},[2403],{"type":47,"value":2404}," catch",{"type":42,"tag":611,"props":2406,"children":2407},{"style":2031},[2408],{"type":47,"value":2409}," (",{"type":42,"tag":611,"props":2411,"children":2412},{"style":634},[2413],{"type":47,"value":2414},"err",{"type":42,"tag":611,"props":2416,"children":2417},{"style":2031},[2418],{"type":47,"value":2419},") ",{"type":42,"tag":611,"props":2421,"children":2422},{"style":618},[2423],{"type":47,"value":2424},"{\n",{"type":42,"tag":611,"props":2426,"children":2427},{"class":613,"line":1626},[2428,2433,2437,2442,2446,2450,2455,2459,2464,2469,2473],{"type":42,"tag":611,"props":2429,"children":2430},{"style":634},[2431],{"type":47,"value":2432},"    console",{"type":42,"tag":611,"props":2434,"children":2435},{"style":618},[2436],{"type":47,"value":1956},{"type":42,"tag":611,"props":2438,"children":2439},{"style":1574},[2440],{"type":47,"value":2441},"error",{"type":42,"tag":611,"props":2443,"children":2444},{"style":2031},[2445],{"type":47,"value":1933},{"type":42,"tag":611,"props":2447,"children":2448},{"style":618},[2449],{"type":47,"value":1271},{"type":42,"tag":611,"props":2451,"children":2452},{"style":624},[2453],{"type":47,"value":2454},"Error reading or parsing file:",{"type":42,"tag":611,"props":2456,"children":2457},{"style":618},[2458],{"type":47,"value":1271},{"type":42,"tag":611,"props":2460,"children":2461},{"style":618},[2462],{"type":47,"value":2463},",",{"type":42,"tag":611,"props":2465,"children":2466},{"style":634},[2467],{"type":47,"value":2468}," err",{"type":42,"tag":611,"props":2470,"children":2471},{"style":2031},[2472],{"type":47,"value":1951},{"type":42,"tag":611,"props":2474,"children":2475},{"style":618},[2476],{"type":47,"value":1966},{"type":42,"tag":611,"props":2478,"children":2479},{"class":613,"line":1635},[2480,2485,2489],{"type":42,"tag":611,"props":2481,"children":2482},{"style":1381},[2483],{"type":47,"value":2484},"    throw",{"type":42,"tag":611,"props":2486,"children":2487},{"style":634},[2488],{"type":47,"value":2468},{"type":42,"tag":611,"props":2490,"children":2491},{"style":618},[2492],{"type":47,"value":1966},{"type":42,"tag":611,"props":2494,"children":2495},{"class":613,"line":1820},[2496],{"type":42,"tag":611,"props":2497,"children":2498},{"style":618},[2499],{"type":47,"value":2500},"  }\n",{"type":42,"tag":611,"props":2502,"children":2503},{"class":613,"line":1829},[2504],{"type":42,"tag":611,"props":2505,"children":2506},{"emptyLinePlaceholder":1223},[2507],{"type":47,"value":1226},{"type":42,"tag":611,"props":2509,"children":2510},{"class":613,"line":1838},[2511,2516,2520],{"type":42,"tag":611,"props":2512,"children":2513},{"style":1381},[2514],{"type":47,"value":2515},"  return",{"type":42,"tag":611,"props":2517,"children":2518},{"style":634},[2519],{"type":47,"value":2023},{"type":42,"tag":611,"props":2521,"children":2522},{"style":618},[2523],{"type":47,"value":1966},{"type":42,"tag":611,"props":2525,"children":2526},{"class":613,"line":1847},[2527],{"type":42,"tag":611,"props":2528,"children":2529},{"style":618},[2530],{"type":47,"value":2531},"}\n",{"type":42,"tag":63,"props":2533,"children":2535},{"id":2534},"phase-3-write-testing-harness",[2536],{"type":47,"value":2537},"Phase 3: Write Testing Harness",{"type":42,"tag":50,"props":2539,"children":2540},{},[2541],{"type":47,"value":2542},"Create test functions that handle both valid and invalid test cases.",{"type":42,"tag":50,"props":2544,"children":2545},{},[2546],{"type":42,"tag":200,"props":2547,"children":2548},{},[2549],{"type":47,"value":2550},"Python\u002Fpytest Example:",{"type":42,"tag":418,"props":2552,"children":2554},{"className":1663,"code":2553,"language":1665,"meta":426,"style":426},"import pytest\nfrom cryptography.hazmat.primitives.ciphers.aead import AESGCM\n\ntvs = load_wycheproof_test_vectors(\"wycheproof\u002Ftestvectors_v1\u002Faes_gcm_test.json\")\n\n@pytest.mark.parametrize(\"tv\", tvs, ids=[str(tv['tcId']) for tv in tvs])\ndef test_encryption(tv):\n    try:\n        aesgcm = AESGCM(tv['key'])\n        ct = aesgcm.encrypt(tv['iv'], tv['msg'], tv['aad'])\n    except ValueError as e:\n        # Implementation raised error - verify test was expected to fail\n        assert tv['result'] != 'valid', tv['comment']\n        return\n\n    if tv['result'] == 'valid':\n        assert ct[:-16] == tv['ct'], f\"Ciphertext mismatch: {tv['comment']}\"\n        assert ct[-16:] == tv['tag'], f\"Tag mismatch: {tv['comment']}\"\n    elif tv['result'] == 'invalid' or tv['result'] == 'acceptable':\n        assert ct[:-16] != tv['ct'] or ct[-16:] != tv['tag']\n\n@pytest.mark.parametrize(\"tv\", tvs, ids=[str(tv['tcId']) for tv in tvs])\ndef test_decryption(tv):\n    try:\n        aesgcm = AESGCM(tv['key'])\n        decrypted_msg = aesgcm.decrypt(tv['iv'], tv['ct'] + tv['tag'], tv['aad'])\n    except ValueError:\n        assert tv['result'] != 'valid', tv['comment']\n        return\n    except InvalidTag:\n        assert tv['result'] != 'valid', tv['comment']\n        assert 'ModifiedTag' in tv['flags'], f\"Expected 'ModifiedTag' flag: {tv['comment']}\"\n        return\n\n    assert tv['result'] == 'valid', f\"No invalid test case should pass: {tv['comment']}\"\n    assert decrypted_msg == tv['msg'], f\"Decryption mismatch: {tv['comment']}\"\n",[2555],{"type":42,"tag":306,"props":2556,"children":2557},{"__ignoreMap":426},[2558,2566,2574,2581,2589,2596,2604,2612,2619,2627,2635,2643,2651,2659,2667,2674,2682,2690,2698,2706,2714,2721,2728,2736,2743,2750,2758,2766,2774,2782,2791,2799,2808,2816,2824,2833],{"type":42,"tag":611,"props":2559,"children":2560},{"class":613,"line":614},[2561],{"type":42,"tag":611,"props":2562,"children":2563},{},[2564],{"type":47,"value":2565},"import pytest\n",{"type":42,"tag":611,"props":2567,"children":2568},{"class":613,"line":640},[2569],{"type":42,"tag":611,"props":2570,"children":2571},{},[2572],{"type":47,"value":2573},"from cryptography.hazmat.primitives.ciphers.aead import AESGCM\n",{"type":42,"tag":611,"props":2575,"children":2576},{"class":613,"line":662},[2577],{"type":42,"tag":611,"props":2578,"children":2579},{"emptyLinePlaceholder":1223},[2580],{"type":47,"value":1226},{"type":42,"tag":611,"props":2582,"children":2583},{"class":613,"line":684},[2584],{"type":42,"tag":611,"props":2585,"children":2586},{},[2587],{"type":47,"value":2588},"tvs = load_wycheproof_test_vectors(\"wycheproof\u002Ftestvectors_v1\u002Faes_gcm_test.json\")\n",{"type":42,"tag":611,"props":2590,"children":2591},{"class":613,"line":706},[2592],{"type":42,"tag":611,"props":2593,"children":2594},{"emptyLinePlaceholder":1223},[2595],{"type":47,"value":1226},{"type":42,"tag":611,"props":2597,"children":2598},{"class":613,"line":728},[2599],{"type":42,"tag":611,"props":2600,"children":2601},{},[2602],{"type":47,"value":2603},"@pytest.mark.parametrize(\"tv\", tvs, ids=[str(tv['tcId']) for tv in tvs])\n",{"type":42,"tag":611,"props":2605,"children":2606},{"class":613,"line":750},[2607],{"type":42,"tag":611,"props":2608,"children":2609},{},[2610],{"type":47,"value":2611},"def test_encryption(tv):\n",{"type":42,"tag":611,"props":2613,"children":2614},{"class":613,"line":1341},[2615],{"type":42,"tag":611,"props":2616,"children":2617},{},[2618],{"type":47,"value":1708},{"type":42,"tag":611,"props":2620,"children":2621},{"class":613,"line":1360},[2622],{"type":42,"tag":611,"props":2623,"children":2624},{},[2625],{"type":47,"value":2626},"        aesgcm = AESGCM(tv['key'])\n",{"type":42,"tag":611,"props":2628,"children":2629},{"class":613,"line":1368},[2630],{"type":42,"tag":611,"props":2631,"children":2632},{},[2633],{"type":47,"value":2634},"        ct = aesgcm.encrypt(tv['iv'], tv['msg'], tv['aad'])\n",{"type":42,"tag":611,"props":2636,"children":2637},{"class":613,"line":1377},[2638],{"type":42,"tag":611,"props":2639,"children":2640},{},[2641],{"type":47,"value":2642},"    except ValueError as e:\n",{"type":42,"tag":611,"props":2644,"children":2645},{"class":613,"line":1421},[2646],{"type":42,"tag":611,"props":2647,"children":2648},{},[2649],{"type":47,"value":2650},"        # Implementation raised error - verify test was expected to fail\n",{"type":42,"tag":611,"props":2652,"children":2653},{"class":613,"line":1478},[2654],{"type":42,"tag":611,"props":2655,"children":2656},{},[2657],{"type":47,"value":2658},"        assert tv['result'] != 'valid', tv['comment']\n",{"type":42,"tag":611,"props":2660,"children":2661},{"class":613,"line":1533},[2662],{"type":42,"tag":611,"props":2663,"children":2664},{},[2665],{"type":47,"value":2666},"        return\n",{"type":42,"tag":611,"props":2668,"children":2669},{"class":613,"line":1570},[2670],{"type":42,"tag":611,"props":2671,"children":2672},{"emptyLinePlaceholder":1223},[2673],{"type":47,"value":1226},{"type":42,"tag":611,"props":2675,"children":2676},{"class":613,"line":1603},[2677],{"type":42,"tag":611,"props":2678,"children":2679},{},[2680],{"type":47,"value":2681},"    if tv['result'] == 'valid':\n",{"type":42,"tag":611,"props":2683,"children":2684},{"class":613,"line":1617},[2685],{"type":42,"tag":611,"props":2686,"children":2687},{},[2688],{"type":47,"value":2689},"        assert ct[:-16] == tv['ct'], f\"Ciphertext mismatch: {tv['comment']}\"\n",{"type":42,"tag":611,"props":2691,"children":2692},{"class":613,"line":1626},[2693],{"type":42,"tag":611,"props":2694,"children":2695},{},[2696],{"type":47,"value":2697},"        assert ct[-16:] == tv['tag'], f\"Tag mismatch: {tv['comment']}\"\n",{"type":42,"tag":611,"props":2699,"children":2700},{"class":613,"line":1635},[2701],{"type":42,"tag":611,"props":2702,"children":2703},{},[2704],{"type":47,"value":2705},"    elif tv['result'] == 'invalid' or tv['result'] == 'acceptable':\n",{"type":42,"tag":611,"props":2707,"children":2708},{"class":613,"line":1820},[2709],{"type":42,"tag":611,"props":2710,"children":2711},{},[2712],{"type":47,"value":2713},"        assert ct[:-16] != tv['ct'] or ct[-16:] != tv['tag']\n",{"type":42,"tag":611,"props":2715,"children":2716},{"class":613,"line":1829},[2717],{"type":42,"tag":611,"props":2718,"children":2719},{"emptyLinePlaceholder":1223},[2720],{"type":47,"value":1226},{"type":42,"tag":611,"props":2722,"children":2723},{"class":613,"line":1838},[2724],{"type":42,"tag":611,"props":2725,"children":2726},{},[2727],{"type":47,"value":2603},{"type":42,"tag":611,"props":2729,"children":2730},{"class":613,"line":1847},[2731],{"type":42,"tag":611,"props":2732,"children":2733},{},[2734],{"type":47,"value":2735},"def test_decryption(tv):\n",{"type":42,"tag":611,"props":2737,"children":2738},{"class":613,"line":1856},[2739],{"type":42,"tag":611,"props":2740,"children":2741},{},[2742],{"type":47,"value":1708},{"type":42,"tag":611,"props":2744,"children":2745},{"class":613,"line":1865},[2746],{"type":42,"tag":611,"props":2747,"children":2748},{},[2749],{"type":47,"value":2626},{"type":42,"tag":611,"props":2751,"children":2752},{"class":613,"line":1874},[2753],{"type":42,"tag":611,"props":2754,"children":2755},{},[2756],{"type":47,"value":2757},"        decrypted_msg = aesgcm.decrypt(tv['iv'], tv['ct'] + tv['tag'], tv['aad'])\n",{"type":42,"tag":611,"props":2759,"children":2760},{"class":613,"line":1882},[2761],{"type":42,"tag":611,"props":2762,"children":2763},{},[2764],{"type":47,"value":2765},"    except ValueError:\n",{"type":42,"tag":611,"props":2767,"children":2769},{"class":613,"line":2768},28,[2770],{"type":42,"tag":611,"props":2771,"children":2772},{},[2773],{"type":47,"value":2658},{"type":42,"tag":611,"props":2775,"children":2777},{"class":613,"line":2776},29,[2778],{"type":42,"tag":611,"props":2779,"children":2780},{},[2781],{"type":47,"value":2666},{"type":42,"tag":611,"props":2783,"children":2785},{"class":613,"line":2784},30,[2786],{"type":42,"tag":611,"props":2787,"children":2788},{},[2789],{"type":47,"value":2790},"    except InvalidTag:\n",{"type":42,"tag":611,"props":2792,"children":2794},{"class":613,"line":2793},31,[2795],{"type":42,"tag":611,"props":2796,"children":2797},{},[2798],{"type":47,"value":2658},{"type":42,"tag":611,"props":2800,"children":2802},{"class":613,"line":2801},32,[2803],{"type":42,"tag":611,"props":2804,"children":2805},{},[2806],{"type":47,"value":2807},"        assert 'ModifiedTag' in tv['flags'], f\"Expected 'ModifiedTag' flag: {tv['comment']}\"\n",{"type":42,"tag":611,"props":2809,"children":2811},{"class":613,"line":2810},33,[2812],{"type":42,"tag":611,"props":2813,"children":2814},{},[2815],{"type":47,"value":2666},{"type":42,"tag":611,"props":2817,"children":2819},{"class":613,"line":2818},34,[2820],{"type":42,"tag":611,"props":2821,"children":2822},{"emptyLinePlaceholder":1223},[2823],{"type":47,"value":1226},{"type":42,"tag":611,"props":2825,"children":2827},{"class":613,"line":2826},35,[2828],{"type":42,"tag":611,"props":2829,"children":2830},{},[2831],{"type":47,"value":2832},"    assert tv['result'] == 'valid', f\"No invalid test case should pass: {tv['comment']}\"\n",{"type":42,"tag":611,"props":2834,"children":2836},{"class":613,"line":2835},36,[2837],{"type":42,"tag":611,"props":2838,"children":2839},{},[2840],{"type":47,"value":2841},"    assert decrypted_msg == tv['msg'], f\"Decryption mismatch: {tv['comment']}\"\n",{"type":42,"tag":50,"props":2843,"children":2844},{},[2845],{"type":42,"tag":200,"props":2846,"children":2847},{},[2848],{"type":47,"value":2849},"JavaScript\u002FMocha Example:",{"type":42,"tag":418,"props":2851,"children":2853},{"className":1899,"code":2852,"language":1901,"meta":426,"style":426},"const assert = require('assert');\n\nfunction testFactory(tcId, tests) {\n  it(`[${tcId + 1}] ${tests[tcId].comment}`, function () {\n    const test = tests[tcId];\n    const ed25519 = new eddsa('ed25519');\n    const key = ed25519.keyFromPublic(toArray(test.pk, 'hex'));\n\n    let sig;\n    if (test.result === 'valid') {\n      sig = key.verify(test.msg, test.sig);\n      assert.equal(sig, true, `[${test.tcId}] ${test.comment}`);\n    } else if (test.result === 'invalid') {\n      try {\n        sig = key.verify(test.msg, test.sig);\n      } catch (err) {\n        \u002F\u002F Point could not be decoded\n        sig = false;\n      }\n      assert.equal(sig, false, `[${test.tcId}] ${test.comment}`);\n    }\n  });\n}\n\n\u002F\u002F Generate tests for all test vectors\nfor (var tcId = 0; tcId \u003C tests.length; tcId++) {\n  testFactory(tcId, tests);\n}\n",[2854],{"type":42,"tag":306,"props":2855,"children":2856},{"__ignoreMap":426},[2857,2902,2909,2946,3034,3071,3122,3202,3209,3226,3274,3339,3439,3496,3508,3572,3599,3607,3627,3635,3730,3738,3753,3760,3767,3775,3852,3884],{"type":42,"tag":611,"props":2858,"children":2859},{"class":613,"line":614},[2860,2864,2869,2873,2877,2881,2885,2890,2894,2898],{"type":42,"tag":611,"props":2861,"children":2862},{"style":1911},[2863],{"type":47,"value":1914},{"type":42,"tag":611,"props":2865,"children":2866},{"style":634},[2867],{"type":47,"value":2868}," assert ",{"type":42,"tag":611,"props":2870,"children":2871},{"style":618},[2872],{"type":47,"value":1239},{"type":42,"tag":611,"props":2874,"children":2875},{"style":1574},[2876],{"type":47,"value":1928},{"type":42,"tag":611,"props":2878,"children":2879},{"style":634},[2880],{"type":47,"value":1933},{"type":42,"tag":611,"props":2882,"children":2883},{"style":618},[2884],{"type":47,"value":1271},{"type":42,"tag":611,"props":2886,"children":2887},{"style":624},[2888],{"type":47,"value":2889},"assert",{"type":42,"tag":611,"props":2891,"children":2892},{"style":618},[2893],{"type":47,"value":1271},{"type":42,"tag":611,"props":2895,"children":2896},{"style":634},[2897],{"type":47,"value":1951},{"type":42,"tag":611,"props":2899,"children":2900},{"style":618},[2901],{"type":47,"value":1966},{"type":42,"tag":611,"props":2903,"children":2904},{"class":613,"line":640},[2905],{"type":42,"tag":611,"props":2906,"children":2907},{"emptyLinePlaceholder":1223},[2908],{"type":47,"value":1226},{"type":42,"tag":611,"props":2910,"children":2911},{"class":613,"line":662},[2912,2917,2922,2926,2930,2934,2938,2942],{"type":42,"tag":611,"props":2913,"children":2914},{"style":1911},[2915],{"type":47,"value":2916},"function",{"type":42,"tag":611,"props":2918,"children":2919},{"style":1574},[2920],{"type":47,"value":2921}," testFactory",{"type":42,"tag":611,"props":2923,"children":2924},{"style":618},[2925],{"type":47,"value":1933},{"type":42,"tag":611,"props":2927,"children":2928},{"style":1998},[2929],{"type":47,"value":836},{"type":42,"tag":611,"props":2931,"children":2932},{"style":618},[2933],{"type":47,"value":2463},{"type":42,"tag":611,"props":2935,"children":2936},{"style":1998},[2937],{"type":47,"value":2023},{"type":42,"tag":611,"props":2939,"children":2940},{"style":618},[2941],{"type":47,"value":1951},{"type":42,"tag":611,"props":2943,"children":2944},{"style":618},[2945],{"type":47,"value":2010},{"type":42,"tag":611,"props":2947,"children":2948},{"class":613,"line":684},[2949,2954,2958,2963,2967,2971,2976,2981,2986,2991,2995,2999,3004,3008,3012,3017,3021,3025,3030],{"type":42,"tag":611,"props":2950,"children":2951},{"style":1574},[2952],{"type":47,"value":2953},"  it",{"type":42,"tag":611,"props":2955,"children":2956},{"style":2031},[2957],{"type":47,"value":1933},{"type":42,"tag":611,"props":2959,"children":2960},{"style":618},[2961],{"type":47,"value":2962},"`",{"type":42,"tag":611,"props":2964,"children":2965},{"style":624},[2966],{"type":47,"value":2279},{"type":42,"tag":611,"props":2968,"children":2969},{"style":618},[2970],{"type":47,"value":1592},{"type":42,"tag":611,"props":2972,"children":2973},{"style":634},[2974],{"type":47,"value":2975},"tcId ",{"type":42,"tag":611,"props":2977,"children":2978},{"style":618},[2979],{"type":47,"value":2980},"+",{"type":42,"tag":611,"props":2982,"children":2983},{"style":1556},[2984],{"type":47,"value":2985}," 1",{"type":42,"tag":611,"props":2987,"children":2988},{"style":618},[2989],{"type":47,"value":2990},"}",{"type":42,"tag":611,"props":2992,"children":2993},{"style":624},[2994],{"type":47,"value":2296},{"type":42,"tag":611,"props":2996,"children":2997},{"style":618},[2998],{"type":47,"value":1592},{"type":42,"tag":611,"props":3000,"children":3001},{"style":634},[3002],{"type":47,"value":3003},"tests[tcId]",{"type":42,"tag":611,"props":3005,"children":3006},{"style":618},[3007],{"type":47,"value":1956},{"type":42,"tag":611,"props":3009,"children":3010},{"style":634},[3011],{"type":47,"value":846},{"type":42,"tag":611,"props":3013,"children":3014},{"style":618},[3015],{"type":47,"value":3016},"}`",{"type":42,"tag":611,"props":3018,"children":3019},{"style":618},[3020],{"type":47,"value":2463},{"type":42,"tag":611,"props":3022,"children":3023},{"style":1911},[3024],{"type":47,"value":1986},{"type":42,"tag":611,"props":3026,"children":3027},{"style":618},[3028],{"type":47,"value":3029}," ()",{"type":42,"tag":611,"props":3031,"children":3032},{"style":618},[3033],{"type":47,"value":2010},{"type":42,"tag":611,"props":3035,"children":3036},{"class":613,"line":706},[3037,3041,3046,3050,3054,3058,3062,3067],{"type":42,"tag":611,"props":3038,"children":3039},{"style":1911},[3040],{"type":47,"value":2065},{"type":42,"tag":611,"props":3042,"children":3043},{"style":634},[3044],{"type":47,"value":3045}," test",{"type":42,"tag":611,"props":3047,"children":3048},{"style":618},[3049],{"type":47,"value":2028},{"type":42,"tag":611,"props":3051,"children":3052},{"style":634},[3053],{"type":47,"value":2023},{"type":42,"tag":611,"props":3055,"children":3056},{"style":2031},[3057],{"type":47,"value":2279},{"type":42,"tag":611,"props":3059,"children":3060},{"style":634},[3061],{"type":47,"value":836},{"type":42,"tag":611,"props":3063,"children":3064},{"style":2031},[3065],{"type":47,"value":3066},"]",{"type":42,"tag":611,"props":3068,"children":3069},{"style":618},[3070],{"type":47,"value":1966},{"type":42,"tag":611,"props":3072,"children":3073},{"class":613,"line":728},[3074,3078,3083,3087,3092,3097,3101,3105,3110,3114,3118],{"type":42,"tag":611,"props":3075,"children":3076},{"style":1911},[3077],{"type":47,"value":2065},{"type":42,"tag":611,"props":3079,"children":3080},{"style":634},[3081],{"type":47,"value":3082}," ed25519",{"type":42,"tag":611,"props":3084,"children":3085},{"style":618},[3086],{"type":47,"value":2028},{"type":42,"tag":611,"props":3088,"children":3089},{"style":618},[3090],{"type":47,"value":3091}," new",{"type":42,"tag":611,"props":3093,"children":3094},{"style":1574},[3095],{"type":47,"value":3096}," eddsa",{"type":42,"tag":611,"props":3098,"children":3099},{"style":2031},[3100],{"type":47,"value":1933},{"type":42,"tag":611,"props":3102,"children":3103},{"style":618},[3104],{"type":47,"value":1271},{"type":42,"tag":611,"props":3106,"children":3107},{"style":624},[3108],{"type":47,"value":3109},"ed25519",{"type":42,"tag":611,"props":3111,"children":3112},{"style":618},[3113],{"type":47,"value":1271},{"type":42,"tag":611,"props":3115,"children":3116},{"style":2031},[3117],{"type":47,"value":1951},{"type":42,"tag":611,"props":3119,"children":3120},{"style":618},[3121],{"type":47,"value":1966},{"type":42,"tag":611,"props":3123,"children":3124},{"class":613,"line":750},[3125,3129,3134,3138,3142,3146,3151,3155,3160,3164,3168,3172,3176,3180,3184,3189,3193,3198],{"type":42,"tag":611,"props":3126,"children":3127},{"style":1911},[3128],{"type":47,"value":2065},{"type":42,"tag":611,"props":3130,"children":3131},{"style":634},[3132],{"type":47,"value":3133}," key",{"type":42,"tag":611,"props":3135,"children":3136},{"style":618},[3137],{"type":47,"value":2028},{"type":42,"tag":611,"props":3139,"children":3140},{"style":634},[3141],{"type":47,"value":3082},{"type":42,"tag":611,"props":3143,"children":3144},{"style":618},[3145],{"type":47,"value":1956},{"type":42,"tag":611,"props":3147,"children":3148},{"style":1574},[3149],{"type":47,"value":3150},"keyFromPublic",{"type":42,"tag":611,"props":3152,"children":3153},{"style":2031},[3154],{"type":47,"value":1933},{"type":42,"tag":611,"props":3156,"children":3157},{"style":1574},[3158],{"type":47,"value":3159},"toArray",{"type":42,"tag":611,"props":3161,"children":3162},{"style":2031},[3163],{"type":47,"value":1933},{"type":42,"tag":611,"props":3165,"children":3166},{"style":634},[3167],{"type":47,"value":2250},{"type":42,"tag":611,"props":3169,"children":3170},{"style":618},[3171],{"type":47,"value":1956},{"type":42,"tag":611,"props":3173,"children":3174},{"style":634},[3175],{"type":47,"value":1130},{"type":42,"tag":611,"props":3177,"children":3178},{"style":618},[3179],{"type":47,"value":2463},{"type":42,"tag":611,"props":3181,"children":3182},{"style":618},[3183],{"type":47,"value":1284},{"type":42,"tag":611,"props":3185,"children":3186},{"style":624},[3187],{"type":47,"value":3188},"hex",{"type":42,"tag":611,"props":3190,"children":3191},{"style":618},[3192],{"type":47,"value":1271},{"type":42,"tag":611,"props":3194,"children":3195},{"style":2031},[3196],{"type":47,"value":3197},"))",{"type":42,"tag":611,"props":3199,"children":3200},{"style":618},[3201],{"type":47,"value":1966},{"type":42,"tag":611,"props":3203,"children":3204},{"class":613,"line":1341},[3205],{"type":42,"tag":611,"props":3206,"children":3207},{"emptyLinePlaceholder":1223},[3208],{"type":47,"value":1226},{"type":42,"tag":611,"props":3210,"children":3211},{"class":613,"line":1360},[3212,3217,3222],{"type":42,"tag":611,"props":3213,"children":3214},{"style":1911},[3215],{"type":47,"value":3216},"    let",{"type":42,"tag":611,"props":3218,"children":3219},{"style":634},[3220],{"type":47,"value":3221}," sig",{"type":42,"tag":611,"props":3223,"children":3224},{"style":618},[3225],{"type":47,"value":1966},{"type":42,"tag":611,"props":3227,"children":3228},{"class":613,"line":1368},[3229,3233,3237,3241,3245,3249,3254,3258,3262,3266,3270],{"type":42,"tag":611,"props":3230,"children":3231},{"style":1381},[3232],{"type":47,"value":1539},{"type":42,"tag":611,"props":3234,"children":3235},{"style":2031},[3236],{"type":47,"value":2409},{"type":42,"tag":611,"props":3238,"children":3239},{"style":634},[3240],{"type":47,"value":2250},{"type":42,"tag":611,"props":3242,"children":3243},{"style":618},[3244],{"type":47,"value":1956},{"type":42,"tag":611,"props":3246,"children":3247},{"style":634},[3248],{"type":47,"value":873},{"type":42,"tag":611,"props":3250,"children":3251},{"style":618},[3252],{"type":47,"value":3253}," ===",{"type":42,"tag":611,"props":3255,"children":3256},{"style":618},[3257],{"type":47,"value":1284},{"type":42,"tag":611,"props":3259,"children":3260},{"style":624},[3261],{"type":47,"value":920},{"type":42,"tag":611,"props":3263,"children":3264},{"style":618},[3265],{"type":47,"value":1271},{"type":42,"tag":611,"props":3267,"children":3268},{"style":2031},[3269],{"type":47,"value":2419},{"type":42,"tag":611,"props":3271,"children":3272},{"style":618},[3273],{"type":47,"value":2424},{"type":42,"tag":611,"props":3275,"children":3276},{"class":613,"line":1377},[3277,3282,3286,3290,3294,3299,3303,3307,3311,3315,3319,3323,3327,3331,3335],{"type":42,"tag":611,"props":3278,"children":3279},{"style":634},[3280],{"type":47,"value":3281},"      sig",{"type":42,"tag":611,"props":3283,"children":3284},{"style":618},[3285],{"type":47,"value":2028},{"type":42,"tag":611,"props":3287,"children":3288},{"style":634},[3289],{"type":47,"value":3133},{"type":42,"tag":611,"props":3291,"children":3292},{"style":618},[3293],{"type":47,"value":1956},{"type":42,"tag":611,"props":3295,"children":3296},{"style":1574},[3297],{"type":47,"value":3298},"verify",{"type":42,"tag":611,"props":3300,"children":3301},{"style":2031},[3302],{"type":47,"value":1933},{"type":42,"tag":611,"props":3304,"children":3305},{"style":634},[3306],{"type":47,"value":2250},{"type":42,"tag":611,"props":3308,"children":3309},{"style":618},[3310],{"type":47,"value":1956},{"type":42,"tag":611,"props":3312,"children":3313},{"style":634},[3314],{"type":47,"value":1028},{"type":42,"tag":611,"props":3316,"children":3317},{"style":618},[3318],{"type":47,"value":2463},{"type":42,"tag":611,"props":3320,"children":3321},{"style":634},[3322],{"type":47,"value":3045},{"type":42,"tag":611,"props":3324,"children":3325},{"style":618},[3326],{"type":47,"value":1956},{"type":42,"tag":611,"props":3328,"children":3329},{"style":634},[3330],{"type":47,"value":1095},{"type":42,"tag":611,"props":3332,"children":3333},{"style":2031},[3334],{"type":47,"value":1951},{"type":42,"tag":611,"props":3336,"children":3337},{"style":618},[3338],{"type":47,"value":1966},{"type":42,"tag":611,"props":3340,"children":3341},{"class":613,"line":1421},[3342,3347,3351,3356,3360,3364,3368,3374,3378,3383,3387,3391,3395,3399,3403,3407,3411,3415,3419,3423,3427,3431,3435],{"type":42,"tag":611,"props":3343,"children":3344},{"style":634},[3345],{"type":47,"value":3346},"      assert",{"type":42,"tag":611,"props":3348,"children":3349},{"style":618},[3350],{"type":47,"value":1956},{"type":42,"tag":611,"props":3352,"children":3353},{"style":1574},[3354],{"type":47,"value":3355},"equal",{"type":42,"tag":611,"props":3357,"children":3358},{"style":2031},[3359],{"type":47,"value":1933},{"type":42,"tag":611,"props":3361,"children":3362},{"style":634},[3363],{"type":47,"value":1095},{"type":42,"tag":611,"props":3365,"children":3366},{"style":618},[3367],{"type":47,"value":2463},{"type":42,"tag":611,"props":3369,"children":3371},{"style":3370},"--shiki-light:#FF5370;--shiki-default:#FF9CAC;--shiki-dark:#FF9CAC",[3372],{"type":47,"value":3373}," true",{"type":42,"tag":611,"props":3375,"children":3376},{"style":618},[3377],{"type":47,"value":2463},{"type":42,"tag":611,"props":3379,"children":3380},{"style":618},[3381],{"type":47,"value":3382}," `",{"type":42,"tag":611,"props":3384,"children":3385},{"style":624},[3386],{"type":47,"value":2279},{"type":42,"tag":611,"props":3388,"children":3389},{"style":618},[3390],{"type":47,"value":1592},{"type":42,"tag":611,"props":3392,"children":3393},{"style":634},[3394],{"type":47,"value":2250},{"type":42,"tag":611,"props":3396,"children":3397},{"style":618},[3398],{"type":47,"value":1956},{"type":42,"tag":611,"props":3400,"children":3401},{"style":634},[3402],{"type":47,"value":836},{"type":42,"tag":611,"props":3404,"children":3405},{"style":618},[3406],{"type":47,"value":2990},{"type":42,"tag":611,"props":3408,"children":3409},{"style":624},[3410],{"type":47,"value":2296},{"type":42,"tag":611,"props":3412,"children":3413},{"style":618},[3414],{"type":47,"value":1592},{"type":42,"tag":611,"props":3416,"children":3417},{"style":634},[3418],{"type":47,"value":2250},{"type":42,"tag":611,"props":3420,"children":3421},{"style":618},[3422],{"type":47,"value":1956},{"type":42,"tag":611,"props":3424,"children":3425},{"style":634},[3426],{"type":47,"value":846},{"type":42,"tag":611,"props":3428,"children":3429},{"style":618},[3430],{"type":47,"value":3016},{"type":42,"tag":611,"props":3432,"children":3433},{"style":2031},[3434],{"type":47,"value":1951},{"type":42,"tag":611,"props":3436,"children":3437},{"style":618},[3438],{"type":47,"value":1966},{"type":42,"tag":611,"props":3440,"children":3441},{"class":613,"line":1478},[3442,3446,3451,3456,3460,3464,3468,3472,3476,3480,3484,3488,3492],{"type":42,"tag":611,"props":3443,"children":3444},{"style":618},[3445],{"type":47,"value":2383},{"type":42,"tag":611,"props":3447,"children":3448},{"style":1381},[3449],{"type":47,"value":3450}," else",{"type":42,"tag":611,"props":3452,"children":3453},{"style":1381},[3454],{"type":47,"value":3455}," if",{"type":42,"tag":611,"props":3457,"children":3458},{"style":2031},[3459],{"type":47,"value":2409},{"type":42,"tag":611,"props":3461,"children":3462},{"style":634},[3463],{"type":47,"value":2250},{"type":42,"tag":611,"props":3465,"children":3466},{"style":618},[3467],{"type":47,"value":1956},{"type":42,"tag":611,"props":3469,"children":3470},{"style":634},[3471],{"type":47,"value":873},{"type":42,"tag":611,"props":3473,"children":3474},{"style":618},[3475],{"type":47,"value":3253},{"type":42,"tag":611,"props":3477,"children":3478},{"style":618},[3479],{"type":47,"value":1284},{"type":42,"tag":611,"props":3481,"children":3482},{"style":624},[3483],{"type":47,"value":952},{"type":42,"tag":611,"props":3485,"children":3486},{"style":618},[3487],{"type":47,"value":1271},{"type":42,"tag":611,"props":3489,"children":3490},{"style":2031},[3491],{"type":47,"value":2419},{"type":42,"tag":611,"props":3493,"children":3494},{"style":618},[3495],{"type":47,"value":2424},{"type":42,"tag":611,"props":3497,"children":3498},{"class":613,"line":1533},[3499,3504],{"type":42,"tag":611,"props":3500,"children":3501},{"style":1381},[3502],{"type":47,"value":3503},"      try",{"type":42,"tag":611,"props":3505,"children":3506},{"style":618},[3507],{"type":47,"value":2010},{"type":42,"tag":611,"props":3509,"children":3510},{"class":613,"line":1570},[3511,3516,3520,3524,3528,3532,3536,3540,3544,3548,3552,3556,3560,3564,3568],{"type":42,"tag":611,"props":3512,"children":3513},{"style":634},[3514],{"type":47,"value":3515},"        sig",{"type":42,"tag":611,"props":3517,"children":3518},{"style":618},[3519],{"type":47,"value":2028},{"type":42,"tag":611,"props":3521,"children":3522},{"style":634},[3523],{"type":47,"value":3133},{"type":42,"tag":611,"props":3525,"children":3526},{"style":618},[3527],{"type":47,"value":1956},{"type":42,"tag":611,"props":3529,"children":3530},{"style":1574},[3531],{"type":47,"value":3298},{"type":42,"tag":611,"props":3533,"children":3534},{"style":2031},[3535],{"type":47,"value":1933},{"type":42,"tag":611,"props":3537,"children":3538},{"style":634},[3539],{"type":47,"value":2250},{"type":42,"tag":611,"props":3541,"children":3542},{"style":618},[3543],{"type":47,"value":1956},{"type":42,"tag":611,"props":3545,"children":3546},{"style":634},[3547],{"type":47,"value":1028},{"type":42,"tag":611,"props":3549,"children":3550},{"style":618},[3551],{"type":47,"value":2463},{"type":42,"tag":611,"props":3553,"children":3554},{"style":634},[3555],{"type":47,"value":3045},{"type":42,"tag":611,"props":3557,"children":3558},{"style":618},[3559],{"type":47,"value":1956},{"type":42,"tag":611,"props":3561,"children":3562},{"style":634},[3563],{"type":47,"value":1095},{"type":42,"tag":611,"props":3565,"children":3566},{"style":2031},[3567],{"type":47,"value":1951},{"type":42,"tag":611,"props":3569,"children":3570},{"style":618},[3571],{"type":47,"value":1966},{"type":42,"tag":611,"props":3573,"children":3574},{"class":613,"line":1603},[3575,3579,3583,3587,3591,3595],{"type":42,"tag":611,"props":3576,"children":3577},{"style":618},[3578],{"type":47,"value":2367},{"type":42,"tag":611,"props":3580,"children":3581},{"style":1381},[3582],{"type":47,"value":2404},{"type":42,"tag":611,"props":3584,"children":3585},{"style":2031},[3586],{"type":47,"value":2409},{"type":42,"tag":611,"props":3588,"children":3589},{"style":634},[3590],{"type":47,"value":2414},{"type":42,"tag":611,"props":3592,"children":3593},{"style":2031},[3594],{"type":47,"value":2419},{"type":42,"tag":611,"props":3596,"children":3597},{"style":618},[3598],{"type":47,"value":2424},{"type":42,"tag":611,"props":3600,"children":3601},{"class":613,"line":1617},[3602],{"type":42,"tag":611,"props":3603,"children":3604},{"style":1214},[3605],{"type":47,"value":3606},"        \u002F\u002F Point could not be decoded\n",{"type":42,"tag":611,"props":3608,"children":3609},{"class":613,"line":1626},[3610,3614,3618,3623],{"type":42,"tag":611,"props":3611,"children":3612},{"style":634},[3613],{"type":47,"value":3515},{"type":42,"tag":611,"props":3615,"children":3616},{"style":618},[3617],{"type":47,"value":2028},{"type":42,"tag":611,"props":3619,"children":3620},{"style":3370},[3621],{"type":47,"value":3622}," false",{"type":42,"tag":611,"props":3624,"children":3625},{"style":618},[3626],{"type":47,"value":1966},{"type":42,"tag":611,"props":3628,"children":3629},{"class":613,"line":1635},[3630],{"type":42,"tag":611,"props":3631,"children":3632},{"style":618},[3633],{"type":47,"value":3634},"      }\n",{"type":42,"tag":611,"props":3636,"children":3637},{"class":613,"line":1820},[3638,3642,3646,3650,3654,3658,3662,3666,3670,3674,3678,3682,3686,3690,3694,3698,3702,3706,3710,3714,3718,3722,3726],{"type":42,"tag":611,"props":3639,"children":3640},{"style":634},[3641],{"type":47,"value":3346},{"type":42,"tag":611,"props":3643,"children":3644},{"style":618},[3645],{"type":47,"value":1956},{"type":42,"tag":611,"props":3647,"children":3648},{"style":1574},[3649],{"type":47,"value":3355},{"type":42,"tag":611,"props":3651,"children":3652},{"style":2031},[3653],{"type":47,"value":1933},{"type":42,"tag":611,"props":3655,"children":3656},{"style":634},[3657],{"type":47,"value":1095},{"type":42,"tag":611,"props":3659,"children":3660},{"style":618},[3661],{"type":47,"value":2463},{"type":42,"tag":611,"props":3663,"children":3664},{"style":3370},[3665],{"type":47,"value":3622},{"type":42,"tag":611,"props":3667,"children":3668},{"style":618},[3669],{"type":47,"value":2463},{"type":42,"tag":611,"props":3671,"children":3672},{"style":618},[3673],{"type":47,"value":3382},{"type":42,"tag":611,"props":3675,"children":3676},{"style":624},[3677],{"type":47,"value":2279},{"type":42,"tag":611,"props":3679,"children":3680},{"style":618},[3681],{"type":47,"value":1592},{"type":42,"tag":611,"props":3683,"children":3684},{"style":634},[3685],{"type":47,"value":2250},{"type":42,"tag":611,"props":3687,"children":3688},{"style":618},[3689],{"type":47,"value":1956},{"type":42,"tag":611,"props":3691,"children":3692},{"style":634},[3693],{"type":47,"value":836},{"type":42,"tag":611,"props":3695,"children":3696},{"style":618},[3697],{"type":47,"value":2990},{"type":42,"tag":611,"props":3699,"children":3700},{"style":624},[3701],{"type":47,"value":2296},{"type":42,"tag":611,"props":3703,"children":3704},{"style":618},[3705],{"type":47,"value":1592},{"type":42,"tag":611,"props":3707,"children":3708},{"style":634},[3709],{"type":47,"value":2250},{"type":42,"tag":611,"props":3711,"children":3712},{"style":618},[3713],{"type":47,"value":1956},{"type":42,"tag":611,"props":3715,"children":3716},{"style":634},[3717],{"type":47,"value":846},{"type":42,"tag":611,"props":3719,"children":3720},{"style":618},[3721],{"type":47,"value":3016},{"type":42,"tag":611,"props":3723,"children":3724},{"style":2031},[3725],{"type":47,"value":1951},{"type":42,"tag":611,"props":3727,"children":3728},{"style":618},[3729],{"type":47,"value":1966},{"type":42,"tag":611,"props":3731,"children":3732},{"class":613,"line":1829},[3733],{"type":42,"tag":611,"props":3734,"children":3735},{"style":618},[3736],{"type":47,"value":3737},"    }\n",{"type":42,"tag":611,"props":3739,"children":3740},{"class":613,"line":1838},[3741,3745,3749],{"type":42,"tag":611,"props":3742,"children":3743},{"style":618},[3744],{"type":47,"value":2399},{"type":42,"tag":611,"props":3746,"children":3747},{"style":2031},[3748],{"type":47,"value":1951},{"type":42,"tag":611,"props":3750,"children":3751},{"style":618},[3752],{"type":47,"value":1966},{"type":42,"tag":611,"props":3754,"children":3755},{"class":613,"line":1847},[3756],{"type":42,"tag":611,"props":3757,"children":3758},{"style":618},[3759],{"type":47,"value":2531},{"type":42,"tag":611,"props":3761,"children":3762},{"class":613,"line":1856},[3763],{"type":42,"tag":611,"props":3764,"children":3765},{"emptyLinePlaceholder":1223},[3766],{"type":47,"value":1226},{"type":42,"tag":611,"props":3768,"children":3769},{"class":613,"line":1865},[3770],{"type":42,"tag":611,"props":3771,"children":3772},{"style":1214},[3773],{"type":47,"value":3774},"\u002F\u002F Generate tests for all test vectors\n",{"type":42,"tag":611,"props":3776,"children":3777},{"class":613,"line":1874},[3778,3782,3786,3791,3796,3800,3804,3808,3812,3817,3821,3825,3830,3834,3839,3844,3848],{"type":42,"tag":611,"props":3779,"children":3780},{"style":1381},[3781],{"type":47,"value":1384},{"type":42,"tag":611,"props":3783,"children":3784},{"style":634},[3785],{"type":47,"value":2409},{"type":42,"tag":611,"props":3787,"children":3788},{"style":1911},[3789],{"type":47,"value":3790},"var",{"type":42,"tag":611,"props":3792,"children":3793},{"style":634},[3794],{"type":47,"value":3795}," tcId ",{"type":42,"tag":611,"props":3797,"children":3798},{"style":618},[3799],{"type":47,"value":1239},{"type":42,"tag":611,"props":3801,"children":3802},{"style":1556},[3803],{"type":47,"value":1559},{"type":42,"tag":611,"props":3805,"children":3806},{"style":618},[3807],{"type":47,"value":1413},{"type":42,"tag":611,"props":3809,"children":3810},{"style":634},[3811],{"type":47,"value":3795},{"type":42,"tag":611,"props":3813,"children":3814},{"style":618},[3815],{"type":47,"value":3816},"\u003C",{"type":42,"tag":611,"props":3818,"children":3819},{"style":634},[3820],{"type":47,"value":2023},{"type":42,"tag":611,"props":3822,"children":3823},{"style":618},[3824],{"type":47,"value":1956},{"type":42,"tag":611,"props":3826,"children":3827},{"style":634},[3828],{"type":47,"value":3829},"length",{"type":42,"tag":611,"props":3831,"children":3832},{"style":618},[3833],{"type":47,"value":1413},{"type":42,"tag":611,"props":3835,"children":3836},{"style":634},[3837],{"type":47,"value":3838}," tcId",{"type":42,"tag":611,"props":3840,"children":3841},{"style":618},[3842],{"type":47,"value":3843},"++",{"type":42,"tag":611,"props":3845,"children":3846},{"style":634},[3847],{"type":47,"value":2419},{"type":42,"tag":611,"props":3849,"children":3850},{"style":618},[3851],{"type":47,"value":2424},{"type":42,"tag":611,"props":3853,"children":3854},{"class":613,"line":1882},[3855,3860,3864,3868,3872,3876,3880],{"type":42,"tag":611,"props":3856,"children":3857},{"style":1574},[3858],{"type":47,"value":3859},"  testFactory",{"type":42,"tag":611,"props":3861,"children":3862},{"style":2031},[3863],{"type":47,"value":1933},{"type":42,"tag":611,"props":3865,"children":3866},{"style":634},[3867],{"type":47,"value":836},{"type":42,"tag":611,"props":3869,"children":3870},{"style":618},[3871],{"type":47,"value":2463},{"type":42,"tag":611,"props":3873,"children":3874},{"style":634},[3875],{"type":47,"value":2023},{"type":42,"tag":611,"props":3877,"children":3878},{"style":2031},[3879],{"type":47,"value":1951},{"type":42,"tag":611,"props":3881,"children":3882},{"style":618},[3883],{"type":47,"value":1966},{"type":42,"tag":611,"props":3885,"children":3886},{"class":613,"line":2768},[3887],{"type":42,"tag":611,"props":3888,"children":3889},{"style":618},[3890],{"type":47,"value":2531},{"type":42,"tag":63,"props":3892,"children":3894},{"id":3893},"phase-4-ci-integration",[3895],{"type":47,"value":3896},"Phase 4: CI Integration",{"type":42,"tag":50,"props":3898,"children":3899},{},[3900],{"type":47,"value":3901},"Ensure test vectors stay up to date by:",{"type":42,"tag":3903,"props":3904,"children":3905},"ol",{},[3906,3916,3926],{"type":42,"tag":165,"props":3907,"children":3908},{},[3909,3914],{"type":42,"tag":200,"props":3910,"children":3911},{},[3912],{"type":47,"value":3913},"Using git submodules",{"type":47,"value":3915},": Update submodule in CI before running tests",{"type":42,"tag":165,"props":3917,"children":3918},{},[3919,3924],{"type":42,"tag":200,"props":3920,"children":3921},{},[3922],{"type":47,"value":3923},"Fetching latest vectors",{"type":47,"value":3925},": Run fetch script before test execution",{"type":42,"tag":165,"props":3927,"children":3928},{},[3929,3934],{"type":42,"tag":200,"props":3930,"children":3931},{},[3932],{"type":47,"value":3933},"Scheduled updates",{"type":47,"value":3935},": Set up weekly\u002Fmonthly updates to catch new test vectors",{"type":42,"tag":56,"props":3937,"children":3939},{"id":3938},"common-vulnerabilities-detected",[3940],{"type":47,"value":3941},"Common Vulnerabilities Detected",{"type":42,"tag":50,"props":3943,"children":3944},{},[3945],{"type":47,"value":3946},"Wycheproof test vectors are designed to catch specific vulnerability patterns:",{"type":42,"tag":70,"props":3948,"children":3949},{},[3950,3975],{"type":42,"tag":74,"props":3951,"children":3952},{},[3953],{"type":42,"tag":78,"props":3954,"children":3955},{},[3956,3961,3965,3970],{"type":42,"tag":82,"props":3957,"children":3958},{},[3959],{"type":47,"value":3960},"Vulnerability",{"type":42,"tag":82,"props":3962,"children":3963},{},[3964],{"type":47,"value":91},{"type":42,"tag":82,"props":3966,"children":3967},{},[3968],{"type":47,"value":3969},"Affected Algorithms",{"type":42,"tag":82,"props":3971,"children":3972},{},[3973],{"type":47,"value":3974},"Example CVE",{"type":42,"tag":93,"props":3976,"children":3977},{},[3978,4001,4023,4046,4069],{"type":42,"tag":78,"props":3979,"children":3980},{},[3981,3986,3991,3996],{"type":42,"tag":100,"props":3982,"children":3983},{},[3984],{"type":47,"value":3985},"Signature malleability",{"type":42,"tag":100,"props":3987,"children":3988},{},[3989],{"type":47,"value":3990},"Multiple valid signatures for same message",{"type":42,"tag":100,"props":3992,"children":3993},{},[3994],{"type":47,"value":3995},"ECDSA, EdDSA",{"type":42,"tag":100,"props":3997,"children":3998},{},[3999],{"type":47,"value":4000},"CVE-2024-42459",{"type":42,"tag":78,"props":4002,"children":4003},{},[4004,4009,4014,4018],{"type":42,"tag":100,"props":4005,"children":4006},{},[4007],{"type":47,"value":4008},"Invalid DER encoding",{"type":42,"tag":100,"props":4010,"children":4011},{},[4012],{"type":47,"value":4013},"Accepting non-canonical DER signatures",{"type":42,"tag":100,"props":4015,"children":4016},{},[4017],{"type":47,"value":1080},{"type":42,"tag":100,"props":4019,"children":4020},{},[4021],{"type":47,"value":4022},"CVE-2024-42460, CVE-2024-42461",{"type":42,"tag":78,"props":4024,"children":4025},{},[4026,4031,4036,4041],{"type":42,"tag":100,"props":4027,"children":4028},{},[4029],{"type":47,"value":4030},"Invalid curve attacks",{"type":42,"tag":100,"props":4032,"children":4033},{},[4034],{"type":47,"value":4035},"ECDH with invalid curve points",{"type":42,"tag":100,"props":4037,"children":4038},{},[4039],{"type":47,"value":4040},"ECDH",{"type":42,"tag":100,"props":4042,"children":4043},{},[4044],{"type":47,"value":4045},"Common in many libraries",{"type":42,"tag":78,"props":4047,"children":4048},{},[4049,4054,4059,4064],{"type":42,"tag":100,"props":4050,"children":4051},{},[4052],{"type":47,"value":4053},"Padding oracle",{"type":42,"tag":100,"props":4055,"children":4056},{},[4057],{"type":47,"value":4058},"Timing leaks in padding validation",{"type":42,"tag":100,"props":4060,"children":4061},{},[4062],{"type":47,"value":4063},"RSA-PKCS1",{"type":42,"tag":100,"props":4065,"children":4066},{},[4067],{"type":47,"value":4068},"Historical OpenSSL issues",{"type":42,"tag":78,"props":4070,"children":4071},{},[4072,4077,4082,4087],{"type":42,"tag":100,"props":4073,"children":4074},{},[4075],{"type":47,"value":4076},"Tag forgery",{"type":42,"tag":100,"props":4078,"children":4079},{},[4080],{"type":47,"value":4081},"Accepting modified authentication tags",{"type":42,"tag":100,"props":4083,"children":4084},{},[4085],{"type":47,"value":4086},"AES-GCM, ChaCha20-Poly1305",{"type":42,"tag":100,"props":4088,"children":4089},{},[4090],{"type":47,"value":4091},"Various implementations",{"type":42,"tag":63,"props":4093,"children":4095},{"id":4094},"signature-malleability-deep-dive",[4096],{"type":47,"value":4097},"Signature Malleability: Deep Dive",{"type":42,"tag":50,"props":4099,"children":4100},{},[4101,4106],{"type":42,"tag":200,"props":4102,"children":4103},{},[4104],{"type":47,"value":4105},"Problem:",{"type":47,"value":4107}," Implementations that don't validate signature encoding can accept multiple valid signatures for the same message.",{"type":42,"tag":50,"props":4109,"children":4110},{},[4111,4116],{"type":42,"tag":200,"props":4112,"children":4113},{},[4114],{"type":47,"value":4115},"Example (EdDSA):",{"type":47,"value":4117}," Appending or removing zeros from signature:",{"type":42,"tag":418,"props":4119,"children":4122},{"className":4120,"code":4121,"language":47,"meta":426},[421],"Valid signature:   ...6a5c51eb6f946b30d\nInvalid signature: ...6a5c51eb6f946b30d0000  (should be rejected)\n",[4123],{"type":42,"tag":306,"props":4124,"children":4125},{"__ignoreMap":426},[4126],{"type":47,"value":4121},{"type":42,"tag":50,"props":4128,"children":4129},{},[4130],{"type":42,"tag":200,"props":4131,"children":4132},{},[4133],{"type":47,"value":4134},"How to detect:",{"type":42,"tag":418,"props":4136,"children":4138},{"className":1663,"code":4137,"language":1665,"meta":426,"style":426},"# Add signature length check\nif len(sig) != 128:  # EdDSA signatures must be exactly 64 bytes (128 hex chars)\n    return False\n",[4139],{"type":42,"tag":306,"props":4140,"children":4141},{"__ignoreMap":426},[4142,4150,4158],{"type":42,"tag":611,"props":4143,"children":4144},{"class":613,"line":614},[4145],{"type":42,"tag":611,"props":4146,"children":4147},{},[4148],{"type":47,"value":4149},"# Add signature length check\n",{"type":42,"tag":611,"props":4151,"children":4152},{"class":613,"line":640},[4153],{"type":42,"tag":611,"props":4154,"children":4155},{},[4156],{"type":47,"value":4157},"if len(sig) != 128:  # EdDSA signatures must be exactly 64 bytes (128 hex chars)\n",{"type":42,"tag":611,"props":4159,"children":4160},{"class":613,"line":662},[4161],{"type":42,"tag":611,"props":4162,"children":4163},{},[4164],{"type":47,"value":4165},"    return False\n",{"type":42,"tag":50,"props":4167,"children":4168},{},[4169,4174],{"type":42,"tag":200,"props":4170,"children":4171},{},[4172],{"type":47,"value":4173},"Impact:",{"type":47,"value":4175}," Can lead to consensus problems when different implementations accept\u002Freject the same signatures.",{"type":42,"tag":50,"props":4177,"children":4178},{},[4179],{"type":42,"tag":200,"props":4180,"children":4181},{},[4182],{"type":47,"value":4183},"Related Wycheproof tests:",{"type":42,"tag":161,"props":4185,"children":4186},{},[4187,4192],{"type":42,"tag":165,"props":4188,"children":4189},{},[4190],{"type":47,"value":4191},"EdDSA: tcId 37 - \"removing 0 byte from signature\"",{"type":42,"tag":165,"props":4193,"children":4194},{},[4195],{"type":47,"value":4196},"ECDSA: tcId 06 - \"Legacy: ASN encoding of r misses leading 0\"",{"type":42,"tag":56,"props":4198,"children":4200},{"id":4199},"case-study-elliptic-npm-package",[4201],{"type":47,"value":4202},"Case Study: Elliptic npm Package",{"type":42,"tag":50,"props":4204,"children":4205},{},[4206],{"type":47,"value":4207},"This case study demonstrates how Wycheproof found three CVEs in the popular elliptic npm package (3000+ dependents, millions of weekly downloads).",{"type":42,"tag":63,"props":4209,"children":4211},{"id":4210},"overview",[4212],{"type":47,"value":4213},"Overview",{"type":42,"tag":50,"props":4215,"children":4216},{},[4217,4218,4227],{"type":47,"value":880},{"type":42,"tag":4219,"props":4220,"children":4224},"a",{"href":4221,"rel":4222},"https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Felliptic",[4223],"nofollow",[4225],{"type":47,"value":4226},"elliptic",{"type":47,"value":4228}," library is an elliptic-curve cryptography library written in JavaScript, supporting ECDH, ECDSA, and EdDSA. Using Wycheproof test vectors on version 6.5.6 revealed multiple vulnerabilities:",{"type":42,"tag":161,"props":4230,"children":4231},{},[4232,4241,4251],{"type":42,"tag":165,"props":4233,"children":4234},{},[4235,4239],{"type":42,"tag":200,"props":4236,"children":4237},{},[4238],{"type":47,"value":4000},{"type":47,"value":4240},": EdDSA signature malleability (appending\u002Fremoving zeros)",{"type":42,"tag":165,"props":4242,"children":4243},{},[4244,4249],{"type":42,"tag":200,"props":4245,"children":4246},{},[4247],{"type":47,"value":4248},"CVE-2024-42460",{"type":47,"value":4250},": ECDSA DER encoding - invalid bit placement",{"type":42,"tag":165,"props":4252,"children":4253},{},[4254,4259],{"type":42,"tag":200,"props":4255,"children":4256},{},[4257],{"type":47,"value":4258},"CVE-2024-42461",{"type":47,"value":4260},": ECDSA DER encoding - leading zero in length field",{"type":42,"tag":63,"props":4262,"children":4264},{"id":4263},"methodology",[4265],{"type":47,"value":4266},"Methodology",{"type":42,"tag":3903,"props":4268,"children":4269},{},[4270,4280,4296,4306,4316,4326,4336],{"type":42,"tag":165,"props":4271,"children":4272},{},[4273,4278],{"type":42,"tag":200,"props":4274,"children":4275},{},[4276],{"type":47,"value":4277},"Identify supported curves",{"type":47,"value":4279},": ed25519 for EdDSA",{"type":42,"tag":165,"props":4281,"children":4282},{},[4283,4288,4290],{"type":42,"tag":200,"props":4284,"children":4285},{},[4286],{"type":47,"value":4287},"Find test vectors",{"type":47,"value":4289},": ",{"type":42,"tag":306,"props":4291,"children":4293},{"className":4292},[],[4294],{"type":47,"value":4295},"testvectors_v1\u002Fed25519_test.json",{"type":42,"tag":165,"props":4297,"children":4298},{},[4299,4304],{"type":42,"tag":200,"props":4300,"children":4301},{},[4302],{"type":47,"value":4303},"Parse test vectors",{"type":47,"value":4305},": Load JSON and extract tests",{"type":42,"tag":165,"props":4307,"children":4308},{},[4309,4314],{"type":42,"tag":200,"props":4310,"children":4311},{},[4312],{"type":47,"value":4313},"Write test harness",{"type":47,"value":4315},": Create parameterized tests",{"type":42,"tag":165,"props":4317,"children":4318},{},[4319,4324],{"type":42,"tag":200,"props":4320,"children":4321},{},[4322],{"type":47,"value":4323},"Run tests",{"type":47,"value":4325},": Identify failures",{"type":42,"tag":165,"props":4327,"children":4328},{},[4329,4334],{"type":42,"tag":200,"props":4330,"children":4331},{},[4332],{"type":47,"value":4333},"Analyze root causes",{"type":47,"value":4335},": Examine implementation code",{"type":42,"tag":165,"props":4337,"children":4338},{},[4339,4344],{"type":42,"tag":200,"props":4340,"children":4341},{},[4342],{"type":47,"value":4343},"Propose fixes",{"type":47,"value":4345},": Add validation checks",{"type":42,"tag":63,"props":4347,"children":4349},{"id":4348},"key-findings",[4350],{"type":47,"value":4351},"Key Findings",{"type":42,"tag":50,"props":4353,"children":4354},{},[4355],{"type":42,"tag":200,"props":4356,"children":4357},{},[4358],{"type":47,"value":4359},"EdDSA Issue (CVE-2024-42459):",{"type":42,"tag":161,"props":4361,"children":4362},{},[4363,4368,4373],{"type":42,"tag":165,"props":4364,"children":4365},{},[4366],{"type":47,"value":4367},"Missing signature length validation",{"type":42,"tag":165,"props":4369,"children":4370},{},[4371],{"type":47,"value":4372},"Allowed trailing zeros in signatures",{"type":42,"tag":165,"props":4374,"children":4375},{},[4376,4378],{"type":47,"value":4377},"Fix: Add ",{"type":42,"tag":306,"props":4379,"children":4381},{"className":4380},[],[4382],{"type":47,"value":4383},"if(sig.length !== 128) return false;",{"type":42,"tag":50,"props":4385,"children":4386},{},[4387],{"type":42,"tag":200,"props":4388,"children":4389},{},[4390],{"type":47,"value":4391},"ECDSA Issue 1 (CVE-2024-42460):",{"type":42,"tag":161,"props":4393,"children":4394},{},[4395,4400],{"type":42,"tag":165,"props":4396,"children":4397},{},[4398],{"type":47,"value":4399},"Missing check for first bit being zero in DER-encoded r and s values",{"type":42,"tag":165,"props":4401,"children":4402},{},[4403,4404],{"type":47,"value":4377},{"type":42,"tag":306,"props":4405,"children":4407},{"className":4406},[],[4408],{"type":47,"value":4409},"if ((data[p.place] & 128) !== 0) return false;",{"type":42,"tag":50,"props":4411,"children":4412},{},[4413],{"type":42,"tag":200,"props":4414,"children":4415},{},[4416],{"type":47,"value":4417},"ECDSA Issue 2 (CVE-2024-42461):",{"type":42,"tag":161,"props":4419,"children":4420},{},[4421,4426],{"type":42,"tag":165,"props":4422,"children":4423},{},[4424],{"type":47,"value":4425},"DER length field accepted leading zeros",{"type":42,"tag":165,"props":4427,"children":4428},{},[4429,4430],{"type":47,"value":4377},{"type":42,"tag":306,"props":4431,"children":4433},{"className":4432},[],[4434],{"type":47,"value":4435},"if(buf[p.place] === 0x00) return false;",{"type":42,"tag":63,"props":4437,"children":4439},{"id":4438},"impact",[4440],{"type":47,"value":4441},"Impact",{"type":42,"tag":50,"props":4443,"children":4444},{},[4445],{"type":47,"value":4446},"All three vulnerabilities allowed multiple valid signatures for a single message, leading to consensus problems across implementations.",{"type":42,"tag":50,"props":4448,"children":4449},{},[4450],{"type":42,"tag":200,"props":4451,"children":4452},{},[4453],{"type":47,"value":4454},"Lessons learned:",{"type":42,"tag":161,"props":4456,"children":4457},{},[4458,4463,4468,4473],{"type":42,"tag":165,"props":4459,"children":4460},{},[4461],{"type":47,"value":4462},"Wycheproof catches subtle encoding bugs",{"type":42,"tag":165,"props":4464,"children":4465},{},[4466],{"type":47,"value":4467},"Reusable test harnesses pay dividends",{"type":42,"tag":165,"props":4469,"children":4470},{},[4471],{"type":47,"value":4472},"Test vector comments and flags help diagnose issues",{"type":42,"tag":165,"props":4474,"children":4475},{},[4476],{"type":47,"value":4477},"Even popular libraries benefit from systematic test vector validation",{"type":42,"tag":56,"props":4479,"children":4481},{"id":4480},"advanced-usage",[4482],{"type":47,"value":4483},"Advanced Usage",{"type":42,"tag":63,"props":4485,"children":4487},{"id":4486},"tips-and-tricks",[4488],{"type":47,"value":4489},"Tips and Tricks",{"type":42,"tag":70,"props":4491,"children":4492},{},[4493,4509],{"type":42,"tag":74,"props":4494,"children":4495},{},[4496],{"type":42,"tag":78,"props":4497,"children":4498},{},[4499,4504],{"type":42,"tag":82,"props":4500,"children":4501},{},[4502],{"type":47,"value":4503},"Tip",{"type":42,"tag":82,"props":4505,"children":4506},{},[4507],{"type":47,"value":4508},"Why It Helps",{"type":42,"tag":93,"props":4510,"children":4511},{},[4512,4525,4538,4558,4571,4584],{"type":42,"tag":78,"props":4513,"children":4514},{},[4515,4520],{"type":42,"tag":100,"props":4516,"children":4517},{},[4518],{"type":47,"value":4519},"Filter test groups by parameters",{"type":42,"tag":100,"props":4521,"children":4522},{},[4523],{"type":47,"value":4524},"Focus on test vectors relevant to your implementation constraints",{"type":42,"tag":78,"props":4526,"children":4527},{},[4528,4533],{"type":42,"tag":100,"props":4529,"children":4530},{},[4531],{"type":47,"value":4532},"Use test vector flags",{"type":42,"tag":100,"props":4534,"children":4535},{},[4536],{"type":47,"value":4537},"Understand specific vulnerability patterns being tested",{"type":42,"tag":78,"props":4539,"children":4540},{},[4541,4553],{"type":42,"tag":100,"props":4542,"children":4543},{},[4544,4546,4551],{"type":47,"value":4545},"Check the ",{"type":42,"tag":306,"props":4547,"children":4549},{"className":4548},[],[4550],{"type":47,"value":738},{"type":47,"value":4552}," field",{"type":42,"tag":100,"props":4554,"children":4555},{},[4556],{"type":47,"value":4557},"Get detailed explanations of flag meanings",{"type":42,"tag":78,"props":4559,"children":4560},{},[4561,4566],{"type":42,"tag":100,"props":4562,"children":4563},{},[4564],{"type":47,"value":4565},"Test both encrypt\u002Fdecrypt and sign\u002Fverify",{"type":42,"tag":100,"props":4567,"children":4568},{},[4569],{"type":47,"value":4570},"Ensure bidirectional correctness",{"type":42,"tag":78,"props":4572,"children":4573},{},[4574,4579],{"type":42,"tag":100,"props":4575,"children":4576},{},[4577],{"type":47,"value":4578},"Run tests in CI",{"type":42,"tag":100,"props":4580,"children":4581},{},[4582],{"type":47,"value":4583},"Catch regressions and benefit from new test vectors",{"type":42,"tag":78,"props":4585,"children":4586},{},[4587,4592],{"type":42,"tag":100,"props":4588,"children":4589},{},[4590],{"type":47,"value":4591},"Use parameterized tests",{"type":42,"tag":100,"props":4593,"children":4594},{},[4595],{"type":47,"value":4596},"Get clear failure messages with tcId and comment",{"type":42,"tag":63,"props":4598,"children":4600},{"id":4599},"common-mistakes",[4601],{"type":47,"value":4602},"Common Mistakes",{"type":42,"tag":70,"props":4604,"children":4605},{},[4606,4627],{"type":42,"tag":74,"props":4607,"children":4608},{},[4609],{"type":42,"tag":78,"props":4610,"children":4611},{},[4612,4617,4622],{"type":42,"tag":82,"props":4613,"children":4614},{},[4615],{"type":47,"value":4616},"Mistake",{"type":42,"tag":82,"props":4618,"children":4619},{},[4620],{"type":47,"value":4621},"Why It's Wrong",{"type":42,"tag":82,"props":4623,"children":4624},{},[4625],{"type":47,"value":4626},"Correct Approach",{"type":42,"tag":93,"props":4628,"children":4629},{},[4630,4648,4666,4684,4702],{"type":42,"tag":78,"props":4631,"children":4632},{},[4633,4638,4643],{"type":42,"tag":100,"props":4634,"children":4635},{},[4636],{"type":47,"value":4637},"Only testing valid cases",{"type":42,"tag":100,"props":4639,"children":4640},{},[4641],{"type":47,"value":4642},"Misses vulnerabilities where invalid inputs are accepted",{"type":42,"tag":100,"props":4644,"children":4645},{},[4646],{"type":47,"value":4647},"Test all result types: valid, invalid, acceptable",{"type":42,"tag":78,"props":4649,"children":4650},{},[4651,4656,4661],{"type":42,"tag":100,"props":4652,"children":4653},{},[4654],{"type":47,"value":4655},"Ignoring \"acceptable\" result",{"type":42,"tag":100,"props":4657,"children":4658},{},[4659],{"type":47,"value":4660},"Implementation might have subtle bugs",{"type":42,"tag":100,"props":4662,"children":4663},{},[4664],{"type":47,"value":4665},"Treat acceptable as warnings worth investigating",{"type":42,"tag":78,"props":4667,"children":4668},{},[4669,4674,4679],{"type":42,"tag":100,"props":4670,"children":4671},{},[4672],{"type":47,"value":4673},"Not filtering test groups",{"type":42,"tag":100,"props":4675,"children":4676},{},[4677],{"type":47,"value":4678},"Wastes time on unsupported parameters",{"type":42,"tag":100,"props":4680,"children":4681},{},[4682],{"type":47,"value":4683},"Filter by keySize, ivSize, etc. based on your implementation",{"type":42,"tag":78,"props":4685,"children":4686},{},[4687,4692,4697],{"type":42,"tag":100,"props":4688,"children":4689},{},[4690],{"type":47,"value":4691},"Not updating test vectors",{"type":42,"tag":100,"props":4693,"children":4694},{},[4695],{"type":47,"value":4696},"Miss new vulnerability patterns",{"type":42,"tag":100,"props":4698,"children":4699},{},[4700],{"type":47,"value":4701},"Use submodules or scheduled fetches",{"type":42,"tag":78,"props":4703,"children":4704},{},[4705,4710,4715],{"type":42,"tag":100,"props":4706,"children":4707},{},[4708],{"type":47,"value":4709},"Testing only one direction",{"type":42,"tag":100,"props":4711,"children":4712},{},[4713],{"type":47,"value":4714},"Encrypt\u002Fsign might work but decrypt\u002Fverify fails",{"type":42,"tag":100,"props":4716,"children":4717},{},[4718],{"type":47,"value":4719},"Test both operations",{"type":42,"tag":56,"props":4721,"children":4723},{"id":4722},"related-skills",[4724],{"type":47,"value":4725},"Related Skills",{"type":42,"tag":63,"props":4727,"children":4729},{"id":4728},"tool-skills",[4730],{"type":47,"value":4731},"Tool Skills",{"type":42,"tag":70,"props":4733,"children":4734},{},[4735,4751],{"type":42,"tag":74,"props":4736,"children":4737},{},[4738],{"type":42,"tag":78,"props":4739,"children":4740},{},[4741,4746],{"type":42,"tag":82,"props":4742,"children":4743},{},[4744],{"type":47,"value":4745},"Skill",{"type":42,"tag":82,"props":4747,"children":4748},{},[4749],{"type":47,"value":4750},"Primary Use in Wycheproof Testing",{"type":42,"tag":93,"props":4752,"children":4753},{},[4754,4770,4786,4802],{"type":42,"tag":78,"props":4755,"children":4756},{},[4757,4765],{"type":42,"tag":100,"props":4758,"children":4759},{},[4760],{"type":42,"tag":200,"props":4761,"children":4762},{},[4763],{"type":47,"value":4764},"pytest",{"type":42,"tag":100,"props":4766,"children":4767},{},[4768],{"type":47,"value":4769},"Python testing framework for parameterized tests",{"type":42,"tag":78,"props":4771,"children":4772},{},[4773,4781],{"type":42,"tag":100,"props":4774,"children":4775},{},[4776],{"type":42,"tag":200,"props":4777,"children":4778},{},[4779],{"type":47,"value":4780},"mocha",{"type":42,"tag":100,"props":4782,"children":4783},{},[4784],{"type":47,"value":4785},"JavaScript testing framework for test generation",{"type":42,"tag":78,"props":4787,"children":4788},{},[4789,4797],{"type":42,"tag":100,"props":4790,"children":4791},{},[4792],{"type":42,"tag":200,"props":4793,"children":4794},{},[4795],{"type":47,"value":4796},"constant-time-testing",{"type":42,"tag":100,"props":4798,"children":4799},{},[4800],{"type":47,"value":4801},"Complement Wycheproof with timing side-channel testing",{"type":42,"tag":78,"props":4803,"children":4804},{},[4805,4813],{"type":42,"tag":100,"props":4806,"children":4807},{},[4808],{"type":42,"tag":200,"props":4809,"children":4810},{},[4811],{"type":47,"value":4812},"cryptofuzz",{"type":42,"tag":100,"props":4814,"children":4815},{},[4816],{"type":47,"value":4817},"Fuzz-based crypto testing to find additional bugs",{"type":42,"tag":63,"props":4819,"children":4821},{"id":4820},"technique-skills",[4822],{"type":47,"value":4823},"Technique Skills",{"type":42,"tag":70,"props":4825,"children":4826},{},[4827,4842],{"type":42,"tag":74,"props":4828,"children":4829},{},[4830],{"type":42,"tag":78,"props":4831,"children":4832},{},[4833,4837],{"type":42,"tag":82,"props":4834,"children":4835},{},[4836],{"type":47,"value":4745},{"type":42,"tag":82,"props":4838,"children":4839},{},[4840],{"type":47,"value":4841},"When to Apply",{"type":42,"tag":93,"props":4843,"children":4844},{},[4845,4861,4877],{"type":42,"tag":78,"props":4846,"children":4847},{},[4848,4856],{"type":42,"tag":100,"props":4849,"children":4850},{},[4851],{"type":42,"tag":200,"props":4852,"children":4853},{},[4854],{"type":47,"value":4855},"coverage-analysis",{"type":42,"tag":100,"props":4857,"children":4858},{},[4859],{"type":47,"value":4860},"Ensure test vectors cover all code paths in crypto implementation",{"type":42,"tag":78,"props":4862,"children":4863},{},[4864,4872],{"type":42,"tag":100,"props":4865,"children":4866},{},[4867],{"type":42,"tag":200,"props":4868,"children":4869},{},[4870],{"type":47,"value":4871},"property-based-testing",{"type":42,"tag":100,"props":4873,"children":4874},{},[4875],{"type":47,"value":4876},"Test mathematical properties (e.g., encrypt\u002Fdecrypt round-trip)",{"type":42,"tag":78,"props":4878,"children":4879},{},[4880,4888],{"type":42,"tag":100,"props":4881,"children":4882},{},[4883],{"type":42,"tag":200,"props":4884,"children":4885},{},[4886],{"type":47,"value":4887},"fuzz-harness-writing",{"type":42,"tag":100,"props":4889,"children":4890},{},[4891],{"type":47,"value":4892},"Create harnesses for crypto parsers (complements Wycheproof)",{"type":42,"tag":63,"props":4894,"children":4896},{"id":4895},"related-domain-skills",[4897],{"type":47,"value":4898},"Related Domain Skills",{"type":42,"tag":70,"props":4900,"children":4901},{},[4902,4917],{"type":42,"tag":74,"props":4903,"children":4904},{},[4905],{"type":42,"tag":78,"props":4906,"children":4907},{},[4908,4912],{"type":42,"tag":82,"props":4909,"children":4910},{},[4911],{"type":47,"value":4745},{"type":42,"tag":82,"props":4913,"children":4914},{},[4915],{"type":47,"value":4916},"Relationship",{"type":42,"tag":93,"props":4918,"children":4919},{},[4920,4936],{"type":42,"tag":78,"props":4921,"children":4922},{},[4923,4931],{"type":42,"tag":100,"props":4924,"children":4925},{},[4926],{"type":42,"tag":200,"props":4927,"children":4928},{},[4929],{"type":47,"value":4930},"crypto-testing",{"type":42,"tag":100,"props":4932,"children":4933},{},[4934],{"type":47,"value":4935},"Wycheproof is a key tool in comprehensive crypto testing methodology",{"type":42,"tag":78,"props":4937,"children":4938},{},[4939,4947],{"type":42,"tag":100,"props":4940,"children":4941},{},[4942],{"type":42,"tag":200,"props":4943,"children":4944},{},[4945],{"type":47,"value":4946},"fuzzing",{"type":42,"tag":100,"props":4948,"children":4949},{},[4950],{"type":47,"value":4951},"Use fuzzing to find bugs Wycheproof doesn't cover (new edge cases)",{"type":42,"tag":56,"props":4953,"children":4955},{"id":4954},"skill-dependency-map",[4956],{"type":47,"value":4957},"Skill Dependency Map",{"type":42,"tag":418,"props":4959,"children":4962},{"className":4960,"code":4961,"language":47},[421],"                    ┌─────────────────────┐\n                    │    wycheproof       │\n                    │   (this skill)      │\n                    └──────────┬──────────┘\n                               │\n           ┌───────────────────┼───────────────────┐\n           │                   │                   │\n           ▼                   ▼                   ▼\n┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐\n│  pytest\u002Fmocha   │ │ constant-time   │ │   cryptofuzz    │\n│ (test framework)│ │   testing       │ │   (fuzzing)     │\n└────────┬────────┘ └────────┬────────┘ └────────┬────────┘\n         │                   │                   │\n         └───────────────────┼───────────────────┘\n                             │\n                             ▼\n              ┌──────────────────────────┐\n              │   Technique Skills       │\n              │ coverage, harness, PBT   │\n              └──────────────────────────┘\n",[4963],{"type":42,"tag":306,"props":4964,"children":4965},{"__ignoreMap":426},[4966],{"type":47,"value":4961},{"type":42,"tag":56,"props":4968,"children":4970},{"id":4969},"resources",[4971],{"type":47,"value":4972},"Resources",{"type":42,"tag":63,"props":4974,"children":4976},{"id":4975},"official-repository",[4977],{"type":47,"value":4978},"Official Repository",{"type":42,"tag":50,"props":4980,"children":4981},{},[4982],{"type":42,"tag":200,"props":4983,"children":4984},{},[4985],{"type":42,"tag":4219,"props":4986,"children":4989},{"href":4987,"rel":4988},"https:\u002F\u002Fgithub.com\u002FC2SP\u002Fwycheproof",[4223],[4990],{"type":47,"value":4991},"Wycheproof GitHub Repository",{"type":42,"tag":50,"props":4993,"children":4994},{},[4995],{"type":47,"value":4996},"The official repository contains:",{"type":42,"tag":161,"props":4998,"children":4999},{},[5000,5018,5029,5034],{"type":42,"tag":165,"props":5001,"children":5002},{},[5003,5005,5011,5012],{"type":47,"value":5004},"All test vectors in ",{"type":42,"tag":306,"props":5006,"children":5008},{"className":5007},[],[5009],{"type":47,"value":5010},"testvectors\u002F",{"type":47,"value":461},{"type":42,"tag":306,"props":5013,"children":5015},{"className":5014},[],[5016],{"type":47,"value":5017},"testvectors_v1\u002F",{"type":42,"tag":165,"props":5019,"children":5020},{},[5021,5023],{"type":47,"value":5022},"JSON schemas in ",{"type":42,"tag":306,"props":5024,"children":5026},{"className":5025},[],[5027],{"type":47,"value":5028},"schemas\u002F",{"type":42,"tag":165,"props":5030,"children":5031},{},[5032],{"type":47,"value":5033},"Reference implementations in Java and JavaScript",{"type":42,"tag":165,"props":5035,"children":5036},{},[5037,5039],{"type":47,"value":5038},"Documentation in ",{"type":42,"tag":306,"props":5040,"children":5042},{"className":5041},[],[5043],{"type":47,"value":5044},"doc\u002F",{"type":42,"tag":63,"props":5046,"children":5048},{"id":5047},"real-world-examples",[5049],{"type":47,"value":5050},"Real-World Examples",{"type":42,"tag":50,"props":5052,"children":5053},{},[5054],{"type":42,"tag":200,"props":5055,"children":5056},{},[5057],{"type":42,"tag":4219,"props":5058,"children":5061},{"href":5059,"rel":5060},"https:\u002F\u002Fpypi.org\u002Fproject\u002Fpycryptodome\u002F",[4223],[5062],{"type":47,"value":5063},"pycryptodome",{"type":42,"tag":50,"props":5065,"children":5066},{},[5067],{"type":47,"value":5068},"The pycryptodome library integrates Wycheproof test vectors in their test suite, demonstrating best practices for Python crypto implementations.",{"type":42,"tag":63,"props":5070,"children":5072},{"id":5071},"community-resources",[5073],{"type":47,"value":5074},"Community Resources",{"type":42,"tag":161,"props":5076,"children":5077},{},[5078,5090],{"type":42,"tag":165,"props":5079,"children":5080},{},[5081,5088],{"type":42,"tag":4219,"props":5082,"children":5085},{"href":5083,"rel":5084},"https:\u002F\u002Fc2sp.org\u002F",[4223],[5086],{"type":47,"value":5087},"C2SP Community",{"type":47,"value":5089}," - Cryptographic specifications and standards community maintaining Wycheproof",{"type":42,"tag":165,"props":5091,"children":5092},{},[5093],{"type":47,"value":5094},"Wycheproof issues tracker - Report bugs in test vectors or suggest new constructions",{"type":42,"tag":56,"props":5096,"children":5098},{"id":5097},"summary",[5099],{"type":47,"value":5100},"Summary",{"type":42,"tag":50,"props":5102,"children":5103},{},[5104],{"type":47,"value":5105},"Wycheproof is an essential tool for validating cryptographic implementations against known attack vectors and edge cases. By integrating Wycheproof test vectors into your testing workflow:",{"type":42,"tag":3903,"props":5107,"children":5108},{},[5109,5114,5119,5124,5129],{"type":42,"tag":165,"props":5110,"children":5111},{},[5112],{"type":47,"value":5113},"Catch subtle encoding and validation bugs",{"type":42,"tag":165,"props":5115,"children":5116},{},[5117],{"type":47,"value":5118},"Prevent signature malleability issues",{"type":42,"tag":165,"props":5120,"children":5121},{},[5122],{"type":47,"value":5123},"Ensure consistent behavior across implementations",{"type":42,"tag":165,"props":5125,"children":5126},{},[5127],{"type":47,"value":5128},"Benefit from community-contributed test vectors",{"type":42,"tag":165,"props":5130,"children":5131},{},[5132],{"type":47,"value":5133},"Protect against known cryptographic vulnerabilities",{"type":42,"tag":50,"props":5135,"children":5136},{},[5137],{"type":47,"value":5138},"The investment in writing a reusable testing harness pays dividends through continuous validation as new test vectors are added to the Wycheproof repository.",{"type":42,"tag":5140,"props":5141,"children":5142},"style",{},[5143],{"type":47,"value":5144},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"items":5146,"total":5299},[5147,5162,5172,5192,5207,5220,5231,5241,5254,5265,5277,5288],{"slug":5148,"name":5148,"fn":5149,"description":5150,"org":5151,"tags":5152,"stars":23,"repoUrl":24,"updatedAt":5161},"address-sanitizer","detect memory errors during fuzzing","AddressSanitizer detects memory errors during fuzzing. Use when fuzzing C\u002FC++ code to find buffer overflows and use-after-free bugs.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[5153,5156,5159,5160],{"name":5154,"slug":5155,"type":16},"C#","c",{"name":5157,"slug":5158,"type":16},"Debugging","debugging",{"name":14,"slug":15,"type":16},{"name":21,"slug":22,"type":16},"2026-07-17T06:05:14.925095",{"slug":5163,"name":5163,"fn":5164,"description":5165,"org":5166,"tags":5167,"stars":23,"repoUrl":24,"updatedAt":5171},"aflpp","perform multi-core fuzzing of C\u002FC++ projects","AFL++ is a fork of AFL with better fuzzing performance and advanced features. Use for multi-core fuzzing of C\u002FC++ projects.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[5168,5169,5170],{"name":5154,"slug":5155,"type":16},{"name":14,"slug":15,"type":16},{"name":21,"slug":22,"type":16},"2026-07-17T06:05:12.433192",{"slug":5173,"name":5173,"fn":5174,"description":5175,"org":5176,"tags":5177,"stars":23,"repoUrl":24,"updatedAt":5191},"agentic-actions-auditor","audit GitHub Actions for security vulnerabilities","Audits GitHub Actions workflows for security vulnerabilities in AI agent integrations including Claude Code Action, Gemini CLI, OpenAI Codex, and GitHub AI Inference. Detects attack vectors where attacker-controlled input reaches AI agents running in CI\u002FCD pipelines, including env var intermediary patterns, direct expression injection, dangerous sandbox configurations, and wildcard user allowlists. Use when reviewing workflow files that invoke AI coding agents, auditing CI\u002FCD pipeline security for prompt injection risks, or evaluating agentic action configurations.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[5178,5181,5184,5187,5190],{"name":5179,"slug":5180,"type":16},"Agents","agents",{"name":5182,"slug":5183,"type":16},"CI\u002FCD","ci-cd",{"name":5185,"slug":5186,"type":16},"Code Analysis","code-analysis",{"name":5188,"slug":5189,"type":16},"GitHub Actions","github-actions",{"name":14,"slug":15,"type":16},"2026-07-18T05:47:48.564744",{"slug":5193,"name":5193,"fn":5194,"description":5195,"org":5196,"tags":5197,"stars":23,"repoUrl":24,"updatedAt":5206},"algorand-vulnerability-scanner","scan Algorand smart contracts for vulnerabilities","Scans Algorand smart contracts for 11 common vulnerabilities including rekeying attacks, unchecked transaction fees, missing field validations, and access control issues. Use when auditing Algorand projects (TEAL\u002FPyTeal).",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[5198,5201,5202,5203],{"name":5199,"slug":5200,"type":16},"Audit","audit",{"name":5185,"slug":5186,"type":16},{"name":14,"slug":15,"type":16},{"name":5204,"slug":5205,"type":16},"Smart Contracts","smart-contracts","2026-07-18T05:47:43.989063",{"slug":5208,"name":5208,"fn":5209,"description":5210,"org":5211,"tags":5212,"stars":23,"repoUrl":24,"updatedAt":5219},"ask-questions-if-underspecified","clarify requirements before implementation","Clarify requirements before implementing. Use when serious doubts arise.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[5213,5216],{"name":5214,"slug":5215,"type":16},"Engineering","engineering",{"name":5217,"slug":5218,"type":16},"Productivity","productivity","2026-07-17T06:05:33.543262",{"slug":5221,"name":5221,"fn":5222,"description":5223,"org":5224,"tags":5225,"stars":23,"repoUrl":24,"updatedAt":5230},"atheris","fuzz Python code with Atheris","Atheris is a coverage-guided Python fuzzer based on libFuzzer. Use for fuzzing pure Python code and Python C extensions.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[5226,5228,5229],{"name":5227,"slug":1665,"type":16},"Python",{"name":14,"slug":15,"type":16},{"name":21,"slug":22,"type":16},"2026-07-17T06:05:14.575191",{"slug":5232,"name":5232,"fn":5233,"description":5234,"org":5235,"tags":5236,"stars":23,"repoUrl":24,"updatedAt":5240},"audit-augmentation","augment code graphs with audit findings","Augments Trailmark code graphs with external audit findings from SARIF static analysis results, weAudit annotation files, and version-gated Trailmark 0.4.x binary-analysis graph exports. Maps findings to graph nodes by file and line overlap, creates severity-based subgraphs, and enables cross-referencing findings with pre-analysis data (blast radius, taint, etc.). Use when projecting SARIF results onto a code graph, overlaying weAudit annotations, importing binary graph findings, cross-referencing Semgrep, CodeQL, or binary-analysis findings with call graph data, or visualizing audit findings in the context of code structure.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[5237,5238,5239],{"name":5199,"slug":5200,"type":16},{"name":5185,"slug":5186,"type":16},{"name":14,"slug":15,"type":16},"2026-08-01T05:44:54.920542",{"slug":5242,"name":5242,"fn":5243,"description":5244,"org":5245,"tags":5246,"stars":23,"repoUrl":24,"updatedAt":5253},"audit-context-building","build architectural context for code analysis","Enables ultra-granular, line-by-line code analysis to build deep architectural context before vulnerability or bug finding.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[5247,5250,5251,5252],{"name":5248,"slug":5249,"type":16},"Architecture","architecture",{"name":5199,"slug":5200,"type":16},{"name":5185,"slug":5186,"type":16},{"name":5214,"slug":5215,"type":16},"2026-07-18T05:47:40.122449",{"slug":5255,"name":5255,"fn":5256,"description":5257,"org":5258,"tags":5259,"stars":23,"repoUrl":24,"updatedAt":5264},"audit-prep-assistant","prepare codebases for security audits","Prepares codebases for security review using Trail of Bits' checklist. Helps set review goals, runs static analysis tools, increases test coverage, removes dead code, ensures accessibility, and generates documentation (flowcharts, user stories, inline comments).",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[5260,5261,5262,5263],{"name":5199,"slug":5200,"type":16},{"name":5185,"slug":5186,"type":16},{"name":5214,"slug":5215,"type":16},{"name":14,"slug":15,"type":16},"2026-07-18T05:47:39.210985",{"slug":5266,"name":5266,"fn":5267,"description":5268,"org":5269,"tags":5270,"stars":23,"repoUrl":24,"updatedAt":5276},"burpsuite-project-parser","parse Burp Suite project files","Searches and explores Burp Suite project files (.burp) from the command line. Use when searching response headers or bodies with regex patterns, extracting security audit findings, dumping proxy history or site map data, or analyzing HTTP traffic captured in a Burp project.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[5271,5272,5275],{"name":5199,"slug":5200,"type":16},{"name":5273,"slug":5274,"type":16},"CLI","cli",{"name":14,"slug":15,"type":16},"2026-07-17T06:05:33.198077",{"slug":5278,"name":5278,"fn":5279,"description":5280,"org":5281,"tags":5282,"stars":23,"repoUrl":24,"updatedAt":5287},"c-review","audit C and C++ code","Performs comprehensive C\u002FC++ security review for memory corruption, integer overflows, race conditions, and platform-specific vulnerabilities. Use when auditing native C\u002FC++ applications, reviewing daemons or services for memory safety, or hunting integer overflow \u002F use-after-free \u002F race conditions in userspace code.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[5283,5284,5285,5286],{"name":5199,"slug":5200,"type":16},{"name":5154,"slug":5155,"type":16},{"name":5185,"slug":5186,"type":16},{"name":14,"slug":15,"type":16},"2026-07-17T06:05:11.333374",{"slug":5289,"name":5289,"fn":5290,"description":5291,"org":5292,"tags":5293,"stars":23,"repoUrl":24,"updatedAt":5298},"cairo-vulnerability-scanner","scan Cairo and StarkNet contracts for vulnerabilities","Scans Cairo\u002FStarkNet smart contracts for 6 critical vulnerabilities including felt252 arithmetic overflow, L1-L2 messaging issues, address conversion problems, and signature replay. Use when auditing StarkNet projects.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[5294,5295,5296,5297],{"name":5199,"slug":5200,"type":16},{"name":5185,"slug":5186,"type":16},{"name":14,"slug":15,"type":16},{"name":5204,"slug":5205,"type":16},"2026-07-18T05:47:42.84568",111,{"items":5301,"total":5347},[5302,5309,5315,5323,5330,5335,5341],{"slug":5148,"name":5148,"fn":5149,"description":5150,"org":5303,"tags":5304,"stars":23,"repoUrl":24,"updatedAt":5161},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[5305,5306,5307,5308],{"name":5154,"slug":5155,"type":16},{"name":5157,"slug":5158,"type":16},{"name":14,"slug":15,"type":16},{"name":21,"slug":22,"type":16},{"slug":5163,"name":5163,"fn":5164,"description":5165,"org":5310,"tags":5311,"stars":23,"repoUrl":24,"updatedAt":5171},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[5312,5313,5314],{"name":5154,"slug":5155,"type":16},{"name":14,"slug":15,"type":16},{"name":21,"slug":22,"type":16},{"slug":5173,"name":5173,"fn":5174,"description":5175,"org":5316,"tags":5317,"stars":23,"repoUrl":24,"updatedAt":5191},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[5318,5319,5320,5321,5322],{"name":5179,"slug":5180,"type":16},{"name":5182,"slug":5183,"type":16},{"name":5185,"slug":5186,"type":16},{"name":5188,"slug":5189,"type":16},{"name":14,"slug":15,"type":16},{"slug":5193,"name":5193,"fn":5194,"description":5195,"org":5324,"tags":5325,"stars":23,"repoUrl":24,"updatedAt":5206},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[5326,5327,5328,5329],{"name":5199,"slug":5200,"type":16},{"name":5185,"slug":5186,"type":16},{"name":14,"slug":15,"type":16},{"name":5204,"slug":5205,"type":16},{"slug":5208,"name":5208,"fn":5209,"description":5210,"org":5331,"tags":5332,"stars":23,"repoUrl":24,"updatedAt":5219},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[5333,5334],{"name":5214,"slug":5215,"type":16},{"name":5217,"slug":5218,"type":16},{"slug":5221,"name":5221,"fn":5222,"description":5223,"org":5336,"tags":5337,"stars":23,"repoUrl":24,"updatedAt":5230},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[5338,5339,5340],{"name":5227,"slug":1665,"type":16},{"name":14,"slug":15,"type":16},{"name":21,"slug":22,"type":16},{"slug":5232,"name":5232,"fn":5233,"description":5234,"org":5342,"tags":5343,"stars":23,"repoUrl":24,"updatedAt":5240},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[5344,5345,5346],{"name":5199,"slug":5200,"type":16},{"name":5185,"slug":5186,"type":16},{"name":14,"slug":15,"type":16},77]