Selaa lähdekoodia

Add AArch64 Montgomery assembly.

The file armv8-mont.pl is taken from upstream. The speed ups are fairly
modest (~30%) but seem worthwhile.

Before:

Did 231 RSA 2048 signing operations in 1008671us (229.0 ops/sec)
Did 11208 RSA 2048 verify operations in 1036997us (10808.1 ops/sec)
Did 342 RSA 2048 (3 prime, e=3) signing operations in 1021545us (334.8 ops/sec)
Did 32000 RSA 2048 (3 prime, e=3) verify operations in 1016162us (31491.0 ops/sec)
Did 45 RSA 4096 signing operations in 1039805us (43.3 ops/sec)
Did 3608 RSA 4096 verify operations in 1060283us (3402.9 ops/sec)

After:

Did 300 RSA 2048 signing operations in 1009772us (297.1 ops/sec)
Did 12740 RSA 2048 verify operations in 1075413us (11846.6 ops/sec)
Did 408 RSA 2048 (3 prime, e=3) signing operations in 1016139us (401.5 ops/sec)
Did 33000 RSA 2048 (3 prime, e=3) verify operations in 1017510us (32432.1 ops/sec)
Did 52 RSA 4096 signing operations in 1067678us (48.7 ops/sec)
Did 3408 RSA 4096 verify operations in 1062863us (3206.4 ops/sec)

Change-Id: Ife74fac784067fce3668b5c87f51d481732ff855
Reviewed-on: https://boringssl-review.googlesource.com/6444
Reviewed-by: David Benjamin <davidben@chromium.org>
Reviewed-by: Adam Langley <agl@google.com>
kris/onging/CECPQ3_patch15
Adam Langley 9 vuotta sitten
vanhempi
commit
4ab254017c
3 muutettua tiedostoa jossa 1515 lisäystä ja 2 poistoa
  1. +9
    -0
      crypto/bn/CMakeLists.txt
  2. +1503
    -0
      crypto/bn/asm/armv8-mont.pl
  3. +3
    -2
      crypto/bn/montgomery.c

+ 9
- 0
crypto/bn/CMakeLists.txt Näytä tiedosto

@@ -31,6 +31,14 @@ if (${ARCH} STREQUAL "arm")
)
endif()

if (${ARCH} STREQUAL "aarch64")
set(
BN_ARCH_SOURCES

armv8-mont.${ASM_EXT}
)
endif()

add_library(
bn

@@ -66,6 +74,7 @@ perlasm(bn-586.${ASM_EXT} asm/bn-586.pl)
perlasm(co-586.${ASM_EXT} asm/co-586.pl)
perlasm(x86-mont.${ASM_EXT} asm/x86-mont.pl)
perlasm(armv4-mont.${ASM_EXT} asm/armv4-mont.pl)
perlasm(armv8-mont.${ASM_EXT} asm/armv8-mont.pl)

add_executable(
bn_test


+ 1503
- 0
crypto/bn/asm/armv8-mont.pl
File diff suppressed because it is too large
Näytä tiedosto


+ 3
- 2
crypto/bn/montgomery.c Näytä tiedosto

@@ -118,8 +118,9 @@
#include "../internal.h"


#if !defined(OPENSSL_NO_ASM) && \
(defined(OPENSSL_X86) || defined(OPENSSL_X86_64) || defined(OPENSSL_ARM))
#if !defined(OPENSSL_NO_ASM) && \
(defined(OPENSSL_X86) || defined(OPENSSL_X86_64) || \
defined(OPENSSL_ARM) || defined(OPENSSL_AARCH64))
#define OPENSSL_BN_ASM_MONT
#endif



Ladataan…
Peruuta
Tallenna