{"id":19596884,"url":"https://github.com/emmansun/sm4bs","last_synced_at":"2026-05-16T05:36:09.309Z","repository":{"id":163377389,"uuid":"638195798","full_name":"emmansun/sm4bs","owner":"emmansun","description":"sm4 with bit slicing","archived":false,"fork":false,"pushed_at":"2023-10-24T09:47:32.000Z","size":371,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-09T07:32:46.715Z","etag":null,"topics":["bitslicing","sm4"],"latest_commit_sha":null,"homepage":"","language":"Assembly","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/emmansun.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}},"created_at":"2023-05-09T09:29:05.000Z","updated_at":"2023-06-19T01:31:55.000Z","dependencies_parsed_at":null,"dependency_job_id":"0e6586b0-55e8-4fa5-96b3-97f5678c122a","html_url":"https://github.com/emmansun/sm4bs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emmansun%2Fsm4bs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emmansun%2Fsm4bs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emmansun%2Fsm4bs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emmansun%2Fsm4bs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/emmansun","download_url":"https://codeload.github.com/emmansun/sm4bs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240876832,"owners_count":19871904,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["bitslicing","sm4"],"created_at":"2024-11-11T08:57:01.536Z","updated_at":"2026-05-16T05:36:04.288Z","avatar_url":"https://github.com/emmansun.png","language":"Assembly","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sm4bs\n实验性项目，通过比特切片等技术来实现sm4，验证性能。\n\n目前性能如下：\n\n**64组**：\n```\ngoos: windows\ngoarch: amd64\npkg: github.com/emmansun/sm4bs\ncpu: Intel(R) Core(TM) i5-9500 CPU @ 3.00GHz\nBenchmarkXorRK64-6   \t38663529\t        29.36 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkSbox64-6   \t67601062\t        17.83 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkTao64-6   \t14010654\t        82.90 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkL64-6   \t54585649\t        22.99 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkBS64TransposeAvx-6   \t 4376485\t       274.2 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkBS64TransposeRevAvx-6   \t 4492495\t       267.5 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkEncrypt64Blocks-6   \t  298386\t      4686 ns/op\t 218.54 MB/s\t    1536 B/op\t       2 allocs/op\n```\n\n**128组**：\n```\ngoos: windows\ngoarch: amd64\npkg: github.com/emmansun/sm4bs\ncpu: Intel(R) Core(TM) i5-9500 CPU @ 3.00GHz\nBenchmarkXor32-6   \t84093679\t        13.37 ns/op\nBenchmarkXorRK-6   \t37912296\t        31.48 ns/op\nBenchmarkL128-6   \t52159624\t        22.68 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkSbox128-6   \t68027982\t        17.27 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkTao128-6   \t14089119\t        86.37 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkBS128TransposeAvx-6   \t 2279635\t       511.7 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkBS128TransposeRevAvx-6   \t 2365981\t       511.2 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkEncrypt128Blocks-6   \t  205614\t      5557 ns/op\t 368.55 MB/s\t    3072 B/op\t       2 allocs/op\n```\n**256组**：\n```\ngoos: windows\ngoarch: amd64\npkg: github.com/emmansun/sm4bs\ncpu: Intel(R) Core(TM) i5-9500 CPU @ 3.00GHz\nBenchmarkSbox256-6   \t68508790\t        17.99 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkTao256-6   \t13837366\t        88.67 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkL256-6   \t50736309\t        22.45 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkXorRK256-6   \t35646387\t        34.23 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkXor32x256-6   \t54216703\t        21.92 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkBS256TransposeAvx-6   \t 1000000\t      1046 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkBS256TransposeRevAvx-6   \t 1000000\t      1020 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkEncrypt256Blocks-6   \t  167295\t      6869 ns/op\t 596.28 MB/s\t    6144 B/op\t       2 allocs/op\n```\n\n**AES-NI + AVX2方案**：\n```\ngoos: windows\ngoarch: amd64\ncpu: Intel(R) Core(TM) i5-9500 CPU @ 3.00GHz\nBenchmarkAESNIEncrypt64Blocks-6   \t  613549\t      2019 ns/op\t 507.24 MB/s\t       0 B/op\t       0 allocs/op\nBenchmarkAESNIEncrypt64Blocks-6   \t  293706\t      3952 ns/op\t 518.16 MB/s\t       0 B/op\t       0 allocs/op\nBenchmarkAESNIEncrypt64Blocks-6   \t  149754\t      7921 ns/op\t 517.10 MB/s\t       0 B/op\t       0 allocs/op\n```\n\nDetail：\n- 128/256组：https://github.com/emmansun/sm4bs/issues/1\n\nReference:\n- https://github.com/emmansun/gmsm/discussions/116\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femmansun%2Fsm4bs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Femmansun%2Fsm4bs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femmansun%2Fsm4bs/lists"}