{"id":43955187,"url":"https://github.com/ericlagergren/hctr2","last_synced_at":"2026-02-07T04:32:59.223Z","repository":{"id":40457015,"uuid":"452995108","full_name":"ericlagergren/hctr2","owner":"ericlagergren","description":"Length-preserving encryption algorithm https://eprint.iacr.org/2021/1441.pdf","archived":false,"fork":false,"pushed_at":"2022-11-15T06:46:49.000Z","size":632,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-06-21T16:55:49.879Z","etag":null,"topics":["hctr2","length-preserving-encryption"],"latest_commit_sha":null,"homepage":"","language":"Assembly","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ericlagergren.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}},"created_at":"2022-01-28T08:38:53.000Z","updated_at":"2023-01-07T20:24:50.000Z","dependencies_parsed_at":"2022-08-09T21:01:13.943Z","dependency_job_id":null,"html_url":"https://github.com/ericlagergren/hctr2","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ericlagergren/hctr2","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericlagergren%2Fhctr2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericlagergren%2Fhctr2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericlagergren%2Fhctr2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericlagergren%2Fhctr2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ericlagergren","download_url":"https://codeload.github.com/ericlagergren/hctr2/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericlagergren%2Fhctr2/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29186738,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-07T03:35:06.566Z","status":"ssl_error","status_checked_at":"2026-02-07T03:34:57.604Z","response_time":63,"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":["hctr2","length-preserving-encryption"],"created_at":"2026-02-07T04:32:59.145Z","updated_at":"2026-02-07T04:32:59.213Z","avatar_url":"https://github.com/ericlagergren.png","language":"Assembly","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hctr2\n\n[![Go Reference](https://pkg.go.dev/badge/github.com/ericlagergren/hctr2.svg)](https://pkg.go.dev/github.com/ericlagergren/hctr2)\n\nLength-preserving encryption algorithm https://eprint.iacr.org/2021/1441.pdf\n\n## Installation\n\n```bash\ngo get github.com/ericlagergren/hctr2@latest\n```\n\n## Performance\n\nThe performance of HCTR2 is primarily determined by the XCTR and\nPOLYVAL implementations. This module provides ARMv8 and x86-64 \nassembly XCTR implementations and uses a hardware-accelerated\nPOLYVAL implementation (see [github.com/ericlagergren/polyval](https://pkg.go.dev/github.com/ericlagergren/polyval)).\n\n### Results\n\n| CPU     | ISA   | Frequency | Cycles per byte | API    |\n| ---     | ---   | ---       | ---             | ---    |\n| M1      | ARMv8 | 3.2 GHz   | 0.8             | NewAES |\n| M1      | ARMv8 | 3.2 GHz   | 3.2             | New    |\n| M1      | x86   | 2.5 GHz   | 0.7             | NewAES |\n| RK3399  | ARMv8 | 1.8 GHz   | 2.7             | NewAES |\n| RK3399  | ARMv8 | 1.8 GHz   | 6.1             | New    |\n| Skylake | x86   | 3.9 GHz   | 1.4             | NewAES |\n| Skylake | x86   | 3.9 GHz   | 6.1             | New    |\n\nFor reference, here are the numbers for the reference\nC [implementation](https://github.com/google/hctr2).\n\n| CPU     | ISA   | Frequency | Cycles per byte | API  |\n| ---     | ---   | ---       | ---             | ---  |\n| RK3399  | ARMv8 | 1.8 GHz   | 1.8             | simd |\n| Skylake | x86   | 3.9 GHz   | 1.2             | simd |\n\n#### Notes\n\n- The table is computed for 8192-byte messages.\n- The table is for encryption (decryption is equivalent).\n- The `New` API uses the stdlib's `crypto/aes` package.\n- The `NewAES` API uses this package's assembly XCTR\n   implementation.\n- CPU frequencies are approximate and always assume the maximum\n   available frequency. E.g., benchmarks for big.LITTLE CPUs are\n   assumed to only use the big cores.\n\n## Security\n\n### Disclosure\n\nThis project uses full disclosure. If you find a security bug in\nan implementation, please e-mail me or create a GitHub issue.\n\n### Disclaimer\n\nYou should only use cryptography libraries that have been\nreviewed by cryptographers or cryptography engineers. While I am\na cryptography engineer, I'm not your cryptography engineer, and\nI have not had this project reviewed by any other cryptographers.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericlagergren%2Fhctr2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fericlagergren%2Fhctr2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericlagergren%2Fhctr2/lists"}