Skip to content

refactor(crypto): implement argon2id in-tree, drop conan-odr-index - #655

Merged
andiwand merged 3 commits into
mainfrom
handrolled-argon2
Aug 2, 2026
Merged

refactor(crypto): implement argon2id in-tree, drop conan-odr-index#655
andiwand merged 3 commits into
mainfrom
handrolled-argon2

Conversation

@andiwand

@andiwand andiwand commented Aug 2, 2026

Copy link
Copy Markdown
Member

🤖 Generated with Claude Code

argon2/20190702-odr was the last recipe this repo pulled from conan-odr-index. It only existed because upstream's Makefile cannot cross-compile for Android, and ConanCenter declined to carry the fix — upstream has been unmaintained since 2021, so the patch would never go away. (Proposed upstream anyway: P-H-C/phc-winner-argon2#392.)

We use exactly one function of it, so this implements Argon2id in crypto_argon2.* (~300 lines) on top of Crypto++'s BLAKE2b instead of taking on another dependency:

  • Crypto++ has no Argon2 and has had no release since 8.9.0 (2023)
  • libsodium hardcodes p=1; LibreOffice writes p=4
  • Botan and OpenSSL both work but mean a second full crypto library

util::argon2id keeps its signature, so nothing above crypto/ changes. Bad parameters now throw std::invalid_argument instead of silently returning zeros, which is what argon2id_hash_raw's ignored return code used to do.

With that gone, everything resolves from ConanCenter, so the second commit drops the conan-odr-index submodule: no more checkout/export steps in the six workflows that had them, and the conan cache keys lose the submodule sha. The index itself stays where it is — other repos still use it, and its odrcore recipe still serves released 5.x.

Verification

  • The reference implementation's published Argon2id vectors, plus vectors generated from it for the multi-lane cases it does not publish — including LibreOffice's t=3, m=65536, p=4.
  • 400 randomised cross-checks against the reference implementation (lanes 1–8, iterations 1–5, memory spanning the rounding boundary, tags 4–303 bytes, random passwords and salts): all identical.
  • conan graph info . --lockfile conan.lock resolves from a clean conan home with only conancenter, for both the default and the android-armv8 host profile.

Sequential lanes, so no threading: ~66 ms vs ~28 ms for LibreOffice's parameters, once per document open.

andiwand and others added 2 commits August 2, 2026 20:02
The argon2 package was the last recipe we carried in conan-odr-index that
ConanCenter does not have. It only existed because upstream's Makefile
cannot cross-compile for Android, and ConanCenter declined the fix since
upstream has been unmaintained since 2021.

Argon2id on top of Crypto++'s BLAKE2b is ~300 lines, so implement it
rather than swap in another crypto library: Crypto++ has no Argon2,
libsodium hardcodes p=1 while LibreOffice writes p=4, and Botan/OpenSSL
would be a second full crypto stack.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PZSnvAQFbn3MsD5tt5JGz3
argon2 was the last recipe this repo pulled from it; everything else
resolves from ConanCenter. CI no longer checks the submodule out or
exports it, and the conan cache keys lose the submodule sha.

The index itself stays where it is — other repos still use it, and its
odrcore recipe still serves released 5.x.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PZSnvAQFbn3MsD5tt5JGz3
@andiwand andiwand changed the title refactor(crypto): implement argon2id in-tree, drop the argon2 dependency refactor(crypto): implement argon2id in-tree, drop conan-odr-index Aug 2, 2026
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PZSnvAQFbn3MsD5tt5JGz3
@andiwand
andiwand merged commit 9d50dc6 into main Aug 2, 2026
24 checks passed
@andiwand
andiwand deleted the handrolled-argon2 branch August 2, 2026 18:37
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.

1 participant