I was 15 minutes into a CTF crypto challenge, watching my CPU crawl through a polynomial multiplication, when it hit me: This is embarrassingly parallel. Why isn’t there hardware for this?
That night I fell down the FPGA rabbit hole. The idea was pretty great, a chip you can rewire into literally anything, like a custom RISC-V CPU, a cryptography accelerator. Where does that second idea take me? A method to execute a side-channel attack on cryptographic protocols using the FPGA, and all on a chip smaller than a credit card.
So I bought an FPGA on impulse, without researching properly. You can’t blame me, I was very excited.
I bought a Sipeed Tang Primer 20K core board. What I didn’t know: it’s just the RAM stick. The actual brains need a baseboard with power switches, reset buttons, and USB. Aaaaaaand I had none of that.
ba dum tss
What I did have: a Vicharak Shrike Lite (the green board in the photo). 1120 LUTs. An RP2040.
The Tang Primer has a JST debug connector. The Shrike Lite has JTAG pins. In theory, this was simple: connect the wires, run openFPGALoader, and go.
In practice:
The pinout I found online was confusing
The BL702 debug chip locks up after programming unless you power cycle the JST connector.
My multimeter showed 0V on TX, and no amount of head scratching made it work.
A week of “should just work” turned into a desk covered in jumper wires, a growing collection of frustrated terminal logs, and the Shrike Lite blinking an LED like it was mocking me.
I couldn’t get the Tang Primer running. But the Shrike Lite was working perfectly.
So I asked myself: what’s the smallest possible cryptography accelerator I could build on 1120 LUTs?
The answer: an NTT (Number Theoretic Transform) core for ML-KEM (Kyber). Why? Why not. Post-quantum cryptography is a hot topic of research. I figured I’d take a crack at it, see what makes it so hot.
Surely, after all of this, I have some lessons to take home, right? Those are:
FPGAs are not plug-and-play. The ecosystem assumes you bought the right baseboard.
1120 LUTs is tiny but not useless. You can’t fit full Kyber, but an NTT core fits comfortably. (I hope)
Documentation is scattered.
A working demo on cheap hardware beats a simulation on the PC. Much more satisfying to see a simple LED light up than stare at another waveform in GTKWave.
So what do I do next?
A working NTT accelerator on the Shrike Lite that processes Kyber polynomials with the RP2040 to FPGA and back bridge sending coefficients and getting transformed results.
The Bottom Line
I bought the wrong board. I didn’t have the right programmer. Nothing worked for weeks.
But I learned more from breaking things than I ever would from following a tutorial.
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.