Skip to content

ddup: remove openssl dependency (#535) - #681

Open
jeking3 wants to merge 1 commit into
hpc:mainfrom
jeking3:remove-openssl-sha256
Open

ddup: remove openssl dependency (#535)#681
jeking3 wants to merge 1 commit into
hpc:mainfrom
jeking3:remove-openssl-sha256

Conversation

@jeking3

@jeking3 jeking3 commented Jul 23, 2026

Copy link
Copy Markdown

The ddup command uses SHA256 to identify files with identical content and prints each duplicate's digest to stdout. Because that digest is user-visible output, changing the hash algorithm could be a breaking change. Instead, we leverage a permissively-licensed (public-domain), portable SHA256 implementation to sever the dependency on openssl. This lets us build on newer operating systems that have dropped the openssl 1.1 low-level SHA API. This builds under ubuntu 26.04 inside a container, for example.

The SHA256 implementation is from Brad Conte's public domain solution and a known-answer regression test was added.

In the future, if a higher-performing content comparison is desired, it can be added via a new command-line option and/or by embedding the hash choice into any future output or cache format, defaulting to SHA256. That default could change in a later major release.

This fixes #535.

The `ddup` command uses SHA256 to identify files with identical content
and prints each duplicate's digest to stdout. Because that digest is
user-visible output, changing the hash algorithm would be a breaking
change. Instead, we vendor a permissively-licensed (public-domain),
portable SHA256 implementation to sever the dependency on openssl. This
lets us build on newer operating systems that have dropped the openssl
1.1 low-level SHA API.

The SHA256 implementation is from Brad Conte's public domain solution
and a known-answer regression test was added.

This builds under ubuntu 26.04 inside a continer.

In the future, if a higher-performing content comparison is desired, it
can be added via a new command-line option and/or by embedding the hash
choice into any future output or cache format, defaulting to SHA256. That
default could change in a later major release, and SHA256 eventually
dropped.

This fixes hpc#535.

Signed-off-by: Jim King <jimk@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ddup hashing and openssl 3.x

1 participant