Commit Graph

44 Commits

Author SHA1 Message Date
PartialVolume
fc308b3f34 Bump to V0.40, update CHANGELOG.md 2025-12-08 21:26:19 +00:00
PartialVolume
6eae95b995 Merge pull request #655 from deamen/master
Add static linking libraries that are required by parted 3.6
2025-12-07 16:23:47 +00:00
PartialVolume
ccf8eed4ed Merge branch 'master' into kernel-aes-ni 2025-11-26 21:14:23 +00:00
Extloga
39ee8cfc91 Update version number to 0.39 in configure.ac 2025-09-19 06:18:13 +02:00
Fabian Druschke
5af773eaac Implement high-performance AES-256-CTR PRNG via Linux kernel AF_ALG socket
Problem
=======
The OpenSSL-based prelimininary, not yet committed userspace PRNG in nwipe
plateaued at ~250 MB/s, becoming the primary bottleneck when wiping modern
NVMe or RAID volumes that sustain gigabytes per second.

Solution
========
Replace the OpenSSL path with a kernel-accelerated AES-256-CTR generator that
streams 16 KiB keystream blocks through the AF_ALG “ctr(aes)” skcipher:

* Added aes_ctr_prng.cpp/.h
  • Opens a per-thread AF_ALG operation socket once (lazy init).
  • Builds a two-CMSG `sendmsg()` (ALG_SET_OP + ALG_SET_IV) and a single
    `read()` per chunk – minimal syscall overhead.
  • Public state (aes_ctr_state_t) intentionally remains 256 bit to preserve
    ABI compatibility; socket FD is kept thread-local.
  • Generates exactly 16 KiB per call, advancing an internal 128-bit counter.

* Comprehensive English comments explain every function, the ABI rationale and
  the kernel interaction pattern.

Performance
-----------
On a Ryzen 9 7950X (VAES):
  • Old OpenSSL path: ~260 MB/s
  • New AF_ALG path : ~6.2 GB/s  (≈ 24× faster, CPU-bound at ~7 % load)

Safety & Compatibility
----------------------
* Falls back automatically to the kernel’s software AES if AES-NI/VAES/SVE are
  absent – no code changes required.
* No external dependencies beyond standard linux-headers.
* Optional `aes_ctr_prng_shutdown()` closes the FD, though the kernel would
  reclaim it on exit anyway.

Testing
-------
* Added unit tests for counter wraparound and deterministic output with a
  fixed seed (compared to OpenSSL reference vectors).
* Verified multi-threaded wiping on a 4 × NVMe RAID-0 → sustained device speed,
  PRNG never starved the pipeline.

Future work
-----------
* Expose chunk size as a tunable CLI flag.
* Optionally copy keystream directly into the kernel’s page cache via `splice`.

Closes: #559 (Implement High-Quality Random Number Generation Using AES-CTR Mode with OpenSSL and AES-NI Support)
2025-05-28 22:32:18 -03:00
Song Tang
16d9885577 Remove libintl from static linking library
It is not needed with parted-3.6
2025-04-09 13:22:30 +10:00
Song Tang
51e3caeb18 Conditionally check static libraries 2025-04-09 12:52:32 +10:00
PartialVolume
9856cecd45 Bump version to v0.38 2025-01-08 22:23:15 +00:00
PartialVolume
4394f24245 Bump to v0.37 2024-05-08 21:31:53 +01:00
Lars Wendler
fca8937f26 configure.ac: Fix check for parted
PKG_CHECK_MODULES needs all modules in a single list or else the following
error message appears during configure run:

  ./configure: 6807: libconfig: not found

because the macro interprets "[libconfig]" as the action that needs to be
done if parted was found.

Removed superfluous check for libconfig as requested by PartialVolume
2024-05-06 19:34:02 +02:00
PartialVolume
230e7f524a Bump to v0.36 2024-02-20 19:52:25 +00:00
PartialVolume
07a7c0ab0c Fix some strcpy compiler warnings
Replace three strcpy commands with strncpy,
bump minor version ready for more testing.
2024-02-17 17:00:37 +00:00
Michal Ambroz
a70fa15bac lower the build requirements
Hello,
please lower the requirements to autoconf allowing to build rhel7/8 packages (possibly rhel6, not tested).
Thank you
Michal Ambroz
2023-11-03 22:51:59 +01:00
PartialVolume
f3179cf748 Bump version to 0.35 2023-11-01 20:07:33 +00:00
Gerold Gruber
bbcb4fc219 fix for issue #492 2023-10-01 23:45:48 +02:00
PartialVolume
dbde867974 nwipe_conf_001 Add /etc/nwipe/nwipe.conf
1. Started constructing the code we will use to access
and write to /etc/nwipe/nwipe.conf. The initial use of
the nwipe.conf file will be to hold information such
as organisation and technician details that will be used
on the PDF report certificate. We are using the libconfig
library enable us to read and write the conf file. libconfig
is very well documented so editing the conf file manually
should be pretty straight forward. Nwipe will build a basic
conf file to give the user an idea how it should be edited.

2. Updated the README.md, showing the libconfig-dev, libconfig++-dev
needs to be installed.

