[GH-ISSUE #2229] Argon2d/i cleanup #1491

Closed
opened 2026-10-15 04:18:34 +07:00 by bsakaguchi · 9 comments
Owner

Originally created by @frank-dittrich on GitHub (Aug 22, 2016).
Original GitHub issue: https://github.com/openwall/john/issues/2229

There are still some diagnostics printed with default verbosity:

$  ./john --test=0 |LC_ALL=C grep -C 2 -v PASS 
Testing: aix-ssha256, AIX LPA {ssha256} [PBKDF2-SHA256 128/128 AVX 4x]... PASS
Testing: aix-ssha512, AIX LPA {ssha512} [PBKDF2-SHA512 128/128 AVX 2x]... PASS
Testing: argon2d [Blake2 AVX]... 
memory per hash : 16,00 MB
PASS
Testing: argon2i [Blake2 AVX]... 
memory per hash : 16,00 MB
PASS
Testing: asa-md5, Cisco ASA [md5($p.$s) (Cisco ASA) 128/128 AVX 4x3]... PASS
--
Testing: dummy [N/A]... PASS
Testing: crypt, generic crypt(3) DES [?/64]... PASS
All 354 formats passed self-tests!

argon2d_fmt_plug.c and argon2i_fmt_plug.c ar both executable.

Looking at the diff or at the similarities between argon2d_fmt_plug.c and argon2i_fmt_plug.c, I think some more stuff can be moved to a common file, e.g. argon2_core_plug.c.

Those argon2 specific functions defined in argon2_core_plug.c etc. should be renamed, using a prefix argon2_ or similar, to avoid polluting the global name space (and possible future name collisions with core).

Originally created by @frank-dittrich on GitHub (Aug 22, 2016). Original GitHub issue: https://github.com/openwall/john/issues/2229 1. There are still some diagnostics printed with default verbosity: ``` $ ./john --test=0 |LC_ALL=C grep -C 2 -v PASS Testing: aix-ssha256, AIX LPA {ssha256} [PBKDF2-SHA256 128/128 AVX 4x]... PASS Testing: aix-ssha512, AIX LPA {ssha512} [PBKDF2-SHA512 128/128 AVX 2x]... PASS Testing: argon2d [Blake2 AVX]... memory per hash : 16,00 MB PASS Testing: argon2i [Blake2 AVX]... memory per hash : 16,00 MB PASS Testing: asa-md5, Cisco ASA [md5($p.$s) (Cisco ASA) 128/128 AVX 4x3]... PASS -- Testing: dummy [N/A]... PASS Testing: crypt, generic crypt(3) DES [?/64]... PASS All 354 formats passed self-tests! ``` 2. argon2d_fmt_plug.c and argon2i_fmt_plug.c ar both executable. 3. Looking at the diff or at the similarities between argon2d_fmt_plug.c and argon2i_fmt_plug.c, I think some more stuff can be moved to a common file, e.g. argon2_core_plug.c. 4. Those argon2 specific functions defined in argon2_core_plug.c etc. should be renamed, using a prefix argon2_ or similar, to avoid polluting the global name space (and possible future name collisions with core).
Author
Owner

@magnumripper commented on GitHub (Aug 22, 2016):

The "memory per hash" is gone with 7ec4a732, no? I don't get that output here (beware of john-local.conf).

I agree with the rest.

<!-- gh-comment-id:241489782 --> @magnumripper commented on GitHub (Aug 22, 2016): The "memory per hash" is gone with 7ec4a732, no? I don't get that output here (beware of john-local.conf). I agree with the rest.
Author
Owner

@frank-dittrich commented on GitHub (Aug 22, 2016):

The "memory per hash" is gone with 7ec4a73, no?

My fault.

(beware of john-local.conf).

Confirmed. With --verbosity=3 added, the output is gone.

<!-- gh-comment-id:241490988 --> @frank-dittrich commented on GitHub (Aug 22, 2016): > The "memory per hash" is gone with 7ec4a73, no? My fault. > (beware of john-local.conf). Confirmed. With --verbosity=3 added, the output is gone.
Author
Owner

@jfoug commented on GitHub (Aug 23, 2016):

I am working on this. 4. is being handled by simply making a single format that handles both type d and type i. There is no notable differences within the formats. Why have 2.

<!-- gh-comment-id:241775513 --> @jfoug commented on GitHub (Aug 23, 2016): I am working on this. 4. is being handled by simply making a single format that handles both type d and type i. There is no notable differences within the formats. Why have 2.
Author
Owner

@jfoug commented on GitHub (Aug 23, 2016):

If you can spot any other cleanup issues, please post, but I think this format(s) is now cleaned up when viewed from 'outside' (i.e. not trying to change any of the algorithms or original coding intentions).

<!-- gh-comment-id:241794192 --> @jfoug commented on GitHub (Aug 23, 2016): If you can spot any other cleanup issues, please post, but I think this format(s) is now cleaned up when viewed from 'outside' (i.e. not trying to change any of the algorithms or original coding intentions).
Author
Owner

@magnumripper commented on GitHub (Aug 23, 2016):

Isn't argon2i_fmt_plug.c supposed to be deleted? And if not, it still has exec bit set.

<!-- gh-comment-id:241794850 --> @magnumripper commented on GitHub (Aug 23, 2016): Isn't argon2i_fmt_plug.c supposed to be deleted? And if not, it still has exec bit set.
Author
Owner

@jfoug commented on GitHub (Aug 23, 2016):

It was deleted. Did the push not get it removed??? I had a damn merge conflict due to your changes (the VERB_LEGACY stuff). But in the end, my commit did show that argon2i_fmt_plug.c was deleted, and argon2d_fmt_plug.c renamed to argon2_fmt_plug.c

After a git pull, you are still seeing the argon2i_fmt_plug.c file?

<!-- gh-comment-id:241798580 --> @jfoug commented on GitHub (Aug 23, 2016): It was deleted. Did the push not get it removed??? I had a damn merge conflict due to your changes (the VERB_LEGACY stuff). But in the end, my commit did show that argon2i_fmt_plug.c was deleted, and argon2d_fmt_plug.c renamed to argon2_fmt_plug.c After a git pull, you are still seeing the argon2i_fmt_plug.c file?
Author
Owner

@jfoug commented on GitHub (Aug 23, 2016):

Removed. I had to add it again, then push. Should be gone now (I hope).

<!-- gh-comment-id:241799112 --> @jfoug commented on GitHub (Aug 23, 2016): Removed. I had to add it again, then push. Should be gone now (I hope).
Author
Owner

@magnumripper commented on GitHub (Aug 23, 2016):

After a git pull, you are still seeing the argon2i_fmt_plug.c file?

Sure. You can see in 5a7cc9f that it's not deleted (or even mentioned in that commit).

<!-- gh-comment-id:241799113 --> @magnumripper commented on GitHub (Aug 23, 2016): > After a git pull, you are still seeing the argon2i_fmt_plug.c file? Sure. You can see in 5a7cc9f that it's not deleted (or even mentioned in that commit).
Author
Owner

@magnumripper commented on GitHub (Aug 23, 2016):

Yeah, now it's gone.

<!-- gh-comment-id:241799370 --> @magnumripper commented on GitHub (Aug 23, 2016): Yeah, now it's gone.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
openwall/john#1491
No description provided.