{"id":32167635,"url":"https://github.com/casz92/ntru_falcon","last_synced_at":"2026-05-16T17:31:17.778Z","repository":{"id":296223693,"uuid":"992676020","full_name":"casz92/ntru_falcon","owner":"casz92","description":"NIF C library for Elixir, implementing the post-quantum cryptography algorithm Falcon","archived":false,"fork":false,"pushed_at":"2025-06-28T00:29:47.000Z","size":399,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-29T20:10:15.564Z","etag":null,"topics":["cryptography","elixir","ntru","post-quantum-cryptography"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/casz92.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":"2025-05-29T14:35:25.000Z","updated_at":"2025-08-25T18:58:00.000Z","dependencies_parsed_at":"2025-05-29T16:13:59.886Z","dependency_job_id":"92cdc289-5899-4d1d-9579-fc6aa272f3f7","html_url":"https://github.com/casz92/ntru_falcon","commit_stats":null,"previous_names":["casz92/ex_falcon"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/casz92/ntru_falcon","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casz92%2Fntru_falcon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casz92%2Fntru_falcon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casz92%2Fntru_falcon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casz92%2Fntru_falcon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/casz92","download_url":"https://codeload.github.com/casz92/ntru_falcon/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casz92%2Fntru_falcon/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33111593,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-16T04:41:52.686Z","status":"ssl_error","status_checked_at":"2026-05-16T04:41:52.009Z","response_time":115,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["cryptography","elixir","ntru","post-quantum-cryptography"],"created_at":"2025-10-21T15:34:08.637Z","updated_at":"2026-05-16T17:31:17.762Z","avatar_url":"https://github.com/casz92.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Falcon\n\nFalcon: It's a post-quantum cryptography library for digital signatures based on the Falcon algorithm.\n\n[Official Website](https://falcon-sign.info)\n\n## Introduction\n\nFalcon is a post-quantum digital signature scheme selected by **NIST** as part of its efforts to develop cryptographic standards resilient to quantum attacks. It is based on **NTRU lattices** and offers an optimal balance between security and efficiency.\n\n## Features\n\n- **Post-quantum security:** Based on the **Quantum Random Oracle** model.\n- **Optimized efficiency:** Compact key and signature sizes.\n- **Elixir implementation via NIF:** Native C code integration for optimal performance.\n- **Compatible with Falcon-512 and Falcon-1024**.\n\n## Signature Padding Optimization\n\nFalcon signatures include an initial **41-byte padding**, which is automatically reconstructed during the verification process. This means the padding can be safely removed when storing or transmitting signatures, reducing their overall size without affecting security or validity.\n\n### Key Considerations:\n- **Storage \u0026 Transmission Efficiency**: Removing the padding reduces signature size while maintaining integrity.\n- **Compatibility**: Since the verification process restores the removed bytes, there is no impact on the correctness of signature validation.\n- **Implementation Details**: Ensure the padding is removed consistently, and validate that the verification method correctly regenerates it.\n\nThis optimization offers a practical way to minimize storage and transmission overhead while preserving Falcon’s cryptographic strength.\n\n### Compilation \u0026 Testing\n- **Compiled and tested on Linux x64.**\n\n### Details\n| Security | LOGN |\n|----------|------|\n| Falcon-512 | 9 |\n| Falcon-1024 | 10 |\n\n### Key and Signature Sizes\n\n#### Falcon-512\n| Component | Size (bytes) |\n|-----------|--------------|\n| Public key | 897 |\n| Private key | 1281 |\n| Signature | ~625 (666) |\n\n\u003e **Note:** The maximum signature size is 625 bytes, as the first 41 characters \u003c\u003c57, 0, 0, 0...\u003e\u003e are removed.\n\n#### Falcon-1024\n| Component | Size (bytes) |\n|-----------|--------------|\n| Public key | 1793 |\n| Private key | 2305 |\n| Signature | ~1239 (1280) |\n\n\u003e **Note:** The maximum signature size is 1239 bytes, as the first 41 characters \u003c\u003c58, 0, 0, 0...\u003e\u003e are removed.\n\n## Installation \u0026 Compilation\n\nBefore compiling, make sure to install `build-essential` and `erlang-dev`.\n\n```bash\nmix deps.get\nmix compile\n```\n\n## Usage\nTo add the library to your project, include the following dependency in mix.exs:\n```elixir\ndef deps do\n  [\n    {:ex_falcon, \"~\u003e 0.1.0\"}\n  ]\nend\n```\n\n### Example\n```elixir\nmsg = \"Hello world!\"\n{:ok, pubkey, privkey} = Falcon.gen_key_pair()\n{:ok, signature} = Falcon.sign(privkey, msg)\n:ok = Falcon.verify(msg, signature, pubkey)\n\n# Generate from seed\n{:ok, pubkey, privkey} = Falcon.gen_keys_from_seed(\"your_seed\")\n# Generate public key from private key\n{:ok, pubkey2} = Falcon.gen_pub_key(privkey)\npubkey == pubkey2\n\n# Falcon1024 test\n{:ok, pub, priv} = Falcon1024.gen_key_pair()\n{:ok, signature} = Falcon1024.sign(priv, msg)\n:ok = Falcon1024.verify(msg, signature, pub)\n```\n\n## Testing\nRun the following commands to test Falcon-512 and Falcon-1024:\n```bash\nmix run test/falcon_512_test.exs\nmix run test/falcon_1024_test.exs\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcasz92%2Fntru_falcon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcasz92%2Fntru_falcon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcasz92%2Fntru_falcon/lists"}