Implementation and Optimization of HQC Decoding on NPU-Integrated Devices
This paper presents an optimized implementation of the NIST-standardized HQC decoding algorithm on Qualcomm Hexagon processors within NPU-integrated devices, leveraging Hexagon Vector eXtensions (HVX) to achieve up to an 18.13-fold improvement in energy efficiency by reformulating dominant decoding kernels for vectorized execution.
Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer
Imagine your smartphone is a busy city. For years, the city's main power plant (the CPU) has been doing all the heavy lifting, including a very difficult, specialized task called "HQC decoding." This task is like a complex security check needed to keep your messages safe from future super-computers (quantum computers).
The problem is that this security check is so heavy that it drains the phone's battery and slows down the main power plant, leaving less energy for your apps and games.
The Big Idea: Using a Specialized Delivery Fleet
The authors of this paper realized that while the main power plant is great at general tasks, the phone has a hidden, specialized delivery fleet called the NPU (Neural Processing Unit). Usually, this fleet is used for AI tasks like recognizing faces or translating languages. However, the researchers discovered that the "HQC decoding" security check is actually structured in a way that fits perfectly with how this delivery fleet works.
Instead of forcing the main power plant to do the heavy lifting, they redesigned the security check so the specialized fleet (using something called HVX, or vector extensions) could do it instead.
How They Did It: The Three Main Upgrades
Think of the decoding process as a three-step assembly line. The researchers didn't just tell the new fleet to "go faster"; they completely rebuilt the assembly line to match the fleet's strengths:
The "Hadamard" Sort (The Reed-Muller Step):
- The Old Way: The main power plant looked at a massive list of numbers one by one, checking them individually to find the biggest one. It was like a librarian checking every single book on a shelf one by one to find the thickest one.
- The New Way: The specialized fleet can look at a whole row of books at once. They redesigned the process so the fleet can check 64 or 128 numbers simultaneously. They also made sure that if two numbers were tied for "biggest," the fleet picked the exact same one the librarian would have, so the security remains perfect.
The "Syndrome" Check (The Reed-Solomon Step):
- The Old Way: This step involves complex math in a special "finite field" (a weird number system). The old method was like trying to solve a puzzle by looking up answers in a giant, slow-to-open encyclopedia.
- The New Way: The researchers taught the fleet a new trick: instead of looking up answers, they perform the math in parallel. It's like having 64 workers each solving a small part of the puzzle at the exact same time, rather than one worker doing them all in a row.
The "Root Search" (Finding the Errors):
- The Old Way: This was a step-by-step process where you had to wait for one result before starting the next, which is very slow for a parallel fleet.
- The New Way: They changed the strategy to a "Chien search." Instead of waiting, they packed all the possible answers into a single, wide truck and drove through the whole list at once, flagging the errors instantly.
The Results: A Massive Win for Speed and Battery
The team tested this new system on a real phone (a Snapdragon 8 Gen 2) and in a high-precision simulator. Here is what they found:
- Speed: The new method is 2 to 3 times faster at decoding on the actual phone compared to the old method. In the simulator (where they ignore the time it takes to start the engine), it was 23 to 34 times faster.
- Battery Life: This is the biggest win. The new method uses 11 to 18 times less energy per decoding task. It's like switching from a gas-guzzling truck to an electric scooter for the same delivery.
- Freeing Up the CPU: When the old method ran, the main processor was 93–97% busy, leaving almost no room for anything else. With the new method, the main processor is only 1% busy (it just sends the order and waits). This frees up the phone to run your games, stream videos, or do other tasks while the security check happens in the background.
One Important Caveat: The "Batching" Trick
The paper notes a small catch. Sending a single task to the specialized fleet takes a bit of time to set up (about half a second). To make the system efficient, they don't send one task at a time. Instead, they batch many tasks together and send them all in one go. This spreads the setup cost over many tasks, making the whole process incredibly efficient.
Summary
The paper proves that by rethinking how we organize the data, we can use a phone's AI hardware (NPU) to do heavy-duty cryptography. This makes the phone faster, saves a massive amount of battery, and keeps the main processor free for everything else, all while maintaining the exact same security standards.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.