{"id":43730528,"url":"https://github.com/vixcpp/crypto","last_synced_at":"2026-05-25T07:00:55.613Z","repository":{"id":336612659,"uuid":"1150358501","full_name":"vixcpp/crypto","owner":"vixcpp","description":"Modern cryptography primitives for Vix. Explicit, auditable, dependency-light crypto building blocks for secure runtimes.","archived":false,"fork":false,"pushed_at":"2026-04-18T15:29:35.000Z","size":63,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-18T17:29:46.474Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vixcpp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-05T07:21:06.000Z","updated_at":"2026-04-18T15:29:39.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/vixcpp/crypto","commit_stats":null,"previous_names":["vixcpp/crypto"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/vixcpp/crypto","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vixcpp%2Fcrypto","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vixcpp%2Fcrypto/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vixcpp%2Fcrypto/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vixcpp%2Fcrypto/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vixcpp","download_url":"https://codeload.github.com/vixcpp/crypto/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vixcpp%2Fcrypto/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33464012,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-25T06:32:55.349Z","status":"ssl_error","status_checked_at":"2026-05-25T06:32:35.322Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-02-05T10:11:02.320Z","updated_at":"2026-05-25T07:00:55.602Z","avatar_url":"https://github.com/vixcpp.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# vix::crypto\n\nModern cryptography primitives for Vix.\n\nThis module provides **explicit, auditable, dependency-light** cryptographic building blocks\ndesigned for secure runtimes, offline-first systems, and peer-to-peer protocols.\n\nNo hidden magic. No implicit control flow. No exceptions in public APIs.\n\n---\n\n## Design principles\n\n- **Explicit errors**\n  All operations return `Result\u003cT\u003e` or `Result\u003cvoid\u003e`. Failure is visible at call sites.\n\n- **Composable primitives**\n  Small building blocks that can be combined safely in higher-level systems.\n\n- **Provider-agnostic**\n  Interfaces are stable. Providers (OpenSSL, OS RNG) are behind clear boundaries.\n\n- **Predictable behavior**\n  No global state. No hidden initialization. No surprising allocations.\n\n---\n\n## Provided primitives\n\n### Randomness\n\n- `random_bytes(span\u003cuint8_t\u003e)`\n- `random_uint(max)`\n\nBacked by:\n- OpenSSL CSPRNG (when enabled)\n- Linux `getrandom()` syscall\n\n---\n\n### Hashing\n\n- `sha256(...)`\n- Generic `hash(HashAlg, ...)`\n\nUsed for:\n- content identifiers\n- integrity checks\n- signatures\n- WAL and sync engines\n\n---\n\n### HMAC\n\n- `hmac_sha256(...)`\n- Generic `hmac(HmacAlg, ...)`\n\nProvides message authentication with shared secrets.\n\n---\n\n### Key derivation\n\n- `hkdf_sha256(...)`\n- Generic `kdf(KdfAlg, ...)`\n\nRFC 5869 compliant.\n\n---\n\n### Secret keys\n\n- `SecretKey` (owning, zeroized on destruction)\n- `generate_secret_key(size)`\n\nDesigned for in-memory safety and explicit lifetimes.\n\n---\n\n### Authenticated encryption (AEAD)\n\n- `aes_256_gcm` via `aead_encrypt` / `aead_decrypt`\n\nProvides:\n- confidentiality\n- integrity\n- authenticity\n\nNonce and tag handling is explicit and strict.\n\n---\n\n### Signatures\n\n- `ed25519`\n  - key generation\n  - signing\n  - verification\n\nDeterministic, fast, and widely deployed.\n\n---\n\n## Error handling\n\nAll APIs return explicit errors:\n\n```cpp\nauto r = sha256(data, out);\nif (!r.ok())\n{\n  // inspect r.error().code and r.error().message\n}\n```\n\nNo exceptions are thrown by public APIs.\n\n---\n\n## Build and integration\n\n### As part of the Vix umbrella\n\nThe crypto module is designed to be added via:\n\n```\nmodules/crypto\n```\n\nDependencies are managed by the umbrella build.\n\n---\n\n### Standalone build\n\n```bash\ncmake -S . -B build\ncmake --build build\n```\n\nOpenSSL is used automatically when available.\n\n---\n\n## Examples\n\nSee the `examples/` directory:\n\n- `hash_sha256.cpp`\n- `aead_roundtrip.cpp`\n- `sign_verify.cpp`\n\nEach example is small, self-contained, and demonstrates correct usage.\n\n---\n\n## Tests\n\nThe `tests/` directory contains a minimal smoke test validating:\n\n- randomness\n- hashing\n- HMAC\n- KDF\n- AEAD\n- signatures\n\nThese tests ensure wiring and providers work as expected.\n\n---\n\n## Scope\n\nThis module intentionally does **not** provide:\n\n- TLS\n- certificate handling\n- key storage\n- protocol-level logic\n\nThose belong in higher-level modules (`p2p`, `net`, `sync`).\n\n---\n\n## License\n\nMIT. See `LICENSE`.\n\n---\n\n\u003e Cryptography does not create trust.\n\u003e It makes systems **work without having to trust**.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvixcpp%2Fcrypto","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvixcpp%2Fcrypto","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvixcpp%2Fcrypto/lists"}