3. Added some information about the use of hdparm to detect hidden
sectors and also noted that as from v0.35 nwipe will detect hidden
sectors, and may well have an extra method to expose those hidden#
sectors by restoring the DCO.
2023-03-17 23:18:39 +00:00
Martijn van Brummelen
099d380f3c bump 0.34 2022-07-08 13:18:18 +02:00
PartialVolume
f63862d042 Bump to v0.33
Updated:
CHANGELOG.md
configure.ac
man/nwipe.1
src/version.c
2022-03-20 14:11:46 +00:00
PartialVolume
753e758b0a Update files for 0.32 release
Confirmed the following release files were/are updated.
configure.ac
CHANGELOG.md
nwipe.1
version.c
2021-10-28 23:34:46 +01:00
PartialVolume
a88eeb9383 Update to 0.31 2021-06-05 19:40:00 +01:00
PartialVolume
be0de995f8 Update configure.ac for 0.30 release 2020-12-09 17:10:43 +00:00
PartialVolume
e33c1bb06d Add --autopoweroff option
Fix non working --nowait option.
Update version info to 0.29-release candidate
2020-03-11 23:44:11 +00:00
PartialVolume
cc82687cf3 Release 0.28 2020-03-11 16:44:13 +00:00
PartialVolume
95ab80cc68 Fix window/panel resizing & display when terminal resized by user
Also fixes an issue where program exits when terminal resized but
only after all the wipes have finished. You can now resize the
terminal, before, during and after the wipes have completed and
the windows are now all correctly updated and sized.

Updated version to 0.28-pre-release

Removed unnecessary zero of gui thread pointer.

Created six new functions in gui.c in order to fix the above problem
and reduce existing duplicated code.
2020-03-08 01:42:47 +00:00
PartialVolume
97e5591fd5 Release 0.27 2020-03-03 20:38:47 +00:00
louib
af0fdadc88 Creating subdirs for third-party modules.
Since these modules are considered third-party (at
least for now) and we also don't want to apply
formatting to them.

Also removed the `AUTOMAKE_OPTIONS` from `Makefile.am` since
it would appear the `AM_INIT_AUTOMAKE` is actually defining
the automake options.
2020-01-10 18:08:07 -05:00
louib
7c025040b4 Fix AutoConf deprecated warning
This fixes the following AC warning:
```
configure.ac:6: warning: AM_INIT_AUTOMAKE: two- and three-arguments forms are deprecated.  For more info, see:
configure.ac:6: https://www.gnu.org/software/automake/manual/automake.html#Modernize-AM_005fINIT_005fAUTOMAKE-invocation
```

As per the deprecation notice, using `AM_INIT_AUTOMAKE` for setting the
version is mostly obsolete because the package and version can be obtained
from Autoconf’s `AC_INIT` macro.
2019-11-02 19:24:25 -04:00
Martijn van Brummelen
55783c0b8d Update configure.ac 2019-09-04 08:21:10 +02:00
Martijn van Brummelen
baab603809 Version 0.25(change footer) 2018-10-05 22:20:09 +02:00
Martijn van Brummelen
3638eae8d4 change version number and add friendly throughput 2017-12-06 20:28:09 +01:00
Martijn van Brummelen
8f5c05506f v0.23 2017-12-05 20:07:30 +01:00
martijn
95dc8abcf3 fix 32bit issues 2017-12-03 19:07:31 +01:00
Martijn van Brummelen
c8a5a16108 place files in normal location 2017-02-21 22:31:11 +01:00
Martijn van Brummelen
4e64cab3c3 use localtime instead of gmtime for logging 2017-02-13 13:40:00 +01:00
Martijn van Brummelen
0f26c8ea68 use banner and update manpage 2017-02-12 19:05:36 +01:00
Martijn van Brummelen
9c63eef565 Version 0.21 2016-08-24 15:21:30 +02:00
Martijn van Brummelen
ea198137de Merge branch 'panel-headers' of https://github.com/vuntz/nwipe into vuntz-panel-headers 2016-08-04 09:14:37 +02:00
martijn van brummelen
d01b00b4f8 Update Release 0.18 2016-07-27 09:33:17 +02:00
Charles Duffy
edfabad8a1 Add libintl, libuuid dependencies to allow parted static link (#12)
libparted requires libuuid; both require libintl. Static builds currently fail
with link errors due to these missing dependencies.
2015-10-17 15:18:16 -05:00
Martijn
5a63140baf Update version to 0.17 2014-10-19 14:19:44 +02:00
Vincent Untz
51d33b9f61 Fix build when panel header is not in /usr/include
When there's no pkg-config file for the panel library, the build breaks
if the header is not in /usr/include.

At least in openSUSE, we have /usr/include/ncurses.h and
/usr/include/ncurses/panel.h.
2014-09-09 18:19:05 +02:00
Andrew Beverley
86b7b32e37 Update versioning info to v0.16 2014-05-15 09:25:26 +01:00
Andy Beverley
b903056762 Update version number to 0.15 2013-09-07 12:43:47 +01:00
Andy Beverley
b40d4d10c8 Initial commit 2013-09-06 23:38:39 +01:00