frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

Open in hackernews

Parallelizing SHA256 Calculation on FPGA

https://www.controlpaths.com/2025/06/29/parallelizing_sha256-calculation-fpga/
52•hasheddan•10h ago

Comments

15155•9h ago
Now try a fully unrolled/pipelined design that emits one hash per clock cycle for actual parallelization.
m3kw9•9h ago
Or try hardcoding a few billion trillions of premade hashes
nayuki•9h ago
https://en.wikipedia.org/wiki/Rainbow_table ?
picture•8h ago
I know why you're downvoted, but it's true, the author is not using FPGAs correctly.
Retr0id•8h ago
So what's the overall hashrate with this approach?

I'll try to calculate it from the information given. 12 parallel instances at a clock speed of 62.5MHz, with 68 clock cycles per hash.

62.5MHz * 12 / 68 = ~11MH/s

That seems... slow? Did I do the math right? How big of an FPGA do you need before this would compete with a GPU, and how much would it cost?

For reference, an RTX 4090 can do 21975.5 MH/s according to hashcat benchmarks.

picture•8h ago
Quite slow. It's largely due to the author using FPGAs wrong. Clocking down a 7-series Artix to 62.5 MHz means the design is not pipelined correctly/enough. My friend got 1 SHA256 hash per cycle at 300 MHz on 7 series, but slightly fewer of the design fit on a chip. Thruput would easily be in the GH/s range.

Keep in mind RTX4090 is 5 nm process node and has a lot more transistors and memory than XC7A100T, which is 28 nm. That's a huge difference in terms of dynamic performance. Also, the two are also released 10 years apart. If you compare RTX4090 against a similarly modern UltraScale part from Xilinx, I believe the FPGA can be notably faster than RTX4090.

benlivengood•8h ago
I'm assuming this space has already been heavily optimized by the Bitcoin miners on their way to ASICs.
picture•8h ago
Yes, hard silicon will be another magnitude more performant than FPGAs and GPUs, but ASICs properly take on negative value when they're no longer profitable to mine with. (Note that efficiency won't be much better at the same process node. You can just pump more power through each ASIC die)

Edit - I misread your comment. ASIC designers will use FPGAs to test their design but it won't be optimized for FPGAs which have a different logic-and-memory characteristic than ASICs. There aren't many great SHA256 FPGA implementations, largely because there's not that much demand for one

the8472•7h ago
> but ASICs properly take on negative value when they're no longer profitable to mine with

No matmul coin where the hardware could be repurposed for AI stuff?

15155•7h ago
Modern BTC ASICs consist of 1600-3200 SHA256 cores and only output nonces for sha256(sha256(btcBlockHeader)) - there's no memory or ability to obtain other output.
throwawaymaths•5h ago
always thought it might be cool to repurpose fast double sha engines for error detection in storage arrays
throwawaymaths•5h ago
matmul isn't a trapdoor function
Retr0id•8h ago
Unfortunately I think most of that innovation happened behind closed doors, because everyone wanted to maintain their competitive advantages.
sMarsIntruder•6h ago
Yes, ASICS are definitely very closed source for that specific reason.
15155•7h ago
Yes, but a designed-for-FPGA SHA256 implementation looks very different than an ASIC SHA256 implementation - the ASIC has far greater routing flexibility and density, and can therefore use far more combinatorial logic between register stages.

(ASIC simulation on an FPGA will retain the combinatorial stages but run at dramatically lower fMax)

benlivengood•2h ago
I should have been a little clearer. I meant that the miners spent a brief period optimizing FPGAs before they abandoned them entirely for ASICs, but during that brief period I'm guessing they squeezed as many hashes/watt out of the FPGAs as they could.
15155•7h ago
SHA256 is extremely FF-heavy, you need around 200k for an optimized, unrolled, pipelined implementation.

UltraScale+ chips will run a proper design at 600MHz-800MHz, big chips might be able to fit 24 cores. The Artix chip OP used is extremely slow and too small to fit this style of implementation.

d00mB0t•8h ago
More posts like this please! How about a crypto accelerator on FPGA that's integrated with OpenSSL?
15155•7h ago
Unless you're talking about niche algorithms (and even then), the FPGA will get smoked by a CPU for most common tasks one would use OpenSSL for.
d00mB0t•6h ago
Yes--obviously modern CPUs have crypto extensions that would be faster than an FPGA,this would be for educational purposes.
15155•6h ago
Even without the extensions, by the time you've moved the workload to the FPGA and back, the CPU has already completed whatever operation your FPGA was going to complete with OpenSSL.

FPGA cryptographic acceleration is about batch task bandwidth, OpenSSL has few places where this is required.

toast0•5h ago
If you want to do crypto acceleration for TLS, there's two places to do it. Handshake/signature/key agreement, which could maybe work, but hasn't been the bottleneck in a long time, eliptic curve dramatically reduces the work for the server and most clients can do it; but maybe shipping the data around for that is fine.

The other part is bulk encryption. CPUs have lots of acceleration for that, but clear text is still faster, so the win is not to ship data to an accelerator and then back to the cpu and then out to the NIC, but to ship to the accelerator and from there to the NIC without touching the CPU or often the accelerator is integrated with the NIC.

It works even better if the data never has to touch the CPU.

15155•3h ago
Yes, this is why FPGAs are used as NICs in many situations, but the folks doing this are of course not using OpenSSL.
d00mB0t•5h ago
You must be great to talk to at parties lol, I guess I shouldn't build a RISC-V CPU because Intel is faster?
15155•3h ago
You should definitely build a crypto accelerator - just don't integrate it into OpenSSL (painful codebase to work in, no speed benefit, etc.)
qdotme•8h ago
Great job!

