-
Notifications
You must be signed in to change notification settings - Fork 145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Kangaroo12 draft -10 #431
Kangaroo12 draft -10 #431
Conversation
Without overhead, with the current code that uses the slow scalar keccak, we should be able to reach:
Using pprof, I see 1/3 of the time is spent in |
cf87fe1
to
f3bfa42
Compare
Theoretical max is 2230 MB/s. Interleaving and XORing is still expensive, it's just less so compared to the speed of Keccak here. |
s.offset = len(p) | ||
} | ||
|
||
return written, nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
written
is always len(p)
, and is never modified based on actual Write
operations.
Also, let's propagate errors from Read/Write functions above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
written
is alwayslen(p)
True, but p
is modified, so we need to store len(p)
.
Also, let's propagate errors from Read/Write functions above.
Read/Write don't error.
for len(remainingBuf) > 0 { | ||
h := sha3.NewTurboShake128(0x0B) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we reuse the hashfn?
for len(remainingBuf) > 0 { | |
h := sha3.NewTurboShake128(0x0B) | |
h := sha3.NewTurboShake128(0x0B) | |
for len(remainingBuf) > 0 { | |
h.Reset() |
@armfazh I addressed all your comments. Please have another look. |
…834) [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [github.com/cloudflare/circl](https://togithub.com/cloudflare/circl) | `v1.3.3` -> `v1.3.7` | [![age](https://developer.mend.io/api/mc/badges/age/go/github.com%2fcloudflare%2fcircl/v1.3.7?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/go/github.com%2fcloudflare%2fcircl/v1.3.7?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/go/github.com%2fcloudflare%2fcircl/v1.3.3/v1.3.7?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/go/github.com%2fcloudflare%2fcircl/v1.3.3/v1.3.7?slim=true)](https://docs.renovatebot.com/merge-confidence/) | ### GitHub Vulnerability Alerts #### [GHSA-9763-4f94-gfch](https://togithub.com/cloudflare/circl/security/advisories/GHSA-9763-4f94-gfch) ### Impact On some platforms, when an attacker can time decapsulation of Kyber on forged cipher texts, they could possibly learn (parts of) the secret key. Does not apply to ephemeral usage, such as when used in the regular way in TLS. ### Patches Patched in 1.3.7. ### References - [kyberslash.cr.yp.to](https://kyberslash.cr.yp.to/) --- ### Release Notes <details> <summary>cloudflare/circl (github.com/cloudflare/circl)</summary> ### [`v1.3.7`](https://togithub.com/cloudflare/circl/releases/tag/v1.3.7): CIRCL v1.3.7 [Compare Source](https://togithub.com/cloudflare/circl/compare/v1.3.6...v1.3.7) #### CIRCL v1.3.7 ##### What's Changed - build(deps): bump golang.org/x/crypto from 0.3.1-0.20221117191849-2c476679df9a to 0.17.0 by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/cloudflare/circl/pull/467](https://togithub.com/cloudflare/circl/pull/467) - kyber: remove division by q in ciphertext compression by [@​bwesterb](https://togithub.com/bwesterb) in [https://github.com/cloudflare/circl/pull/468](https://togithub.com/cloudflare/circl/pull/468) - Releasing CIRCL v1.3.7 by [@​armfazh](https://togithub.com/armfazh) in [https://github.com/cloudflare/circl/pull/469](https://togithub.com/cloudflare/circl/pull/469) ##### New Contributors - [@​dependabot](https://togithub.com/dependabot) made their first contribution in [https://github.com/cloudflare/circl/pull/467](https://togithub.com/cloudflare/circl/pull/467) **Full Changelog**: cloudflare/circl@v1.3.6...v1.3.7 ### [`v1.3.6`](https://togithub.com/cloudflare/circl/releases/tag/v1.3.6): CIRCL v1.3.6 [Compare Source](https://togithub.com/cloudflare/circl/compare/v1.3.5...v1.3.6) #### CIRCL v1.3.6 ##### What's Changed - internal: add TurboShake{128,256} by [@​bwesterb](https://togithub.com/bwesterb) in [https://github.com/cloudflare/circl/pull/430](https://togithub.com/cloudflare/circl/pull/430) - Kangaroo12 draft -10 by [@​bwesterb](https://togithub.com/bwesterb) in [https://github.com/cloudflare/circl/pull/431](https://togithub.com/cloudflare/circl/pull/431) - Add K12 as XOF by [@​bwesterb](https://togithub.com/bwesterb) in [https://github.com/cloudflare/circl/pull/437](https://togithub.com/cloudflare/circl/pull/437) - xof/k12: Fix a typo in the package documentation by [@​cjpatton](https://togithub.com/cjpatton) in [https://github.com/cloudflare/circl/pull/438](https://togithub.com/cloudflare/circl/pull/438) - Set CIRCL version for generated assembler code. by [@​armfazh](https://togithub.com/armfazh) in [https://github.com/cloudflare/circl/pull/440](https://togithub.com/cloudflare/circl/pull/440) - Add tkn20 benchmarks by [@​tanyav2](https://togithub.com/tanyav2) in [https://github.com/cloudflare/circl/pull/442](https://togithub.com/cloudflare/circl/pull/442) - Add partially blind RSA implementation by [@​chris-wood](https://togithub.com/chris-wood) in [https://github.com/cloudflare/circl/pull/445](https://togithub.com/cloudflare/circl/pull/445) - Update doc.go by [@​nadimkobeissi](https://togithub.com/nadimkobeissi) in [https://github.com/cloudflare/circl/pull/447](https://togithub.com/cloudflare/circl/pull/447) - tss/rsa: key generation for threshold RSA (safe primes) by [@​armfazh](https://togithub.com/armfazh) in [https://github.com/cloudflare/circl/pull/450](https://togithub.com/cloudflare/circl/pull/450) - Bumping Go version for CI jobs. by [@​armfazh](https://togithub.com/armfazh) in [https://github.com/cloudflare/circl/pull/457](https://togithub.com/cloudflare/circl/pull/457) - Spelling by [@​jsoref](https://togithub.com/jsoref) in [https://github.com/cloudflare/circl/pull/456](https://togithub.com/cloudflare/circl/pull/456) - blindrsa: updating blindrsa to be compliant with RFC9474 by [@​armfazh](https://togithub.com/armfazh) in [https://github.com/cloudflare/circl/pull/464](https://togithub.com/cloudflare/circl/pull/464) - Releasing CIRCL v1.3.6 by [@​armfazh](https://togithub.com/armfazh) in [https://github.com/cloudflare/circl/pull/465](https://togithub.com/cloudflare/circl/pull/465) ##### New Contributors - [@​nadimkobeissi](https://togithub.com/nadimkobeissi) made their first contribution in [https://github.com/cloudflare/circl/pull/447](https://togithub.com/cloudflare/circl/pull/447) - [@​jsoref](https://togithub.com/jsoref) made their first contribution in [https://github.com/cloudflare/circl/pull/456](https://togithub.com/cloudflare/circl/pull/456) **Full Changelog**: cloudflare/circl@v1.3.3...v1.3.6 ### [`v1.3.5`](https://togithub.com/cloudflare/circl/compare/v1.3.4...v1.3.5) [Compare Source](https://togithub.com/cloudflare/circl/compare/v1.3.4...v1.3.5) ### [`v1.3.4`](https://togithub.com/cloudflare/circl/compare/v1.3.3...v1.3.4) [Compare Source](https://togithub.com/cloudflare/circl/compare/v1.3.3...v1.3.4) </details> --- ### Configuration 📅 **Schedule**: Branch creation - "" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/hetznercloud/terraform-provider-hcloud). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4xMjcuMCIsInVwZGF0ZWRJblZlciI6IjM3LjEyNy4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
On M2 Pro:
For comparison: