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

Astra Linux crypt variants using GOST R 34.11-94 or GOST R 34.11-2012 #5533

Merged
merged 1 commit into from
Sep 13, 2024

Conversation

magnumripper
Copy link
Member

@magnumripper magnumripper commented Sep 11, 2024

The former is 256-bit. The latter is 256 or 512-bit and also known as Streebog. The formats exactly match Drepper's sha256crypt and sha512crypt, with the hash primitive replaced with one of the GOST alternatives.

gost94crypt ($gost94hash$)
streebog256crypt ($gost12256hash$)
streebog512crypt ($gost12512hash$)

The former is 256-bit. The latter is 256 or 512-bit and also known as Streebog.
The formats exactly match Drepper's sha256crypt and sha512crypt but with the
hash primitive replaced with one of the GOST alternatives.

gost94crypt      ($gost94hash$)
streebog256crypt ($gost12256hash$)
streebog512crypt ($gost12512hash$)
Copy link
Member

@solardiz solardiz left a comment

Choose a reason for hiding this comment

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

OK, let's get these in, although I doubt all 3 are in active use.

#endif

/* Repeatedly run the collected hash value through Streebog to burn CPU cycles. */
#pragma unroll HASH_LOOPS
Copy link
Member

Choose a reason for hiding this comment

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

I guess this unroll produces truly a lot of code. We should be able to optimize this without so much code later (not in this PR).

@magnumripper
Copy link
Member Author

What's with the circleci stall? Should I ignore it and merge? I can't seem to click it for looking into it.

We should be able to optimize this without so much code later (not in this PR)

Yeah, best have a version with readable code in history before going crazy with it. Actually, I based these CPU formats on pristine versions of sha256crypt and sha512crypt formats from our Git history, that was handy for sure (before that, I tried basing it on the current versions with Jim's tweaks but something failed and I lost interest).

@solardiz
Copy link
Member

What's with the circleci stall? Should I ignore it and merge? I can't seem to click it for looking into it.

Same here. I think yes, you should ignore it and merge. Thank you!

@claudioandre-br
Copy link
Member

What's with the circleci stall?

The "stall" means that an administrator must review the (branch protection) rules. As seen in:

Repository administrators can add constraints like this to branches using branch protection rules. For more information, see "About protected branches."

The ci/circleci: non-SIMD should no longer be required.

@magnumripper magnumripper merged commit c8d1fc8 into openwall:bleeding-jumbo Sep 13, 2024
31 of 32 checks passed
@magnumripper magnumripper deleted the gostcrypt branch September 13, 2024 16:56
@solardiz
Copy link
Member

The ci/circleci: non-SIMD should no longer be required.

I've just removed it from required checks, and somehow this resulted in it disappearing from pending checks completely. I have no idea why it was getting stalled lately nor why it disappeared completely when not required.

@claudioandre-br
Copy link
Member

Just to let you know in case you get stuck and bored in an airport:

Testing: bitwarden-opencl, Bitwarden Password Manager [PBKDF2-SHA256 AES OpenCL]... PASS
Testing: blockchain-opencl, blockchain My Wallet (v2 x5000) [PBKDF2-SHA1 AES OpenCL]... PASS
Testing: cloudkeychain-opencl, 1Password Cloud Keychain [PBKDF2-SHA512 AES OpenCL]... PASS
##[warning]Free memory is lower than 5%; Currently used: 97.07%
##[warning]Free memory is lower than 5%; Currently used: 97.07%
##[warning]Free memory is lower than 5%; Currently used: 97.07%
##[warning]Free memory is lower than 5%; Currently used: 97.07%
Testing: streebog256crypt-opencl, Astra Linux $gost12256hash$ (rounds=5000) [GOST R 34.11-2012 OpenCL]... run_tests.sh: line 304:  6476 Killed                  "$JTR_BIN" -test-full=0 --format=opencl

Various formats work there:

[...]
Testing: zed-opencl, Prim'X Zed! encrypted archives [PKCS#12 PBE (SHA1/SHA256) OpenCL]... PASS
Testing: ZIP-opencl, WinZip [PBKDF2-SHA1 OpenCL]... PASS
All 72 formats passed self-tests
 Ok: -test-full=0 --format=opencl

It is Intel CPU driver:

Platform #0 name: Intel(R) OpenCL, version: OpenCL 3.0 LINUX
    Device #0 (1) name:     Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz
    Device vendor:          Intel(R) Corporation
    Device type:            CPU (LE)
    Device version:         OpenCL 3.0 (Build 0)
    OpenCL version support: OpenCL C 3.0 
    Driver version:         2023.16.10.0.17_160000 

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.

3 participants