[GH-ISSUE #2313] Add 64 bit NEON support #1547

Closed
opened 2026-10-15 04:19:47 +07:00 by bsakaguchi · 13 comments
Owner

Originally created by @jfoug on GitHub (Oct 29, 2016).
Original GitHub issue: https://github.com/openwall/john/issues/2313

I have a raspberry pi3, which is quad-core 64 NEON. I will work at getting full support added for this chip.

Originally created by @jfoug on GitHub (Oct 29, 2016). Original GitHub issue: https://github.com/openwall/john/issues/2313 I have a raspberry pi3, which is quad-core 64 NEON. I will work at getting full support added for this chip.
bsakaguchi 2026-10-15 04:19:47 +07:00
Author
Owner

@magnumripper commented on GitHub (Oct 31, 2016):

Cool. I recall @lei-zz did some work with NEON in GSoC. Was that 32-bit only?

<!-- gh-comment-id:257190607 --> @magnumripper commented on GitHub (Oct 31, 2016): Cool. I recall @lei-zz did some work with NEON in GSoC. Was that 32-bit only?
Author
Owner

@jfoug commented on GitHub (Oct 31, 2016):

All we have right now is 32 bit neon. I am not sure the neon code is any better or not (note, there appears to be many flavors, I am just getting started). But the pi3 IS a 64 bit CPU (first one for the pi family). So even if there are not 'better' neon instructions, the 64 bit should be used, if possible. NOTE, I am still just getting started with the OS. Lots to learn.

<!-- gh-comment-id:257208814 --> @jfoug commented on GitHub (Oct 31, 2016): All we have right now is 32 bit neon. I am not sure the neon code is any better or not (note, there appears to be many flavors, I am just getting started). But the pi3 IS a 64 bit CPU (first one for the pi family). So even if there are not 'better' neon instructions, the 64 bit should be used, if possible. NOTE, I am still just getting started with the OS. Lots to learn.
Author
Owner

@ghost commented on GitHub (Dec 14, 2017):

ICYMI; the neon test (seen below) used in configure.ac succeeds on aarch64 (__ARM_64BIT_STATE - 64-bit targets only).

#include <stdio.h>
	extern void exit(int);
	int main(){uint32x4_t t;*((long*)&t)=1;t=veorq_u32(t,t);if((*(unsigned*)&t)==88)printf(".");exit(0);}
<!-- gh-comment-id:351833398 --> @ghost commented on GitHub (Dec 14, 2017): ICYMI; the neon test (seen below) used in configure.ac succeeds on aarch64 (__ARM_64BIT_STATE - 64-bit targets only). ``` #include <stdio.h> extern void exit(int); int main(){uint32x4_t t;*((long*)&t)=1;t=veorq_u32(t,t);if((*(unsigned*)&t)==88)printf(".");exit(0);} ```
Author
Owner

@jfoug commented on GitHub (Dec 14, 2017):

The Rpi3 is 32 bit, and NEON worked fine. It is a 64 bit CPU, but there is no 64 bit OS built for it. There are sketchy instructions on how to build and bootstrap 64 bit yourself, but that was over my head. So NEON is working fine on 32 bit.

<!-- gh-comment-id:351871083 --> @jfoug commented on GitHub (Dec 14, 2017): The Rpi3 is 32 bit, and NEON worked fine. It is a 64 bit CPU, but there is no 64 bit OS built for it. There are sketchy instructions on how to build and bootstrap 64 bit yourself, but that was over my head. So NEON is working fine on 32 bit.
Author
Owner

@ghost commented on GitHub (Dec 14, 2017):

I was not talking about rpi. Anyway, I can find people that disagree with you.

<!-- gh-comment-id:351872634 --> @ghost commented on GitHub (Dec 14, 2017): I was not talking about rpi. Anyway, I can find people that disagree with you. * https://fedoraproject.org/wiki/Architectures/ARM/Raspberry_Pi#Raspberry_Pi_3_aarch64_support
Author
Owner

@ghost commented on GitHub (Dec 15, 2017):

Well, I posted https://github.com/magnumripper/JohnTheRipper/issues/2313#issuecomment-351833398 because I was able to "(kind of)" do it. I don't have any hardware, I only can access a build server [1]. So, it is no more than a POC.

Created directory: /root/.john
Version: 1.8.1-jumbo-1-430-g8604ae9+
Build: linux-gnu 64-bit NEON-ac OMP
SIMD: NEON, interleaving: MD4:2 MD5:2 SHA1:1 SHA256:1 SHA512:1
Will run 4 OpenMP threads
Testing: Raw-SHA512 [SHA512 128/128 NEON 2x]... (4xOMP) PASS
Testing: Raw-Blake2 [BLAKE2b 512 32/64]... PASS
Testing: Raw-Keccak [Keccak 512 32/64]... (4xOMP) PASS
Testing: Raw-Keccak-256 [Keccak 256 32/64]... (4xOMP) PASS
Testing: Raw-MD4 [MD4 128/128 NEON 4x2]... PASS
Testing: Raw-MD5 [MD5 128/128 NEON 4x2]... PASS
Testing: Raw-MD5u [md5(utf16($p)) 128/128 NEON 4x2]... PASS
Testing: Raw-SHA1 [SHA1 128/128 NEON 4x]... PASS
Testing: Raw-SHA1-AxCrypt [SHA1 128/128 NEON 4x]... PASS
Testing: Raw-SHA1-Linkedin [SHA1 128/128 NEON 4x]... PASS
Testing: Raw-SHA224 [SHA224 128/128 NEON 4x]... (4xOMP) PASS
Testing: Raw-SHA256 [SHA256 128/128 NEON 4x]... (4xOMP) PASS
Testing: Raw-SHA256-ng [SHA256 128/128 NEON 4x]... PASS
Testing: Raw-SHA3 [SHA3 512 32/64]... (4xOMP) PASS
Testing: Raw-SHA384 [SHA384 128/128 NEON 2x]... (4xOMP) PASS
Testing: Raw-SHA512-ng [SHA512 128/128 NEON 2x]... (4xOMP) PASS
All 16 formats passed self-tests!

[edited]

Testing: NT [MD4 128/128 NEON 4x2]... PASS

[1] I can only submit something and wait for a result. No SSH.
😕 People say mainframes used to work like this (I guess I'm becoming an old pal 😢).


Assumptions

  • -mfpu=neon is an arm (32-bit) compiler option. The aarch64 (64-bit) compiler do not accept it.
    • Neon support is optional in the 32-bit arm
    • aarch64 requires FP and SIMD instruction support
<!-- gh-comment-id:351882026 --> @ghost commented on GitHub (Dec 15, 2017): Well, I posted https://github.com/magnumripper/JohnTheRipper/issues/2313#issuecomment-351833398 because I was able to "(kind of)" do it. I don't have any hardware, I only can access a build server [1]. So, it is no more than a POC. * https://github.com/magnumripper/JohnTheRipper/compare/bleeding-jumbo...claudioandre:neon-64 ``` Created directory: /root/.john Version: 1.8.1-jumbo-1-430-g8604ae9+ Build: linux-gnu 64-bit NEON-ac OMP SIMD: NEON, interleaving: MD4:2 MD5:2 SHA1:1 SHA256:1 SHA512:1 ``` ``` Will run 4 OpenMP threads Testing: Raw-SHA512 [SHA512 128/128 NEON 2x]... (4xOMP) PASS Testing: Raw-Blake2 [BLAKE2b 512 32/64]... PASS Testing: Raw-Keccak [Keccak 512 32/64]... (4xOMP) PASS Testing: Raw-Keccak-256 [Keccak 256 32/64]... (4xOMP) PASS Testing: Raw-MD4 [MD4 128/128 NEON 4x2]... PASS Testing: Raw-MD5 [MD5 128/128 NEON 4x2]... PASS Testing: Raw-MD5u [md5(utf16($p)) 128/128 NEON 4x2]... PASS Testing: Raw-SHA1 [SHA1 128/128 NEON 4x]... PASS Testing: Raw-SHA1-AxCrypt [SHA1 128/128 NEON 4x]... PASS Testing: Raw-SHA1-Linkedin [SHA1 128/128 NEON 4x]... PASS Testing: Raw-SHA224 [SHA224 128/128 NEON 4x]... (4xOMP) PASS Testing: Raw-SHA256 [SHA256 128/128 NEON 4x]... (4xOMP) PASS Testing: Raw-SHA256-ng [SHA256 128/128 NEON 4x]... PASS Testing: Raw-SHA3 [SHA3 512 32/64]... (4xOMP) PASS Testing: Raw-SHA384 [SHA384 128/128 NEON 2x]... (4xOMP) PASS Testing: Raw-SHA512-ng [SHA512 128/128 NEON 2x]... (4xOMP) PASS All 16 formats passed self-tests! ``` **[edited]** ``` Testing: NT [MD4 128/128 NEON 4x2]... PASS ``` [1] I can only submit something and wait for a result. No SSH. :confused: People say mainframes used to work like this (I guess I'm becoming an old pal :cry:). ***** Assumptions * `-mfpu=neon` is an arm (32-bit) compiler option. The aarch64 (64-bit) compiler do not accept it. * Neon support is optional in the 32-bit arm * aarch64 requires FP and SIMD instruction support
Author
Owner

@magnumripper commented on GitHub (Dec 24, 2017):

I now have one running Fedora 64-bit (and another running 32-bit) and will test stuff on them. They are funny toys, and dirt cheap.

<!-- gh-comment-id:353807867 --> @magnumripper commented on GitHub (Dec 24, 2017): I now have one running Fedora 64-bit (and another running 32-bit) and will test stuff on them. They are funny toys, and dirt cheap.
Author
Owner

@magnumripper commented on GitHub (Dec 24, 2017):

It's fairly strange that an RPi would easily outrun the first 10 or so full-size computers that I owned (even put together) and still is cheaper than a bottle of mediocre whisky.

:scratches head:

<!-- gh-comment-id:353808006 --> @magnumripper commented on GitHub (Dec 24, 2017): It's fairly strange that an RPi would easily outrun the first 10 or so full-size computers that I owned (even put together) and still is cheaper than a bottle of mediocre whisky. :scratches head:
Author
Owner

@magnumripper commented on GitHub (Apr 8, 2018):

Last time I tried, 64-bit Raspberry Pi works fine, including with NEON (which is auto-detected by ./configure)

<!-- gh-comment-id:379581866 --> @magnumripper commented on GitHub (Apr 8, 2018): Last time I tried, 64-bit Raspberry Pi works fine, including with NEON (which is auto-detected by `./configure`)
Author
Owner

@solardiz commented on GitHub (Jun 27, 2018):

IIRC, when I tested jumbo on an aarch64 Linux system which lists asimd in /proc/cpuinfo, NEON wasn't detected. There's no __ARM_NEON in pre-defined cpp macros on that system. Maybe we should check for Aarch64 and assume that NEON is supported on all of those (I think it must be, even if some tiny as well as some many-core hardware actually "emulates" it with narrower execution units, so speedup from it is uncertain, but at least the code should run).

<!-- gh-comment-id:400791123 --> @solardiz commented on GitHub (Jun 27, 2018): IIRC, when I tested jumbo on an aarch64 Linux system which lists asimd in /proc/cpuinfo, NEON wasn't detected. There's no __ARM_NEON in pre-defined cpp macros on that system. Maybe we should check for Aarch64 and assume that NEON is supported on all of those (I think it must be, even if some tiny as well as some many-core hardware actually "emulates" it with narrower execution units, so speedup from it is uncertain, but at least the code should run).
Author
Owner

@magnumripper commented on GitHub (Jun 27, 2018):

Maybe we should check for Aarch64 and assume that NEON is supported on all of those

That and some other things is what happened between my prior two comments in this issue. Last time I built 64-bit RPi, NEON was detected (indeed inferred from aarch64 IIRC) and everything was fine. Right now I don't have any Pi with 64-bit OS running but I'm planning that ASAP for other reasons so I'll re-check JtR functionality then.

<!-- gh-comment-id:400809507 --> @magnumripper commented on GitHub (Jun 27, 2018): > Maybe we should check for Aarch64 and assume that NEON is supported on all of those That and some other things is what happened between my prior two comments in this issue. Last time I built 64-bit RPi, NEON was detected (indeed inferred from aarch64 IIRC) and everything was fine. Right now I don't have any Pi with 64-bit OS running but I'm planning that ASAP for other reasons so I'll re-check JtR functionality then.
Author
Owner

@solardiz commented on GitHub (Jun 27, 2018):

Great. I'll need to retest as well. There are 64-bit ARM machines in GCC Compile Farm, you could test on those.

<!-- gh-comment-id:400813445 --> @solardiz commented on GitHub (Jun 27, 2018): Great. I'll need to retest as well. There are 64-bit ARM machines in GCC Compile Farm, you could test on those.
Author
Owner

@ghost commented on GitHub (Jun 27, 2018):

The NEON detection per se is working (as it was).

  • Passes self-test and cracks. But, I'm not saying it works in every CPU.
Version: 1.8.0.13-jumbo-1-bleeding-50a268c 2018-06-26 14:07:24 +0200
Build: linux-gnu 64-bit aarch64 NEON AC OMP
SIMD: NEON, interleaving: MD4:2 MD5:2 SHA1:1 SHA256:1 SHA512:1
Features	: fp asimd evtstrm
<!-- gh-comment-id:400827925 --> @ghost commented on GitHub (Jun 27, 2018): The NEON detection *per se* is working (as it was). * Passes self-test and cracks. But, `I'm not saying it works in every CPU.` ``` Version: 1.8.0.13-jumbo-1-bleeding-50a268c 2018-06-26 14:07:24 +0200 Build: linux-gnu 64-bit aarch64 NEON AC OMP SIMD: NEON, interleaving: MD4:2 MD5:2 SHA1:1 SHA256:1 SHA512:1 ``` ``` Features : fp asimd evtstrm ```
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#1547
No description provided.