Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crypto modern api #18

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Crypto modern api #18

wants to merge 6 commits into from

Conversation

NelsonVides
Copy link
Collaborator

@NelsonVides NelsonVides commented Feb 17, 2025

Solves #14, and also implements the SHA3 family of algorithms, which turned out to be a low hanging fruit after the API migration.

@codecov-commenter
Copy link

codecov-commenter commented Feb 17, 2025

Codecov Report

Attention: Patch coverage is 61.37931% with 56 lines in your changes missing coverage. Please review.

Project coverage is 61.90%. Comparing base (9055d60) to head (d7957cb).

Files with missing lines Patch % Lines
c_src/fast_pbkdf2.c 61.37% 56 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main      #18       +/-   ##
===========================================
- Coverage   89.94%   61.90%   -28.04%     
===========================================
  Files           2        2               
  Lines         179      189       +10     
  Branches       13       44       +31     
===========================================
- Hits          161      117       -44     
- Misses         18       72       +54     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@NelsonVides NelsonVides linked an issue Feb 18, 2025 that may be closed by this pull request
@NelsonVides NelsonVides marked this pull request as ready for review February 18, 2025 10:46
README.md Outdated Show resolved Hide resolved
rebar.config Outdated
@@ -32,7 +31,7 @@
{port_env,
[
{"(linux|solaris|freebsd|netbsd|openbsd|dragonfly|darwin|gnu)",
"CFLAGS", "$CFLAGS -std=c99 -O3 -g -Wall -Wextra -Wundef -Werror=undef -fPIC -I/opt/homebrew/include -I/usr/local/include"},
"CFLAGS", "$CFLAGS -std=c99 -O3 -g -Wall -Wextra -Werror -fPIC -I/opt/homebrew/include -I/usr/local/include"},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe the homebrew path is different for ARM and Intel based macbooks, but it's anyway a bad idea to add homebrew paths in rebar.config

EVP_MD_CTX *outer;
} HMAC_md_ctx;

#define DECL_PBKDF2(_name, _blocksz, _hashsz, _iters_per_slot) \
Copy link
Member

@chrzaszcz chrzaszcz Feb 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While I understand that this has changed completely, there was a useful description here. Without it, the code might be harder to understand.

This is the main rework. I initially wrote the standard functions for
SHA1, and only later refactored to extract all SHA1 specifics into macro
parameters, so that all other algorithms could be generated by the
macro.
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.

OpenSSL3 deprecation warnings
4 participants