For alternative design/writeup, check out http://nsa.unaligned.org

projektfu•4h ago
That seems to be the inverse function for SHA-1 and MD5.
bri3d•1h ago
If you know the inverse function for SHA-1, that’s really quite something :)

That project is indeed SHA-1 and not SHA256, but the implementation is much more clever and did a very good job utilizing some very ancient FPGAs back in the day.

projektfu•13m ago
True.

Introducing tmux-rs

https://richardscollin.github.io/tmux-rs/
587•Jtsummers•10h ago•196 comments

Flounder Mode – Kevin Kelly on a different way to do great work

https://joincolossus.com/article/flounder-mode/
148•latentnumber•10h ago•33 comments

Launch HN: K-Scale Labs (YC W24) – Open-Source Humanoid Robots

143•codekansas•8h ago•71 comments

Manipulating trapped air bubbles in ice for message storage in cold regions

https://www.cell.com/cell-reports-physical-science/fulltext/S2666-3864(25)00221-8
28•__rito__•3d ago•5 comments

AV1@Scale: Film Grain Synthesis, The Awakening

https://netflixtechblog.com/av1-scale-film-grain-synthesis-the-awakening-ee09cfdff40b
158•CharlesW•9h ago•127 comments

Wind Knitting Factory

https://www.merelkarhof.nl/work/wind-knitting-factory
72•bschne•5h ago•21 comments

Kubernetes is a symptom, not a solution

https://andreafortuna.org/2025/06/20/unpopular-opinion-kubernetes-is-a-symptom-not-a-solution
19•gsky•1h ago•6 comments

You are what you launch: how software became a lifestyle brand

https://omeru.bearblog.dev/lifestyle/
15•freediver•2d ago•2 comments

Peasant Railgun

https://knightsdigest.com/what-exactly-is-the-peasant-railgun-in-dd-5e/
191•cainxinth•11h ago•147 comments

Poor Man's Back End-as-a-Service (BaaS), Similar to Firebase/Supabase/Pocketbase

https://github.com/zserge/pennybase
137•dcu•10h ago•91 comments

High-Fidelity Simultaneous Speech-to-Speech Translation

https://arxiv.org/abs/2502.03382
50•Bluestein•5h ago•30 comments

CO2 sequestration through accelerated weathering of limestone on ships

https://www.science.org/doi/10.1126/sciadv.adr7250
21•PaulHoule•2h ago•7 comments

Opening up ‘Zero-Knowledge Proof’ technology

https://blog.google/technology/safety-security/opening-up-zero-knowledge-proof-technology-to-promote-privacy-in-age-assurance/
227•doomroot13•8h ago•137 comments

An Algorithm for a Better Bookshelf

https://cacm.acm.org/news/an-algorithm-for-a-better-bookshelf/
64•pseudolus•2d ago•10 comments

Converge (YC S23) well-capitalized New York startup seeks product developers

https://www.runconverge.com/careers
1•thomashlvt•4h ago

Caching is an abstraction, not an optimization

https://buttondown.com/jaffray/archive/caching-is-an-abstraction-not-an-optimization/
85•samuel246•2d ago•66 comments

Where is my von Braun wheel?

https://angadh.com/wherevonbraunwheel
117•speckx•11h ago•91 comments

Ubuntu 25.10 Raises RISC-V Profile Requirements

https://www.omgubuntu.co.uk/2025/06/ubuntu-riscv-rva23-support
58•bundie•2d ago•16 comments

Postcard is now open source

https://www.contraption.co/postcard-open-source/
77•philip1209•9h ago•25 comments

AI for Scientific Search

https://arxiv.org/abs/2507.01903
87•omarsar•10h ago•21 comments

Stalking the Statistically Improbable Restaurant with Data

https://ethanzuckerman.com/2025/07/03/stalking-the-statistically-improbable-restaurant-with-data/
52•nkurz•8h ago•25 comments

Fei-Fei Li: Spatial intelligence is the next frontier in AI [video]

https://www.youtube.com/watch?v=_PioN-CpOP0
257•sandslash•2d ago•131 comments

Encoding Jake Gyllenhaal into one million checkboxes (2024)

https://ednamode.xyz/blogs/2.html
45•chilipepperhott•9h ago•12 comments

Michael Madsen has died

https://www.nytimes.com/2025/07/03/movies/michael-madsen-dead.html
59•anigbrowl•3h ago•17 comments

Parallelizing SHA256 Calculation on FPGA

https://www.controlpaths.com/2025/06/29/parallelizing_sha256-calculation-fpga/
52•hasheddan•10h ago•30 comments

About AI Evals

https://hamel.dev/blog/posts/evals-faq/
159•TheIronYuppie•2d ago•36 comments

Show HN: I rewrote my notepad calculator as a local-first app with CRDT syncing

https://numpad.io
15•tonyonodi•3d ago•4 comments

Copper is Faster than Fiber (2017) [pdf]

https://www.arista.com/assets/data/pdf/Copper-Faster-Than-Fiber-Brief.pdf
68•tanelpoder•2d ago•64 comments

Astronomers discover 3I/ATLAS – Third interstellar object to visit Solar System

https://www.abc.net.au/news/science/2025-07-03/3i-atlas-a11pl3z-interstellar-object-in-our-solar-system/105489180
281•gammarator•22h ago•149 comments

Alice's Adventures in a Differentiable Wonderland

https://arxiv.org/abs/2404.17625
133•henning•3d ago•20 comments