黑客技术
点击放大


<!--
SPDX-FileCopyrightText: 2026 Chili.CHIPS*ba
SPDX-License-Identifier: BSD-3-Clause
-->
![NLnet Foundation]()
![GitHub stars]()
With traditional solutions (such as OpenVPN / IPSec) starting to run out of steam, Wireguard is increasingly coming to the forefront as a modern, secure data tunneling and encryption method, one that's also easier to manage than the incumbents. Both software and hardware implementations of Wireguard already exist. However, the software performance is far below the speed of wire. The existing hardware approaches are both prohibitively expensive and based on proprietary, closed-源码 IP blocks and tools.<br>
This project aims to bridge these gaps with an open-source, FPGA-based implementation of Wireguard. It puts to work multiple open-源码 technologies:
⭐ PipelineC HLS-like
⭐ PeakRDL CSR
⭐ RISC-V CPU
⭐ VProc CoSim
⭐ OpenXC7 PNR
⭐ SV2V System HDL con
and taps into ⭐ open-源码 IP library in order to compose a coherent hardware-software SOC for secure networking.
While working on the _Blackwire_, we ha multiple sections, and focused on the no for _Balanced Binary Tree Search_ of IP tables. However, the _Blackwire_ hardware platform is expensive and priced out of reach of most educational institutions. Its gateware is written in SpinalHDL, a nice and powerfull but a niche HDL, which has not taken roots in the industry. While _Blackwire_ is now released to open-源码, that decision came from their financial hardship -- It was originaly meant for sale. Moreover, the company behind it is subject to disputes and obligations that bring into question the legality of ownership over the codebase they "donated" to the open 源码 community.
<p align="center">
<img width="50%" src="0.doc/Alinx/AX7201.png">
<img width="50%" src="0.doc/Alinx/ALINX7201x2.jpg">
</p>
[Ref1] Wireguard implementations in software:
- Netbird
- Tailscale
- Linux Kernel
[Ref2] 100Gbps _Blackwire_ Wireguard
[Ref3] Corundum, open-源码 FPGA-NIC platform
[Ref4] ChaCha20-Poly1305 open-源码 Crypto RTL
[Ref5] Cookie Cutter SOC
[Ref6] RISC-V ISS
[Ref7] 10Gbps Ethernet Switch
[Ref8] OpenXC7 open-源码 tools for Xilinx Series7
[Ref9] Alex's Ethernet Stack
[Ref10] High-performance Switches and Routers
[Ref11] Amina's ADASEC-SDN
[Ref12] opencryptohw
[Ref13] Pypeline Native Sim
The Phase2 continuation project is therefore also in the plans, to maximize efficiency and o useability, such as by increasing the number of channels, facilitating management with 界面 apps, or something else as identified by the community feedback.
2) HW/SW co-de, integration and debugging
- Standard simulation is impractical for the project of this size and complexity. We therefore intend to put to test and good use the very promissing new VProc ISS [Ref6]
- It’s also impractical and expensive to provide full test systems with real traffic generators and checkers to all de. We therefore plan to rent some space for a central lab that will host two test systems, then provide remote access to all de
3) Real-life, at-speed testing
4) Extent of open-源码 tools support for System and all needed FPGA primitives and IP functions
5) QOR of the (still maturing) open-源码 tools
- _Blackwire_ used commercial, AMD/Xilinx-proprietary toolchain, as well as high-end Alveo U50 FPGA silicon. Even then, they ran into multiple timing closure, utilization and routing congestion challenges.
6) Financial resources
- Given that this is a complex, multi-disciplinary de, the a funding may not be sufficient to bring it to completion. _Blackwire_, despite a larger allocated budget, ended up with funding crisis and abrupt cessation of de.
<p align="center">
<img width="80%" src="0.doc/Wireguard/wireguard-fpga-muxed-Architecture-HW-SW-Partitioning.webp">
</p>
In the HW/SW partitioning diagram, we can observe two types of 网络 traffic: control traffic, which originates from the control plane and goes toward the external 网络 (and vice versa), and data traffic, which arrives from the external 网络 and, after processing in the data plane, returns to the external 网络. Specifically, control traffic represents WireGuard 协议 handshake messages, while data traffic consists of end-user traffic, either encrypted or in plaintext, depending on the perspective.
<p align="center">
<img width="90%" src="0.doc/Wireguard/wireguard-fpga-Architecture-HW.webp">
</p>
The hardware architecture essentially follows the HW/SW partitioning and consists of two domains: a soft CPU for the control plane and RTL for the data plane.
The soft CPU is equipped with a Boot ROM and a DDR3 SDRAM controller for interfacing with off-chip memory. External memory is exclusively used for control plane processes and does not store packets. The connection between the control and data planes is established through a CSR-based HAL.
The data plane consists of several IP cores, including data plane 引擎 (DPE) and supporting components, which are listed and explained in the direction of 网络 traffic propagation:
_ChaCha20-Poly1305 Encryptor/Decryptor_ are using RFC7539's AEAD (Authenticated Encryption Authenticated Data) construction based on ChaCha20 for symmetric encryption and Poly1305 for authentication.
The details of hardware architecture can be found in the README.md in the 1.hw/ directory.
<p align="center">
<img width="60%" src="0.doc/Wireguard/wireguard-fpga-muxed-Architecture-SW.webp">
</p>
The conceptual class diagram provides an o of the components in the software part of the system without delving into implementation details. The focus is on the WireGuard Agent, which implements the 协议's handshake procedures, along with the following supplementary components:
The details of software architecture can be found in the README.md in the 2.sw/ directory.
<p align="center">
<img width="70%" src="0.doc/Wireguard/wireguard-fpga-muxed-Example-Topology.webp">
</p>
The detailed analysis can be found in the README.md in the 1.hw/ directory.
The Wireguard FPGA test bench aims to have a flexible approach to simulation which allows a common test en to be used whilst selecting between alternative CPU components, one of which uses the _ processor co-simulation element. This allows simulations to be fully HDL, with a RISC- RTL implementation such as picoRV32, IBEX or EDUBOS5, or to co-simulate software using the processor, with a significant speed up in simulation times. The test bench has the following features:
* A _ processor based soc_cpu.VPROC component
* Selectable between this or an RTL softcore
* Can run natively compiled test code
* Can run the application compiled natively with the auto-generated co-sim HAL
* Can run RISC- 代码 using the rv32 RISC-V ISS model
* Uses a C sparse memory model
* An HDL component instantiated in logic gi access to this memory
* An API is provided to _ running code for direct access
* The _udpIpPg VIP_ is used to drive the logic's four ethernet ports in a four port bfm_ethernet block.
* An MDIO sla is also provided that maps *mem_model* memory areas to the registers with instantiated *mem_model* components
The figure below shows an o block diagram of the test bench HDL.
<p align="center">
<img src=" width=600>
</p>
More details on the architecture and usage of the Wireguard test bench can be found in the README.md in the 4.sim directory.
The Wireguard control and status register harware abstraction layer (HAL) software is auto-generated, as is the CSR RTL, using peakrdl. For co-simulation purposes an additional layer is auto-generated from the same SystemRDL specification using systemrdl-compiler that accompanies the peakrdl tools. This produces two header files that define a common API to the application layer for both the RISC- and the *VProc* based co-simulation en. The details of the HAL generation can be found in the README.md in the 3.build/ directory.
3.build/ directory.6.test/ directory.<p align="center">
<img width="70%" src="0.doc/Wireguard/wireguard-fpga-Test-Topology.webp">
</p>
---
This project in the final wrap up phase. The checkmarks below indicate status. Until all checkmarks are in place, anything you get from here is w/o guaranty -- Use at own risk, as you see fit, and don't blame us if it is not working 🌤️
While the board we're using is low cost, it is also not particularly known in the open-源码 community. We certainly don’t ha experience with it. In this opening take we will build a solid foundation for efficient project execution. Good preparation is crucial for a smooth run. We thus seek to first _understand and document what we will be designing: SOC Architecture, Datapath Microarchitecture, Hardware/Software Partitioning, DV and Strategy_.
Getting a good feel for our Fmax is also a goal of this take. Artix-7 does not support High-Performance (HP) I/O. Consequently, we cannot push its I/O beyond 600MHz, nor its core logic beyond 100 MHz.
It it in this take that we start creating hardware Datapath and hardening Wireguard encryption protocols, all using and Xilinx primitives.
- _Cur module for key exchange -- Likely in software at this point
-
- _blake2_ module for hashing (we'll most likely do it in software)
-
This work package is about hardware/software codesign and integration. The firmware will run on a soft RISC , inside the FPGA. Our SOC is at this point starting to be customized to Wireguard needs. This work can to some extent go on in parallel with hardware acti of Take2.
This is about managing the bring-up, maintenance and tear-down of between two devices.
The objective of this optional deli is to ensure stable and efficient links, thus taking this project one step closer to a deployable product.
<p align="center">
<img src="
<img width="20%" alt="NGI-Entrust-Logo" src="
</p>
This project was funded through the NGI0 Entrust Fund, a fund established by NLnet with financial support from the European Commission's Next Generation Internet programme, under the aegis of DG Communications Networks, Content and Technology under grant agreement No 101069594.
The wy's wisdom and contribution made a great deal of difference -- Thank you, we are honored to have you on the project.
<p align="center">
<img width="15%" alt="wy" src="0.doc/artwork/VProc.logo.png">
</p>
If it was not for Julian Kemmerer's unreser helping us move our two cryptography blocks from C to gates, be it by guiding and mentoring, or by doing it himself, the meat of this project would not have been so easily pushed through to hardware using PipelineC. Thank you Mr.OpensourceHLS 🙏.
<p align="center">
<img width="50%" src="0.doc/artwork/pipelineC.logo.png">
</p>
#### End of Document
开发语言:
Star 数:1363
该项目属于黑客技术方向的开源资源,代码结构清晰,适合安全研究人员学习参考。项目围绕Full-throttle, wire-speed hardware implementation of Wireguard VPN, using low-cost Artix7 FPGA with opensource toolchain. If you seek security and privacy, nothing is private in our codebase. Our door is wide open for backdoor scrutiny, be it related to RTL, embedded, build, bitstream or any other aspect of design and delivery package. Bujrum!展开,提供了可运行的实现,对理解相关安全机制、工具原理与攻防技术具有较高的研究价值。
从技术实现角度看,此类项目的核心在于对底层原理的深入理解与工程化落地。开发者在研究过程中可以结合官方文档与社区讨论,梳理项目的初始化流程、核心模块职责与数据流转,逐步掌握其中的技术细节与设计思路。
1. 下载源码压缩包,解压到本地环境。
2. 根据项目类型准备对应的运行环境与依赖。
3. 按照 README 中的步骤完成配置与部署。
4. 在隔离的测试环境中运行验证,避免影响生产系统。
本资源来源于开源社区,仅供安全研究、技术学习与合法授权范围内的攻防演练使用,请勿用于任何非法或侵害他人权益的用途。使用本项目产生的一切后果由使用者自行承担。
| 资源标题 | wireguard-fpga - Full-throttle, wire-speed hardware implementation |
| 所属分类 | 黑客技术 |
| 发布作者 | admin |
| 发布时间 | 2026-10-05 22:15:13 |
| 下载权限 | 免费下载 |
| 附件数量 | 2 个下载链接 |
| 浏览次数 | 111 |
| 讨论数量 | 0 |
| 主题状态 | 正常讨论中 |