Re: [openssl-users] BN_MUL_MONT for ARM64 v8

2017-02-08 Thread Vijay Chander
Mike, I was native compiling on A72 (64 bit) using libgmp version 10.2. Thanks, -vijay On Feb 7, 2017 7:21 PM, "Mike Mohr" wrote: > Licensing issues are indeed thorny. Why can't openssl perform a dynamic > link? The soversion should handle any ABI issues introduced in

Re: [openssl-users] BN_MUL_MONT for ARM64 v8

2017-02-08 Thread Matt Caswell
On 08/02/17 14:12, Michael Wojcik wrote: >> From: openssl-users [mailto:openssl-users-boun...@openssl.org] On >> Behalf Of Mike Mohr Sent: Tuesday, February 07, 2017 22:21 > >> Licensing issues are indeed thorny. Why can't openssl perform a >> dynamic link? The soversion should handle any ABI

Re: [openssl-users] BN_MUL_MONT for ARM64 v8

2017-02-08 Thread Michael Wojcik
> From: openssl-users [mailto:openssl-users-boun...@openssl.org] On Behalf Of > Mike Mohr > Sent: Tuesday, February 07, 2017 22:21 > Licensing issues are indeed thorny. Why can't openssl perform a dynamic link? > The soversion should handle any ABI issues > introduced in later versions of GMP.

Re: [openssl-users] BN_MUL_MONT for ARM64 v8

2017-02-08 Thread Salz, Rich via openssl-users
> Licensing issues are indeed thorny. Why can't openssl perform a dynamic link? > The soversion should handle any ABI issues introduced in later versions of > GMP. Anything is possible; it is just code. I don't think this is a priority for the team. A pull request ... -- openssl-users

Re: [openssl-users] BN_MUL_MONT for ARM64 v8

2017-02-08 Thread Mike Mohr
Of course OpenSSL contains hand-optimized assembly routines. However, GMP has been around since at least 1993 and the library specifically targets heavily optimized multiple precision arithmetic. OpenSSL is a TLS/SSL toolkit, and necessarily focuses on implementing SSL/TLS correctly - I'd argue

Re: [openssl-users] BN_MUL_MONT for ARM64 v8

2017-02-07 Thread Mike Mohr
Licensing issues are indeed thorny. Why can't openssl perform a dynamic link? The soversion should handle any ABI issues introduced in later versions of GMP. Are you cross compiling GMP for your use on a target device? If so, you'll need to ensure that the MPN_PATH is set appropriately. If you

Re: [openssl-users] BN_MUL_MONT for ARM64 v8

2017-02-07 Thread Vijay Chander
Yes. Already took Andy's word from his previous replies for precisely this reason. GMP exercise was easy enough to get it out of the way. Thanks, Vijay On Feb 7, 2017 4:46 PM, "Jakob Bohm" wrote: > OpenSSL also has a lot of handwritten assembly language for ARM, > x86

Re: [openssl-users] BN_MUL_MONT for ARM64 v8

2017-02-07 Thread Jakob Bohm
OpenSSL also has a lot of handwritten assembly language for ARM, x86 etc. Most of it written by Andy Polyakov. His response about what can and cannot be done on various ARM CPU models is most probably a result of this work. Also, OpenSSL has a more permissive license than the GMP, so using GMP

Re: [openssl-users] BN_MUL_MONT for ARM64 v8

2017-02-07 Thread Salz, Rich via openssl-users
> Have you considered using GMP as a big integer backed for openssl?  It has > support for several arm variants using handwritten assembly code and the > developers go to great lengths to find optimize runtime on all supported > platforms. It might be interesting if we could figure out how to

Re: [openssl-users] BN_MUL_MONT for ARM64 v8

2017-02-07 Thread Vijay Chander
Mike, Tried with GMP. Same result for A72. Thanks, Vijay On Tue, Feb 7, 2017 at 3:31 PM, Mike Mohr wrote: > Have you considered using GMP as a big integer backed for openssl? It has > support for several arm variants using handwritten assembly code and the >

Re: [openssl-users] BN_MUL_MONT for ARM64 v8

2017-02-07 Thread Mike Mohr
Have you considered using GMP as a big integer backed for openssl? It has support for several arm variants using handwritten assembly code and the developers go to great lengths to find optimize runtime on all supported platforms. On Feb 7, 2017 2:26 PM, "Vijay Chander"

Re: [openssl-users] BN_MUL_MONT for ARM64 v8

2017-02-07 Thread Vijay Chander
Andy, 1:2.5 is pretty in my opinion for ARM ! We will check out Mongoose. Hmm - will try to get to the bottom of those cache misses (at a lower priority). Thanks, -vijay On Tue, Feb 7, 2017 at 11:07 AM, Andy Polyakov wrote: > > A72 is running 1GHz compared to

Re: [openssl-users] BN_MUL_MONT for ARM64 v8

2017-02-07 Thread Andy Polyakov
> A72 is running 1GHz compared to x86 at 2.1Ghz. So that should hopefully > get down to -1:5. And Mongoose will take you to ~1:2.5 (scaled to same frequency that is). Which I'd say is a fair result. Well, still could have been a bit better, but it's not unreasonable given ISA differences. Keep in

Re: [openssl-users] BN_MUL_MONT for ARM64 v8

2017-02-07 Thread Vijay Chander
Thanks Andy. A72 is running 1GHz compared to x86 at 2.1Ghz. So that should hopefully get down to -1:5. There is no L3 cache on the A72 eval board and performance counters do show 9x more DRAM accesses for ARM compared to x86. Will check out Mongoose and Kyro. Do you know of any good hardware

Re: [openssl-users] BN_MUL_MONT for ARM64 v8

2017-02-07 Thread Andy Polyakov
> Is big number montogomery multiplication as optimized as it can be for > ARM64 as compared to X86-64 from the latest openssl github ? > We are not seeing vmull ( or pmull/pmull2) instructions in > armv8-mont.pl . > >On an ARM cortex-A72 (1GHz) and E5-2620