JuliaWeb / JuliaWeb/OpenSSL.jl

Add RIPEMD160 support

Open Beginner friendly
#70 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Julia
Stars
19
Forks
16
PR merge metrics
No merged PRs in 30d

Description

Currently OpenSSL.jl does not include support for RIPEMD160. After having been moved to legacy in OpenSSL 3.0, later versions of OpenSSL 3 and OpenSSL 4 all suppport the digest type. This can be easily added to OpenSSL.jl as follows:

using OpenSSL

EvpRIPEMD160()::OpenSSL.EvpDigest = OpenSSL.EvpDigest(ccall((:EVP_ripemd160, OpenSSL.libcrypto), Ptr{Cvoid}, ()))

ctx = EvpDigestContext()
digest_init(ctx, EvpRIPEMD160())
digest_update(ctx, UInt8.(codeunits("hello")))
@show hash1 = digest_final(ctx) # 20-byte Vector{UInt8}

@show hash2 = digest(EvpRIPEMD160(), IOBuffer("hello"))

@show hash1 == hash2

Would a patch for this be useful here? If we let things fail in OpenSSL early versions it is a one-liner patch to add EvpRIPEMD160(), otherwise it may need several lines to add both EvpRIPEMD160() and load_legacy_provider() for early 3.0 OpenSSL.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading the existing digest constructors and the EvpDigest, digest_init, digest_update, digest_final, and digest entry points in OpenSSL.jl. Try the RIPEMD160 example from the issue against the supported OpenSSL versions; done means EvpRIPEMD160 is available and both shown hashing paths produce the same 20-byte digest.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
cryptography
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.