From 942901aa95b7df96c0dc2b9639f607eaf61715cb Mon Sep 17 00:00:00 2001 From: Bill Date: Mon, 14 Sep 2026 15:58:02 -1000 Subject: [PATCH 1/2] Add RIPEMD160 digest support Versions of OpenSSL prior to 3.0.0 included RIPEMD160 support, but versions including 3.0.0 through 3.0.6 placed this in a legacy library; this was reverse and RIPEMD160 support is included in the main library of OpenSSL since v3.0.7. Current Julia's OpenSSL support is well past 3.0.7, so RIPEMD160, well popularized by its use in Bitcoin, is in libcrypto already. This patch adds RIPEMD160 digest support. --- src/OpenSSL.jl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/OpenSSL.jl b/src/OpenSSL.jl index 976fb9a..5adcbd1 100644 --- a/src/OpenSSL.jl +++ b/src/OpenSSL.jl @@ -1188,6 +1188,12 @@ EvpSHA512()::EvpDigest = EvpDigest(ccall((:EVP_sha512, libcrypto), Ptr{Cvoid}, ( EvpDSS1()::EvpDigest = EvpDigest(ccall((:EVP_dss1, libcrypto), Ptr{Cvoid}, ())) +if v"3.0.0" <= version_number() <= v"3.0.6" + EvpRIPEMD160() = error("this version of OpenSSL does not support RIPEMD160") +else + EvpRIPEMD160()::EvpDigest = EvpDigest(ccall((:EVP_ripemd160, libcrypto), Ptr{Cvoid}, ())) +end + """ EVP Message Digest Context. """ From f75a954e40daced547e7f5cb69f7dec509931b80 Mon Sep 17 00:00:00 2001 From: Jacob Quinn Date: Wed, 30 Sep 2026 10:32:35 -0600 Subject: [PATCH 2/2] Test RIPEMD160 against the reference vector for "abc" Co-Authored-By: Claude Opus 5.5 --- test/runtests.jl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/runtests.jl b/test/runtests.jl index 15479d2..f6b0da9 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -272,6 +272,9 @@ end @testset "Hash" begin res = digest(EvpMD5(), IOBuffer("The quick brown fox jumps over the lazy dog")) @test res == UInt8[0x9e, 0x10, 0x7d, 0x9d, 0x37, 0x2b, 0xb6, 0x82, 0x6b, 0xd8, 0x1d, 0x35, 0x42, 0xa4, 0x19, 0xd6] + if !(v"3.0.0" <= OpenSSL.version_number() <= v"3.0.6") + @test bytes2hex(digest(OpenSSL.EvpRIPEMD160(), IOBuffer("abc"))) == "8eb208f7e05d987a9b044a8e98c6b087f15a0bfc" + end end @testset "SelfSignedCertificate" begin