mirror of
https://github.com/apple/swift-crypto
synced 2026-11-22 04:30:39 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a8911e0fad | ||
|
|
172d71fdc3 | ||
|
|
9c53b7a758 |
No files matched your search
+1
-1
@@ -20,7 +20,7 @@
|
||||
// Sources/CCryptoBoringSSL directory. The source repository is at
|
||||
// https://boringssl.googlesource.com/boringssl.
|
||||
//
|
||||
// BoringSSL Commit: 3a667d10e94186fd503966f5638e134fe9fb4080
|
||||
// BoringSSL Commit: 295b31324f8c557dcd3c1c831857e33a7f23bc52
|
||||
|
||||
import PackageDescription
|
||||
|
||||
|
||||
+8
-7
@@ -77,13 +77,14 @@ add_library(CCryptoBoringSSL STATIC
|
||||
"crypto/cipher_extra/tls_cbc.c"
|
||||
"crypto/cmac/cmac.c"
|
||||
"crypto/conf/conf.c"
|
||||
"crypto/cpu-aarch64-fuchsia.c"
|
||||
"crypto/cpu-aarch64-linux.c"
|
||||
"crypto/cpu-aarch64-win.c"
|
||||
"crypto/cpu-arm-linux.c"
|
||||
"crypto/cpu-arm.c"
|
||||
"crypto/cpu-intel.c"
|
||||
"crypto/cpu-ppc64le.c"
|
||||
"crypto/cpu_aarch64_apple.c"
|
||||
"crypto/cpu_aarch64_fuchsia.c"
|
||||
"crypto/cpu_aarch64_linux.c"
|
||||
"crypto/cpu_aarch64_win.c"
|
||||
"crypto/cpu_arm.c"
|
||||
"crypto/cpu_arm_linux.c"
|
||||
"crypto/cpu_intel.c"
|
||||
"crypto/cpu_ppc64le.c"
|
||||
"crypto/crypto.c"
|
||||
"crypto/curve25519/curve25519.c"
|
||||
"crypto/curve25519/spake25519.c"
|
||||
|
||||
@@ -308,4 +308,10 @@ int BIO_rw_filename(BIO *bio, const char *filename) {
|
||||
BIO_CLOSE | BIO_FP_READ | BIO_FP_WRITE, (char *)filename);
|
||||
}
|
||||
|
||||
long BIO_tell(BIO *bio) { return BIO_ctrl(bio, BIO_C_FILE_TELL, 0, NULL); }
|
||||
|
||||
long BIO_seek(BIO *bio, long offset) {
|
||||
return BIO_ctrl(bio, BIO_C_FILE_SEEK, offset, NULL);
|
||||
}
|
||||
|
||||
#endif // OPENSSL_TRUSTY
|
||||
@@ -0,0 +1,73 @@
|
||||
/* Copyright (c) 2021, Google Inc.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
|
||||
* SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
|
||||
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
||||
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */
|
||||
|
||||
#include <CCryptoBoringSSL_cpu.h>
|
||||
|
||||
#if defined(OPENSSL_AARCH64) && defined(OPENSSL_APPLE) && \
|
||||
!defined(OPENSSL_STATIC_ARMCAP)
|
||||
|
||||
#include <sys/sysctl.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <CCryptoBoringSSL_arm_arch.h>
|
||||
|
||||
#include "internal.h"
|
||||
|
||||
|
||||
extern uint32_t OPENSSL_armcap_P;
|
||||
|
||||
static int has_hw_feature(const char *name) {
|
||||
int value;
|
||||
size_t len = sizeof(value);
|
||||
if (sysctlbyname(name, &value, &len, NULL, 0) != 0) {
|
||||
return 0;
|
||||
}
|
||||
if (len != sizeof(int)) {
|
||||
// This should not happen. All the values queried should be integer-valued.
|
||||
assert(0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Per sys/sysctl.h:
|
||||
//
|
||||
// Selectors that return errors are not support on the system. Supported
|
||||
// features will return 1 if they are recommended or 0 if they are supported
|
||||
// but are not expected to help performance. Future versions of these
|
||||
// selectors may return larger values as necessary so it is best to test for
|
||||
// non zero.
|
||||
return value != 0;
|
||||
}
|
||||
|
||||
void OPENSSL_cpuid_setup(void) {
|
||||
// Apple ARM64 platforms have NEON and cryptography extensions available
|
||||
// statically, so we do not need to query them. In particular, there sometimes
|
||||
// are no sysctls corresponding to such features. See below.
|
||||
#if !defined(__ARM_NEON) || !defined(__ARM_FEATURE_CRYPTO)
|
||||
#error "NEON and crypto extensions should be statically available."
|
||||
#endif
|
||||
OPENSSL_armcap_P =
|
||||
ARMV7_NEON | ARMV8_AES | ARMV8_PMULL | ARMV8_SHA1 | ARMV8_SHA256;
|
||||
|
||||
// macOS has sysctls named both like "hw.optional.arm.FEAT_SHA512" and like
|
||||
// "hw.optional.armv8_2_sha512". There does not appear to be documentation on
|
||||
// which to use. The "armv8_2_sha512" style omits statically-available
|
||||
// features, while the "FEAT_SHA512" style includes them. However, the
|
||||
// "FEAT_SHA512" style was added in macOS 12, so we use the older style for
|
||||
// better compatibility and handle static features above.
|
||||
if (has_hw_feature("hw.optional.armv8_2_sha512")) {
|
||||
OPENSSL_armcap_P |= ARMV8_SHA512;
|
||||
}
|
||||
}
|
||||
|
||||
#endif // OPENSSL_AARCH64 && OPENSSL_APPLE && !OPENSSL_STATIC_ARMCAP
|
||||
+4
-1
@@ -50,6 +50,9 @@ void OPENSSL_cpuid_setup(void) {
|
||||
if (hwcap & ZX_ARM64_FEATURE_ISA_SHA2) {
|
||||
OPENSSL_armcap_P |= ARMV8_SHA256;
|
||||
}
|
||||
// As of writing, Fuchsia does not have a flag for ARMv8.2 SHA-512
|
||||
// extensions. When it does, add it here. See
|
||||
// https://bugs.fuchsia.dev/p/fuchsia/issues/detail?id=90759.
|
||||
}
|
||||
|
||||
#endif // OPENSSL_AARCH64 && !OPENSSL_STATIC_ARMCAP
|
||||
#endif // OPENSSL_AARCH64 && OPENSSL_FUCHSIA && !OPENSSL_STATIC_ARMCAP
|
||||
+5
-1
@@ -36,6 +36,7 @@ void OPENSSL_cpuid_setup(void) {
|
||||
static const unsigned long kPMULL = 1 << 4;
|
||||
static const unsigned long kSHA1 = 1 << 5;
|
||||
static const unsigned long kSHA256 = 1 << 6;
|
||||
static const unsigned long kSHA512 = 1 << 21;
|
||||
|
||||
if ((hwcap & kNEON) == 0) {
|
||||
// Matching OpenSSL, if NEON is missing, don't report other features
|
||||
@@ -57,6 +58,9 @@ void OPENSSL_cpuid_setup(void) {
|
||||
if (hwcap & kSHA256) {
|
||||
OPENSSL_armcap_P |= ARMV8_SHA256;
|
||||
}
|
||||
if (hwcap & kSHA512) {
|
||||
OPENSSL_armcap_P |= ARMV8_SHA512;
|
||||
}
|
||||
}
|
||||
|
||||
#endif // OPENSSL_AARCH64 && !OPENSSL_STATIC_ARMCAP
|
||||
#endif // OPENSSL_AARCH64 && OPENSSL_LINUX && !OPENSSL_STATIC_ARMCAP
|
||||
+3
-1
@@ -36,6 +36,8 @@ void OPENSSL_cpuid_setup(void) {
|
||||
OPENSSL_armcap_P |= ARMV8_SHA1;
|
||||
OPENSSL_armcap_P |= ARMV8_SHA256;
|
||||
}
|
||||
// As of writing, Windows does not have a |PF_*| value for ARMv8.2 SHA-512
|
||||
// extensions. When it does, add it here.
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif // OPENSSL_AARCH64 && OPENSSL_WINDOWS && !OPENSSL_STATIC_ARMCAP
|
||||
File renamed without changes.
+1
-1
@@ -23,7 +23,7 @@
|
||||
#include <CCryptoBoringSSL_arm_arch.h>
|
||||
#include <CCryptoBoringSSL_mem.h>
|
||||
|
||||
#include "cpu-arm-linux.h"
|
||||
#include "cpu_arm_linux.h"
|
||||
|
||||
#define AT_HWCAP 16
|
||||
#define AT_HWCAP2 26
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -104,6 +104,9 @@ HIDDEN uint32_t OPENSSL_armcap_P =
|
||||
#endif
|
||||
#if defined(OPENSSL_STATIC_ARMCAP_PMULL) || defined(__ARM_FEATURE_CRYPTO)
|
||||
ARMV8_PMULL |
|
||||
#endif
|
||||
#if defined(__ARM_FEATURE_SHA512)
|
||||
ARMV8_SHA512 |
|
||||
#endif
|
||||
0;
|
||||
|
||||
|
||||
@@ -745,6 +745,22 @@ void ERR_add_error_dataf(const char *format, ...) {
|
||||
err_set_error_data(buf);
|
||||
}
|
||||
|
||||
void ERR_set_error_data(char *data, int flags) {
|
||||
if (!(flags & ERR_FLAG_STRING)) {
|
||||
// We do not support non-string error data.
|
||||
assert(0);
|
||||
return;
|
||||
}
|
||||
if (flags & ERR_FLAG_MALLOCED) {
|
||||
err_set_error_data(data);
|
||||
} else {
|
||||
char *copy = OPENSSL_strdup(data);
|
||||
if (copy != NULL) {
|
||||
err_set_error_data(copy);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int ERR_set_mark(void) {
|
||||
ERR_STATE *const state = err_get_state();
|
||||
|
||||
|
||||
@@ -253,7 +253,7 @@ static int do_dsa_print(BIO *bp, const DSA *x, int off, int ptype) {
|
||||
|
||||
if (priv_key) {
|
||||
if (!BIO_indent(bp, off, 128) ||
|
||||
BIO_printf(bp, "%s: (%d bit)\n", ktype, BN_num_bits(x->p)) <= 0) {
|
||||
BIO_printf(bp, "%s: (%u bit)\n", ktype, BN_num_bits(x->p)) <= 0) {
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
@@ -368,7 +368,7 @@ static int do_EC_KEY_print(BIO *bp, const EC_KEY *x, int off, int ktype) {
|
||||
}
|
||||
order = BN_new();
|
||||
if (order == NULL || !EC_GROUP_get_order(group, order, NULL) ||
|
||||
BIO_printf(bp, "%s: (%d bit)\n", ecstr, BN_num_bits(order)) <= 0) {
|
||||
BIO_printf(bp, "%s: (%u bit)\n", ecstr, BN_num_bits(order)) <= 0) {
|
||||
goto err;
|
||||
}
|
||||
|
||||
|
||||
@@ -359,6 +359,18 @@ static int probable_prime_dh(BIGNUM *rnd, int bits, const BIGNUM *add,
|
||||
static int probable_prime_dh_safe(BIGNUM *rnd, int bits, const BIGNUM *add,
|
||||
const BIGNUM *rem, BN_CTX *ctx);
|
||||
|
||||
BN_GENCB *BN_GENCB_new(void) {
|
||||
BN_GENCB *callback = OPENSSL_malloc(sizeof(BN_GENCB));
|
||||
if (callback == NULL) {
|
||||
OPENSSL_PUT_ERROR(BN, ERR_R_MALLOC_FAILURE);
|
||||
return NULL;
|
||||
}
|
||||
OPENSSL_memset(callback, 0, sizeof(BN_GENCB));
|
||||
return callback;
|
||||
}
|
||||
|
||||
void BN_GENCB_free(BN_GENCB *callback) { OPENSSL_free(callback); }
|
||||
|
||||
void BN_GENCB_set(BN_GENCB *callback,
|
||||
int (*f)(int event, int n, struct bn_gencb_st *),
|
||||
void *arg) {
|
||||
|
||||
@@ -930,6 +930,8 @@ int RSA_private_transform(RSA *rsa, uint8_t *out, const uint8_t *in,
|
||||
|
||||
int RSA_flags(const RSA *rsa) { return rsa->flags; }
|
||||
|
||||
int RSA_test_flags(const RSA *rsa, int flags) { return rsa->flags & flags; }
|
||||
|
||||
int RSA_blinding_on(RSA *rsa, BN_CTX *ctx) {
|
||||
return 1;
|
||||
}
|
||||
@@ -14,7 +14,7 @@
|
||||
#if defined(BORINGSSL_PREFIX)
|
||||
#include <CCryptoBoringSSL_boringssl_prefix_symbols_asm.h>
|
||||
#endif
|
||||
// Copyright 2014-2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
// Copyright 2014-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the OpenSSL license (the "License"). You may not use
|
||||
// this file except in compliance with the License. You can obtain a copy
|
||||
@@ -42,6 +42,7 @@
|
||||
// Denver 2.01 10.5 (+26%) 6.70 (+8%)
|
||||
// X-Gene 20.0 (+100%) 12.8 (+300%(***))
|
||||
// Mongoose 2.36 13.0 (+50%) 8.36 (+33%)
|
||||
// Kryo 1.92 17.4 (+30%) 11.2 (+8%)
|
||||
//
|
||||
// (*) Software SHA256 results are of lesser relevance, presented
|
||||
// mostly for informational purposes.
|
||||
@@ -50,7 +51,7 @@
|
||||
// on Cortex-A53 (or by 4 cycles per round).
|
||||
// (***) Super-impressive coefficients over gcc-generated code are
|
||||
// indication of some compiler "pathology", most notably code
|
||||
// generated with -mgeneral-regs-only is significanty faster
|
||||
// generated with -mgeneral-regs-only is significantly faster
|
||||
// and the gap is only 40-90%.
|
||||
|
||||
#ifndef __KERNEL__
|
||||
@@ -102,7 +103,7 @@ Loop:
|
||||
ldr w19,[x30],#4 // *K++
|
||||
eor w28,w21,w22 // magic seed
|
||||
str x1,[x29,#112]
|
||||
#ifndef __ARMEB__
|
||||
#ifndef __AARCH64EB__
|
||||
rev w3,w3 // 0
|
||||
#endif
|
||||
ror w16,w24,#6
|
||||
@@ -125,7 +126,7 @@ Loop:
|
||||
add w27,w27,w28 // h+=Maj(a,b,c)
|
||||
ldr w28,[x30],#4 // *K++, w19 in next round
|
||||
//add w27,w27,w17 // h+=Sigma0(a)
|
||||
#ifndef __ARMEB__
|
||||
#ifndef __AARCH64EB__
|
||||
rev w4,w4 // 1
|
||||
#endif
|
||||
ldp w5,w6,[x1],#2*4
|
||||
@@ -150,7 +151,7 @@ Loop:
|
||||
add w26,w26,w19 // h+=Maj(a,b,c)
|
||||
ldr w19,[x30],#4 // *K++, w28 in next round
|
||||
//add w26,w26,w17 // h+=Sigma0(a)
|
||||
#ifndef __ARMEB__
|
||||
#ifndef __AARCH64EB__
|
||||
rev w5,w5 // 2
|
||||
#endif
|
||||
add w26,w26,w17 // h+=Sigma0(a)
|
||||
@@ -174,7 +175,7 @@ Loop:
|
||||
add w25,w25,w28 // h+=Maj(a,b,c)
|
||||
ldr w28,[x30],#4 // *K++, w19 in next round
|
||||
//add w25,w25,w17 // h+=Sigma0(a)
|
||||
#ifndef __ARMEB__
|
||||
#ifndef __AARCH64EB__
|
||||
rev w6,w6 // 3
|
||||
#endif
|
||||
ldp w7,w8,[x1],#2*4
|
||||
@@ -199,7 +200,7 @@ Loop:
|
||||
add w24,w24,w19 // h+=Maj(a,b,c)
|
||||
ldr w19,[x30],#4 // *K++, w28 in next round
|
||||
//add w24,w24,w17 // h+=Sigma0(a)
|
||||
#ifndef __ARMEB__
|
||||
#ifndef __AARCH64EB__
|
||||
rev w7,w7 // 4
|
||||
#endif
|
||||
add w24,w24,w17 // h+=Sigma0(a)
|
||||
@@ -223,7 +224,7 @@ Loop:
|
||||
add w23,w23,w28 // h+=Maj(a,b,c)
|
||||
ldr w28,[x30],#4 // *K++, w19 in next round
|
||||
//add w23,w23,w17 // h+=Sigma0(a)
|
||||
#ifndef __ARMEB__
|
||||
#ifndef __AARCH64EB__
|
||||
rev w8,w8 // 5
|
||||
#endif
|
||||
ldp w9,w10,[x1],#2*4
|
||||
@@ -248,7 +249,7 @@ Loop:
|
||||
add w22,w22,w19 // h+=Maj(a,b,c)
|
||||
ldr w19,[x30],#4 // *K++, w28 in next round
|
||||
//add w22,w22,w17 // h+=Sigma0(a)
|
||||
#ifndef __ARMEB__
|
||||
#ifndef __AARCH64EB__
|
||||
rev w9,w9 // 6
|
||||
#endif
|
||||
add w22,w22,w17 // h+=Sigma0(a)
|
||||
@@ -272,7 +273,7 @@ Loop:
|
||||
add w21,w21,w28 // h+=Maj(a,b,c)
|
||||
ldr w28,[x30],#4 // *K++, w19 in next round
|
||||
//add w21,w21,w17 // h+=Sigma0(a)
|
||||
#ifndef __ARMEB__
|
||||
#ifndef __AARCH64EB__
|
||||
rev w10,w10 // 7
|
||||
#endif
|
||||
ldp w11,w12,[x1],#2*4
|
||||
@@ -297,7 +298,7 @@ Loop:
|
||||
add w20,w20,w19 // h+=Maj(a,b,c)
|
||||
ldr w19,[x30],#4 // *K++, w28 in next round
|
||||
//add w20,w20,w17 // h+=Sigma0(a)
|
||||
#ifndef __ARMEB__
|
||||
#ifndef __AARCH64EB__
|
||||
rev w11,w11 // 8
|
||||
#endif
|
||||
add w20,w20,w17 // h+=Sigma0(a)
|
||||
@@ -321,7 +322,7 @@ Loop:
|
||||
add w27,w27,w28 // h+=Maj(a,b,c)
|
||||
ldr w28,[x30],#4 // *K++, w19 in next round
|
||||
//add w27,w27,w17 // h+=Sigma0(a)
|
||||
#ifndef __ARMEB__
|
||||
#ifndef __AARCH64EB__
|
||||
rev w12,w12 // 9
|
||||
#endif
|
||||
ldp w13,w14,[x1],#2*4
|
||||
@@ -346,7 +347,7 @@ Loop:
|
||||
add w26,w26,w19 // h+=Maj(a,b,c)
|
||||
ldr w19,[x30],#4 // *K++, w28 in next round
|
||||
//add w26,w26,w17 // h+=Sigma0(a)
|
||||
#ifndef __ARMEB__
|
||||
#ifndef __AARCH64EB__
|
||||
rev w13,w13 // 10
|
||||
#endif
|
||||
add w26,w26,w17 // h+=Sigma0(a)
|
||||
@@ -370,7 +371,7 @@ Loop:
|
||||
add w25,w25,w28 // h+=Maj(a,b,c)
|
||||
ldr w28,[x30],#4 // *K++, w19 in next round
|
||||
//add w25,w25,w17 // h+=Sigma0(a)
|
||||
#ifndef __ARMEB__
|
||||
#ifndef __AARCH64EB__
|
||||
rev w14,w14 // 11
|
||||
#endif
|
||||
ldp w15,w0,[x1],#2*4
|
||||
@@ -396,7 +397,7 @@ Loop:
|
||||
add w24,w24,w19 // h+=Maj(a,b,c)
|
||||
ldr w19,[x30],#4 // *K++, w28 in next round
|
||||
//add w24,w24,w17 // h+=Sigma0(a)
|
||||
#ifndef __ARMEB__
|
||||
#ifndef __AARCH64EB__
|
||||
rev w15,w15 // 12
|
||||
#endif
|
||||
add w24,w24,w17 // h+=Sigma0(a)
|
||||
@@ -421,7 +422,7 @@ Loop:
|
||||
add w23,w23,w28 // h+=Maj(a,b,c)
|
||||
ldr w28,[x30],#4 // *K++, w19 in next round
|
||||
//add w23,w23,w17 // h+=Sigma0(a)
|
||||
#ifndef __ARMEB__
|
||||
#ifndef __AARCH64EB__
|
||||
rev w0,w0 // 13
|
||||
#endif
|
||||
ldp w1,w2,[x1]
|
||||
@@ -447,7 +448,7 @@ Loop:
|
||||
add w22,w22,w19 // h+=Maj(a,b,c)
|
||||
ldr w19,[x30],#4 // *K++, w28 in next round
|
||||
//add w22,w22,w17 // h+=Sigma0(a)
|
||||
#ifndef __ARMEB__
|
||||
#ifndef __AARCH64EB__
|
||||
rev w1,w1 // 14
|
||||
#endif
|
||||
ldr w6,[sp,#12]
|
||||
@@ -473,7 +474,7 @@ Loop:
|
||||
add w21,w21,w28 // h+=Maj(a,b,c)
|
||||
ldr w28,[x30],#4 // *K++, w19 in next round
|
||||
//add w21,w21,w17 // h+=Sigma0(a)
|
||||
#ifndef __ARMEB__
|
||||
#ifndef __AARCH64EB__
|
||||
rev w2,w2 // 15
|
||||
#endif
|
||||
ldr w7,[sp,#0]
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#if defined(BORINGSSL_PREFIX)
|
||||
#include <CCryptoBoringSSL_boringssl_prefix_symbols_asm.h>
|
||||
#endif
|
||||
// Copyright 2014-2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
// Copyright 2014-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the OpenSSL license (the "License"). You may not use
|
||||
// this file except in compliance with the License. You can obtain a copy
|
||||
@@ -43,6 +43,7 @@
|
||||
// Denver 2.01 10.5 (+26%) 6.70 (+8%)
|
||||
// X-Gene 20.0 (+100%) 12.8 (+300%(***))
|
||||
// Mongoose 2.36 13.0 (+50%) 8.36 (+33%)
|
||||
// Kryo 1.92 17.4 (+30%) 11.2 (+8%)
|
||||
//
|
||||
// (*) Software SHA256 results are of lesser relevance, presented
|
||||
// mostly for informational purposes.
|
||||
@@ -51,7 +52,7 @@
|
||||
// on Cortex-A53 (or by 4 cycles per round).
|
||||
// (***) Super-impressive coefficients over gcc-generated code are
|
||||
// indication of some compiler "pathology", most notably code
|
||||
// generated with -mgeneral-regs-only is significanty faster
|
||||
// generated with -mgeneral-regs-only is significantly faster
|
||||
// and the gap is only 40-90%.
|
||||
|
||||
#ifndef __KERNEL__
|
||||
@@ -103,7 +104,7 @@ sha256_block_data_order:
|
||||
ldr w19,[x30],#4 // *K++
|
||||
eor w28,w21,w22 // magic seed
|
||||
str x1,[x29,#112]
|
||||
#ifndef __ARMEB__
|
||||
#ifndef __AARCH64EB__
|
||||
rev w3,w3 // 0
|
||||
#endif
|
||||
ror w16,w24,#6
|
||||
@@ -126,7 +127,7 @@ sha256_block_data_order:
|
||||
add w27,w27,w28 // h+=Maj(a,b,c)
|
||||
ldr w28,[x30],#4 // *K++, w19 in next round
|
||||
//add w27,w27,w17 // h+=Sigma0(a)
|
||||
#ifndef __ARMEB__
|
||||
#ifndef __AARCH64EB__
|
||||
rev w4,w4 // 1
|
||||
#endif
|
||||
ldp w5,w6,[x1],#2*4
|
||||
@@ -151,7 +152,7 @@ sha256_block_data_order:
|
||||
add w26,w26,w19 // h+=Maj(a,b,c)
|
||||
ldr w19,[x30],#4 // *K++, w28 in next round
|
||||
//add w26,w26,w17 // h+=Sigma0(a)
|
||||
#ifndef __ARMEB__
|
||||
#ifndef __AARCH64EB__
|
||||
rev w5,w5 // 2
|
||||
#endif
|
||||
add w26,w26,w17 // h+=Sigma0(a)
|
||||
@@ -175,7 +176,7 @@ sha256_block_data_order:
|
||||
add w25,w25,w28 // h+=Maj(a,b,c)
|
||||
ldr w28,[x30],#4 // *K++, w19 in next round
|
||||
//add w25,w25,w17 // h+=Sigma0(a)
|
||||
#ifndef __ARMEB__
|
||||
#ifndef __AARCH64EB__
|
||||
rev w6,w6 // 3
|
||||
#endif
|
||||
ldp w7,w8,[x1],#2*4
|
||||
@@ -200,7 +201,7 @@ sha256_block_data_order:
|
||||
add w24,w24,w19 // h+=Maj(a,b,c)
|
||||
ldr w19,[x30],#4 // *K++, w28 in next round
|
||||
//add w24,w24,w17 // h+=Sigma0(a)
|
||||
#ifndef __ARMEB__
|
||||
#ifndef __AARCH64EB__
|
||||
rev w7,w7 // 4
|
||||
#endif
|
||||
add w24,w24,w17 // h+=Sigma0(a)
|
||||
@@ -224,7 +225,7 @@ sha256_block_data_order:
|
||||
add w23,w23,w28 // h+=Maj(a,b,c)
|
||||
ldr w28,[x30],#4 // *K++, w19 in next round
|
||||
//add w23,w23,w17 // h+=Sigma0(a)
|
||||
#ifndef __ARMEB__
|
||||
#ifndef __AARCH64EB__
|
||||
rev w8,w8 // 5
|
||||
#endif
|
||||
ldp w9,w10,[x1],#2*4
|
||||
@@ -249,7 +250,7 @@ sha256_block_data_order:
|
||||
add w22,w22,w19 // h+=Maj(a,b,c)
|
||||
ldr w19,[x30],#4 // *K++, w28 in next round
|
||||
//add w22,w22,w17 // h+=Sigma0(a)
|
||||
#ifndef __ARMEB__
|
||||
#ifndef __AARCH64EB__
|
||||
rev w9,w9 // 6
|
||||
#endif
|
||||
add w22,w22,w17 // h+=Sigma0(a)
|
||||
@@ -273,7 +274,7 @@ sha256_block_data_order:
|
||||
add w21,w21,w28 // h+=Maj(a,b,c)
|
||||
ldr w28,[x30],#4 // *K++, w19 in next round
|
||||
//add w21,w21,w17 // h+=Sigma0(a)
|
||||
#ifndef __ARMEB__
|
||||
#ifndef __AARCH64EB__
|
||||
rev w10,w10 // 7
|
||||
#endif
|
||||
ldp w11,w12,[x1],#2*4
|
||||
@@ -298,7 +299,7 @@ sha256_block_data_order:
|
||||
add w20,w20,w19 // h+=Maj(a,b,c)
|
||||
ldr w19,[x30],#4 // *K++, w28 in next round
|
||||
//add w20,w20,w17 // h+=Sigma0(a)
|
||||
#ifndef __ARMEB__
|
||||
#ifndef __AARCH64EB__
|
||||
rev w11,w11 // 8
|
||||
#endif
|
||||
add w20,w20,w17 // h+=Sigma0(a)
|
||||
@@ -322,7 +323,7 @@ sha256_block_data_order:
|
||||
add w27,w27,w28 // h+=Maj(a,b,c)
|
||||
ldr w28,[x30],#4 // *K++, w19 in next round
|
||||
//add w27,w27,w17 // h+=Sigma0(a)
|
||||
#ifndef __ARMEB__
|
||||
#ifndef __AARCH64EB__
|
||||
rev w12,w12 // 9
|
||||
#endif
|
||||
ldp w13,w14,[x1],#2*4
|
||||
@@ -347,7 +348,7 @@ sha256_block_data_order:
|
||||
add w26,w26,w19 // h+=Maj(a,b,c)
|
||||
ldr w19,[x30],#4 // *K++, w28 in next round
|
||||
//add w26,w26,w17 // h+=Sigma0(a)
|
||||
#ifndef __ARMEB__
|
||||
#ifndef __AARCH64EB__
|
||||
rev w13,w13 // 10
|
||||
#endif
|
||||
add w26,w26,w17 // h+=Sigma0(a)
|
||||
@@ -371,7 +372,7 @@ sha256_block_data_order:
|
||||
add w25,w25,w28 // h+=Maj(a,b,c)
|
||||
ldr w28,[x30],#4 // *K++, w19 in next round
|
||||
//add w25,w25,w17 // h+=Sigma0(a)
|
||||
#ifndef __ARMEB__
|
||||
#ifndef __AARCH64EB__
|
||||
rev w14,w14 // 11
|
||||
#endif
|
||||
ldp w15,w0,[x1],#2*4
|
||||
@@ -397,7 +398,7 @@ sha256_block_data_order:
|
||||
add w24,w24,w19 // h+=Maj(a,b,c)
|
||||
ldr w19,[x30],#4 // *K++, w28 in next round
|
||||
//add w24,w24,w17 // h+=Sigma0(a)
|
||||
#ifndef __ARMEB__
|
||||
#ifndef __AARCH64EB__
|
||||
rev w15,w15 // 12
|
||||
#endif
|
||||
add w24,w24,w17 // h+=Sigma0(a)
|
||||
@@ -422,7 +423,7 @@ sha256_block_data_order:
|
||||
add w23,w23,w28 // h+=Maj(a,b,c)
|
||||
ldr w28,[x30],#4 // *K++, w19 in next round
|
||||
//add w23,w23,w17 // h+=Sigma0(a)
|
||||
#ifndef __ARMEB__
|
||||
#ifndef __AARCH64EB__
|
||||
rev w0,w0 // 13
|
||||
#endif
|
||||
ldp w1,w2,[x1]
|
||||
@@ -448,7 +449,7 @@ sha256_block_data_order:
|
||||
add w22,w22,w19 // h+=Maj(a,b,c)
|
||||
ldr w19,[x30],#4 // *K++, w28 in next round
|
||||
//add w22,w22,w17 // h+=Sigma0(a)
|
||||
#ifndef __ARMEB__
|
||||
#ifndef __AARCH64EB__
|
||||
rev w1,w1 // 14
|
||||
#endif
|
||||
ldr w6,[sp,#12]
|
||||
@@ -474,7 +475,7 @@ sha256_block_data_order:
|
||||
add w21,w21,w28 // h+=Maj(a,b,c)
|
||||
ldr w28,[x30],#4 // *K++, w19 in next round
|
||||
//add w21,w21,w17 // h+=Sigma0(a)
|
||||
#ifndef __ARMEB__
|
||||
#ifndef __AARCH64EB__
|
||||
rev w2,w2 // 15
|
||||
#endif
|
||||
ldr w7,[sp,#0]
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
#if defined(BORINGSSL_PREFIX)
|
||||
#include <CCryptoBoringSSL_boringssl_prefix_symbols_asm.h>
|
||||
#endif
|
||||
// Copyright 2014-2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
// Copyright 2014-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the OpenSSL license (the "License"). You may not use
|
||||
// this file except in compliance with the License. You can obtain a copy
|
||||
@@ -42,6 +42,7 @@
|
||||
// Denver 2.01 10.5 (+26%) 6.70 (+8%)
|
||||
// X-Gene 20.0 (+100%) 12.8 (+300%(***))
|
||||
// Mongoose 2.36 13.0 (+50%) 8.36 (+33%)
|
||||
// Kryo 1.92 17.4 (+30%) 11.2 (+8%)
|
||||
//
|
||||
// (*) Software SHA256 results are of lesser relevance, presented
|
||||
// mostly for informational purposes.
|
||||
@@ -50,7 +51,7 @@
|
||||
// on Cortex-A53 (or by 4 cycles per round).
|
||||
// (***) Super-impressive coefficients over gcc-generated code are
|
||||
// indication of some compiler "pathology", most notably code
|
||||
// generated with -mgeneral-regs-only is significanty faster
|
||||
// generated with -mgeneral-regs-only is significantly faster
|
||||
// and the gap is only 40-90%.
|
||||
|
||||
#ifndef __KERNEL__
|
||||
@@ -66,6 +67,17 @@
|
||||
|
||||
.align 6
|
||||
_sha512_block_data_order:
|
||||
AARCH64_VALID_CALL_TARGET
|
||||
#ifndef __KERNEL__
|
||||
#if __has_feature(hwaddress_sanitizer) && __clang_major__ >= 10
|
||||
adrp x16,:pg_hi21_nc:_OPENSSL_armcap_P
|
||||
#else
|
||||
adrp x16,_OPENSSL_armcap_P@PAGE
|
||||
#endif
|
||||
ldr w16,[x16,_OPENSSL_armcap_P@PAGEOFF]
|
||||
tst w16,#ARMV8_SHA512
|
||||
b.ne Lv8_entry
|
||||
#endif
|
||||
AARCH64_SIGN_LINK_REGISTER
|
||||
stp x29,x30,[sp,#-128]!
|
||||
add x29,sp,#0
|
||||
@@ -91,7 +103,7 @@ Loop:
|
||||
ldr x19,[x30],#8 // *K++
|
||||
eor x28,x21,x22 // magic seed
|
||||
str x1,[x29,#112]
|
||||
#ifndef __ARMEB__
|
||||
#ifndef __AARCH64EB__
|
||||
rev x3,x3 // 0
|
||||
#endif
|
||||
ror x16,x24,#14
|
||||
@@ -114,7 +126,7 @@ Loop:
|
||||
add x27,x27,x28 // h+=Maj(a,b,c)
|
||||
ldr x28,[x30],#8 // *K++, x19 in next round
|
||||
//add x27,x27,x17 // h+=Sigma0(a)
|
||||
#ifndef __ARMEB__
|
||||
#ifndef __AARCH64EB__
|
||||
rev x4,x4 // 1
|
||||
#endif
|
||||
ldp x5,x6,[x1],#2*8
|
||||
@@ -139,7 +151,7 @@ Loop:
|
||||
add x26,x26,x19 // h+=Maj(a,b,c)
|
||||
ldr x19,[x30],#8 // *K++, x28 in next round
|
||||
//add x26,x26,x17 // h+=Sigma0(a)
|
||||
#ifndef __ARMEB__
|
||||
#ifndef __AARCH64EB__
|
||||
rev x5,x5 // 2
|
||||
#endif
|
||||
add x26,x26,x17 // h+=Sigma0(a)
|
||||
@@ -163,7 +175,7 @@ Loop:
|
||||
add x25,x25,x28 // h+=Maj(a,b,c)
|
||||
ldr x28,[x30],#8 // *K++, x19 in next round
|
||||
//add x25,x25,x17 // h+=Sigma0(a)
|
||||
#ifndef __ARMEB__
|
||||
#ifndef __AARCH64EB__
|
||||
rev x6,x6 // 3
|
||||
#endif
|
||||
ldp x7,x8,[x1],#2*8
|
||||
@@ -188,7 +200,7 @@ Loop:
|
||||
add x24,x24,x19 // h+=Maj(a,b,c)
|
||||
ldr x19,[x30],#8 // *K++, x28 in next round
|
||||
//add x24,x24,x17 // h+=Sigma0(a)
|
||||
#ifndef __ARMEB__
|
||||
#ifndef __AARCH64EB__
|
||||
rev x7,x7 // 4
|
||||
#endif
|
||||
add x24,x24,x17 // h+=Sigma0(a)
|
||||
@@ -212,7 +224,7 @@ Loop:
|
||||
add x23,x23,x28 // h+=Maj(a,b,c)
|
||||
ldr x28,[x30],#8 // *K++, x19 in next round
|
||||
//add x23,x23,x17 // h+=Sigma0(a)
|
||||
#ifndef __ARMEB__
|
||||
#ifndef __AARCH64EB__
|
||||
rev x8,x8 // 5
|
||||
#endif
|
||||
ldp x9,x10,[x1],#2*8
|
||||
@@ -237,7 +249,7 @@ Loop:
|
||||
add x22,x22,x19 // h+=Maj(a,b,c)
|
||||
ldr x19,[x30],#8 // *K++, x28 in next round
|
||||
//add x22,x22,x17 // h+=Sigma0(a)
|
||||
#ifndef __ARMEB__
|
||||
#ifndef __AARCH64EB__
|
||||
rev x9,x9 // 6
|
||||
#endif
|
||||
add x22,x22,x17 // h+=Sigma0(a)
|
||||
@@ -261,7 +273,7 @@ Loop:
|
||||
add x21,x21,x28 // h+=Maj(a,b,c)
|
||||
ldr x28,[x30],#8 // *K++, x19 in next round
|
||||
//add x21,x21,x17 // h+=Sigma0(a)
|
||||
#ifndef __ARMEB__
|
||||
#ifndef __AARCH64EB__
|
||||
rev x10,x10 // 7
|
||||
#endif
|
||||
ldp x11,x12,[x1],#2*8
|
||||
@@ -286,7 +298,7 @@ Loop:
|
||||
add x20,x20,x19 // h+=Maj(a,b,c)
|
||||
ldr x19,[x30],#8 // *K++, x28 in next round
|
||||
//add x20,x20,x17 // h+=Sigma0(a)
|
||||
#ifndef __ARMEB__
|
||||
#ifndef __AARCH64EB__
|
||||
rev x11,x11 // 8
|
||||
#endif
|
||||
add x20,x20,x17 // h+=Sigma0(a)
|
||||
@@ -310,7 +322,7 @@ Loop:
|
||||
add x27,x27,x28 // h+=Maj(a,b,c)
|
||||
ldr x28,[x30],#8 // *K++, x19 in next round
|
||||
//add x27,x27,x17 // h+=Sigma0(a)
|
||||
#ifndef __ARMEB__
|
||||
#ifndef __AARCH64EB__
|
||||
rev x12,x12 // 9
|
||||
#endif
|
||||
ldp x13,x14,[x1],#2*8
|
||||
@@ -335,7 +347,7 @@ Loop:
|
||||
add x26,x26,x19 // h+=Maj(a,b,c)
|
||||
ldr x19,[x30],#8 // *K++, x28 in next round
|
||||
//add x26,x26,x17 // h+=Sigma0(a)
|
||||
#ifndef __ARMEB__
|
||||
#ifndef __AARCH64EB__
|
||||
rev x13,x13 // 10
|
||||
#endif
|
||||
add x26,x26,x17 // h+=Sigma0(a)
|
||||
@@ -359,7 +371,7 @@ Loop:
|
||||
add x25,x25,x28 // h+=Maj(a,b,c)
|
||||
ldr x28,[x30],#8 // *K++, x19 in next round
|
||||
//add x25,x25,x17 // h+=Sigma0(a)
|
||||
#ifndef __ARMEB__
|
||||
#ifndef __AARCH64EB__
|
||||
rev x14,x14 // 11
|
||||
#endif
|
||||
ldp x15,x0,[x1],#2*8
|
||||
@@ -385,7 +397,7 @@ Loop:
|
||||
add x24,x24,x19 // h+=Maj(a,b,c)
|
||||
ldr x19,[x30],#8 // *K++, x28 in next round
|
||||
//add x24,x24,x17 // h+=Sigma0(a)
|
||||
#ifndef __ARMEB__
|
||||
#ifndef __AARCH64EB__
|
||||
rev x15,x15 // 12
|
||||
#endif
|
||||
add x24,x24,x17 // h+=Sigma0(a)
|
||||
@@ -410,7 +422,7 @@ Loop:
|
||||
add x23,x23,x28 // h+=Maj(a,b,c)
|
||||
ldr x28,[x30],#8 // *K++, x19 in next round
|
||||
//add x23,x23,x17 // h+=Sigma0(a)
|
||||
#ifndef __ARMEB__
|
||||
#ifndef __AARCH64EB__
|
||||
rev x0,x0 // 13
|
||||
#endif
|
||||
ldp x1,x2,[x1]
|
||||
@@ -436,7 +448,7 @@ Loop:
|
||||
add x22,x22,x19 // h+=Maj(a,b,c)
|
||||
ldr x19,[x30],#8 // *K++, x28 in next round
|
||||
//add x22,x22,x17 // h+=Sigma0(a)
|
||||
#ifndef __ARMEB__
|
||||
#ifndef __AARCH64EB__
|
||||
rev x1,x1 // 14
|
||||
#endif
|
||||
ldr x6,[sp,#24]
|
||||
@@ -462,7 +474,7 @@ Loop:
|
||||
add x21,x21,x28 // h+=Maj(a,b,c)
|
||||
ldr x28,[x30],#8 // *K++, x19 in next round
|
||||
//add x21,x21,x17 // h+=Sigma0(a)
|
||||
#ifndef __ARMEB__
|
||||
#ifndef __AARCH64EB__
|
||||
rev x2,x2 // 15
|
||||
#endif
|
||||
ldr x7,[sp,#0]
|
||||
@@ -1080,6 +1092,527 @@ LK512:
|
||||
.byte 83,72,65,53,49,50,32,98,108,111,99,107,32,116,114,97,110,115,102,111,114,109,32,102,111,114,32,65,82,77,118,56,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0
|
||||
.align 2
|
||||
.align 2
|
||||
.text
|
||||
#ifndef __KERNEL__
|
||||
|
||||
.align 6
|
||||
sha512_block_armv8:
|
||||
Lv8_entry:
|
||||
stp x29,x30,[sp,#-16]!
|
||||
add x29,sp,#0
|
||||
|
||||
ld1 {v16.16b,v17.16b,v18.16b,v19.16b},[x1],#64 // load input
|
||||
ld1 {v20.16b,v21.16b,v22.16b,v23.16b},[x1],#64
|
||||
|
||||
ld1 {v0.2d,v1.2d,v2.2d,v3.2d},[x0] // load context
|
||||
adrp x3,LK512@PAGE
|
||||
add x3,x3,LK512@PAGEOFF
|
||||
|
||||
rev64 v16.16b,v16.16b
|
||||
rev64 v17.16b,v17.16b
|
||||
rev64 v18.16b,v18.16b
|
||||
rev64 v19.16b,v19.16b
|
||||
rev64 v20.16b,v20.16b
|
||||
rev64 v21.16b,v21.16b
|
||||
rev64 v22.16b,v22.16b
|
||||
rev64 v23.16b,v23.16b
|
||||
b Loop_hw
|
||||
|
||||
.align 4
|
||||
Loop_hw:
|
||||
ld1 {v24.2d},[x3],#16
|
||||
subs x2,x2,#1
|
||||
sub x4,x1,#128
|
||||
orr v26.16b,v0.16b,v0.16b // offload
|
||||
orr v27.16b,v1.16b,v1.16b
|
||||
orr v28.16b,v2.16b,v2.16b
|
||||
orr v29.16b,v3.16b,v3.16b
|
||||
csel x1,x1,x4,ne // conditional rewind
|
||||
add v24.2d,v24.2d,v16.2d
|
||||
ld1 {v25.2d},[x3],#16
|
||||
ext v24.16b,v24.16b,v24.16b,#8
|
||||
ext v5.16b,v2.16b,v3.16b,#8
|
||||
ext v6.16b,v1.16b,v2.16b,#8
|
||||
add v3.2d,v3.2d,v24.2d // "T1 + H + K512[i]"
|
||||
.long 0xcec08230 //sha512su0 v16.16b,v17.16b
|
||||
ext v7.16b,v20.16b,v21.16b,#8
|
||||
.long 0xce6680a3 //sha512h v3.16b,v5.16b,v6.16b
|
||||
.long 0xce678af0 //sha512su1 v16.16b,v23.16b,v7.16b
|
||||
add v4.2d,v1.2d,v3.2d // "D + T1"
|
||||
.long 0xce608423 //sha512h2 v3.16b,v1.16b,v0.16b
|
||||
add v25.2d,v25.2d,v17.2d
|
||||
ld1 {v24.2d},[x3],#16
|
||||
ext v25.16b,v25.16b,v25.16b,#8
|
||||
ext v5.16b,v4.16b,v2.16b,#8
|
||||
ext v6.16b,v0.16b,v4.16b,#8
|
||||
add v2.2d,v2.2d,v25.2d // "T1 + H + K512[i]"
|
||||
.long 0xcec08251 //sha512su0 v17.16b,v18.16b
|
||||
ext v7.16b,v21.16b,v22.16b,#8
|
||||
.long 0xce6680a2 //sha512h v2.16b,v5.16b,v6.16b
|
||||
.long 0xce678a11 //sha512su1 v17.16b,v16.16b,v7.16b
|
||||
add v1.2d,v0.2d,v2.2d // "D + T1"
|
||||
.long 0xce638402 //sha512h2 v2.16b,v0.16b,v3.16b
|
||||
add v24.2d,v24.2d,v18.2d
|
||||
ld1 {v25.2d},[x3],#16
|
||||
ext v24.16b,v24.16b,v24.16b,#8
|
||||
ext v5.16b,v1.16b,v4.16b,#8
|
||||
ext v6.16b,v3.16b,v1.16b,#8
|
||||
add v4.2d,v4.2d,v24.2d // "T1 + H + K512[i]"
|
||||
.long 0xcec08272 //sha512su0 v18.16b,v19.16b
|
||||
ext v7.16b,v22.16b,v23.16b,#8
|
||||
.long 0xce6680a4 //sha512h v4.16b,v5.16b,v6.16b
|
||||
.long 0xce678a32 //sha512su1 v18.16b,v17.16b,v7.16b
|
||||
add v0.2d,v3.2d,v4.2d // "D + T1"
|
||||
.long 0xce628464 //sha512h2 v4.16b,v3.16b,v2.16b
|
||||
add v25.2d,v25.2d,v19.2d
|
||||
ld1 {v24.2d},[x3],#16
|
||||
ext v25.16b,v25.16b,v25.16b,#8
|
||||
ext v5.16b,v0.16b,v1.16b,#8
|
||||
ext v6.16b,v2.16b,v0.16b,#8
|
||||
add v1.2d,v1.2d,v25.2d // "T1 + H + K512[i]"
|
||||
.long 0xcec08293 //sha512su0 v19.16b,v20.16b
|
||||
ext v7.16b,v23.16b,v16.16b,#8
|
||||
.long 0xce6680a1 //sha512h v1.16b,v5.16b,v6.16b
|
||||
.long 0xce678a53 //sha512su1 v19.16b,v18.16b,v7.16b
|
||||
add v3.2d,v2.2d,v1.2d // "D + T1"
|
||||
.long 0xce648441 //sha512h2 v1.16b,v2.16b,v4.16b
|
||||
add v24.2d,v24.2d,v20.2d
|
||||
ld1 {v25.2d},[x3],#16
|
||||
ext v24.16b,v24.16b,v24.16b,#8
|
||||
ext v5.16b,v3.16b,v0.16b,#8
|
||||
ext v6.16b,v4.16b,v3.16b,#8
|
||||
add v0.2d,v0.2d,v24.2d // "T1 + H + K512[i]"
|
||||
.long 0xcec082b4 //sha512su0 v20.16b,v21.16b
|
||||
ext v7.16b,v16.16b,v17.16b,#8
|
||||
.long 0xce6680a0 //sha512h v0.16b,v5.16b,v6.16b
|
||||
.long 0xce678a74 //sha512su1 v20.16b,v19.16b,v7.16b
|
||||
add v2.2d,v4.2d,v0.2d // "D + T1"
|
||||
.long 0xce618480 //sha512h2 v0.16b,v4.16b,v1.16b
|
||||
add v25.2d,v25.2d,v21.2d
|
||||
ld1 {v24.2d},[x3],#16
|
||||
ext v25.16b,v25.16b,v25.16b,#8
|
||||
ext v5.16b,v2.16b,v3.16b,#8
|
||||
ext v6.16b,v1.16b,v2.16b,#8
|
||||
add v3.2d,v3.2d,v25.2d // "T1 + H + K512[i]"
|
||||
.long 0xcec082d5 //sha512su0 v21.16b,v22.16b
|
||||
ext v7.16b,v17.16b,v18.16b,#8
|
||||
.long 0xce6680a3 //sha512h v3.16b,v5.16b,v6.16b
|
||||
.long 0xce678a95 //sha512su1 v21.16b,v20.16b,v7.16b
|
||||
add v4.2d,v1.2d,v3.2d // "D + T1"
|
||||
.long 0xce608423 //sha512h2 v3.16b,v1.16b,v0.16b
|
||||
add v24.2d,v24.2d,v22.2d
|
||||
ld1 {v25.2d},[x3],#16
|
||||
ext v24.16b,v24.16b,v24.16b,#8
|
||||
ext v5.16b,v4.16b,v2.16b,#8
|
||||
ext v6.16b,v0.16b,v4.16b,#8
|
||||
add v2.2d,v2.2d,v24.2d // "T1 + H + K512[i]"
|
||||
.long 0xcec082f6 //sha512su0 v22.16b,v23.16b
|
||||
ext v7.16b,v18.16b,v19.16b,#8
|
||||
.long 0xce6680a2 //sha512h v2.16b,v5.16b,v6.16b
|
||||
.long 0xce678ab6 //sha512su1 v22.16b,v21.16b,v7.16b
|
||||
add v1.2d,v0.2d,v2.2d // "D + T1"
|
||||
.long 0xce638402 //sha512h2 v2.16b,v0.16b,v3.16b
|
||||
add v25.2d,v25.2d,v23.2d
|
||||
ld1 {v24.2d},[x3],#16
|
||||
ext v25.16b,v25.16b,v25.16b,#8
|
||||
ext v5.16b,v1.16b,v4.16b,#8
|
||||
ext v6.16b,v3.16b,v1.16b,#8
|
||||
add v4.2d,v4.2d,v25.2d // "T1 + H + K512[i]"
|
||||
.long 0xcec08217 //sha512su0 v23.16b,v16.16b
|
||||
ext v7.16b,v19.16b,v20.16b,#8
|
||||
.long 0xce6680a4 //sha512h v4.16b,v5.16b,v6.16b
|
||||
.long 0xce678ad7 //sha512su1 v23.16b,v22.16b,v7.16b
|
||||
add v0.2d,v3.2d,v4.2d // "D + T1"
|
||||
.long 0xce628464 //sha512h2 v4.16b,v3.16b,v2.16b
|
||||
add v24.2d,v24.2d,v16.2d
|
||||
ld1 {v25.2d},[x3],#16
|
||||
ext v24.16b,v24.16b,v24.16b,#8
|
||||
ext v5.16b,v0.16b,v1.16b,#8
|
||||
ext v6.16b,v2.16b,v0.16b,#8
|
||||
add v1.2d,v1.2d,v24.2d // "T1 + H + K512[i]"
|
||||
.long 0xcec08230 //sha512su0 v16.16b,v17.16b
|
||||
ext v7.16b,v20.16b,v21.16b,#8
|
||||
.long 0xce6680a1 //sha512h v1.16b,v5.16b,v6.16b
|
||||
.long 0xce678af0 //sha512su1 v16.16b,v23.16b,v7.16b
|
||||
add v3.2d,v2.2d,v1.2d // "D + T1"
|
||||
.long 0xce648441 //sha512h2 v1.16b,v2.16b,v4.16b
|
||||
add v25.2d,v25.2d,v17.2d
|
||||
ld1 {v24.2d},[x3],#16
|
||||
ext v25.16b,v25.16b,v25.16b,#8
|
||||
ext v5.16b,v3.16b,v0.16b,#8
|
||||
ext v6.16b,v4.16b,v3.16b,#8
|
||||
add v0.2d,v0.2d,v25.2d // "T1 + H + K512[i]"
|
||||
.long 0xcec08251 //sha512su0 v17.16b,v18.16b
|
||||
ext v7.16b,v21.16b,v22.16b,#8
|
||||
.long 0xce6680a0 //sha512h v0.16b,v5.16b,v6.16b
|
||||
.long 0xce678a11 //sha512su1 v17.16b,v16.16b,v7.16b
|
||||
add v2.2d,v4.2d,v0.2d // "D + T1"
|
||||
.long 0xce618480 //sha512h2 v0.16b,v4.16b,v1.16b
|
||||
add v24.2d,v24.2d,v18.2d
|
||||
ld1 {v25.2d},[x3],#16
|
||||
ext v24.16b,v24.16b,v24.16b,#8
|
||||
ext v5.16b,v2.16b,v3.16b,#8
|
||||
ext v6.16b,v1.16b,v2.16b,#8
|
||||
add v3.2d,v3.2d,v24.2d // "T1 + H + K512[i]"
|
||||
.long 0xcec08272 //sha512su0 v18.16b,v19.16b
|
||||
ext v7.16b,v22.16b,v23.16b,#8
|
||||
.long 0xce6680a3 //sha512h v3.16b,v5.16b,v6.16b
|
||||
.long 0xce678a32 //sha512su1 v18.16b,v17.16b,v7.16b
|
||||
add v4.2d,v1.2d,v3.2d // "D + T1"
|
||||
.long 0xce608423 //sha512h2 v3.16b,v1.16b,v0.16b
|
||||
add v25.2d,v25.2d,v19.2d
|
||||
ld1 {v24.2d},[x3],#16
|
||||
ext v25.16b,v25.16b,v25.16b,#8
|
||||
ext v5.16b,v4.16b,v2.16b,#8
|
||||
ext v6.16b,v0.16b,v4.16b,#8
|
||||
add v2.2d,v2.2d,v25.2d // "T1 + H + K512[i]"
|
||||
.long 0xcec08293 //sha512su0 v19.16b,v20.16b
|
||||
ext v7.16b,v23.16b,v16.16b,#8
|
||||
.long 0xce6680a2 //sha512h v2.16b,v5.16b,v6.16b
|
||||
.long 0xce678a53 //sha512su1 v19.16b,v18.16b,v7.16b
|
||||
add v1.2d,v0.2d,v2.2d // "D + T1"
|
||||
.long 0xce638402 //sha512h2 v2.16b,v0.16b,v3.16b
|
||||
add v24.2d,v24.2d,v20.2d
|
||||
ld1 {v25.2d},[x3],#16
|
||||
ext v24.16b,v24.16b,v24.16b,#8
|
||||
ext v5.16b,v1.16b,v4.16b,#8
|
||||
ext v6.16b,v3.16b,v1.16b,#8
|
||||
add v4.2d,v4.2d,v24.2d // "T1 + H + K512[i]"
|
||||
.long 0xcec082b4 //sha512su0 v20.16b,v21.16b
|
||||
ext v7.16b,v16.16b,v17.16b,#8
|
||||
.long 0xce6680a4 //sha512h v4.16b,v5.16b,v6.16b
|
||||
.long 0xce678a74 //sha512su1 v20.16b,v19.16b,v7.16b
|
||||
add v0.2d,v3.2d,v4.2d // "D + T1"
|
||||
.long 0xce628464 //sha512h2 v4.16b,v3.16b,v2.16b
|
||||
add v25.2d,v25.2d,v21.2d
|
||||
ld1 {v24.2d},[x3],#16
|
||||
ext v25.16b,v25.16b,v25.16b,#8
|
||||
ext v5.16b,v0.16b,v1.16b,#8
|
||||
ext v6.16b,v2.16b,v0.16b,#8
|
||||
add v1.2d,v1.2d,v25.2d // "T1 + H + K512[i]"
|
||||
.long 0xcec082d5 //sha512su0 v21.16b,v22.16b
|
||||
ext v7.16b,v17.16b,v18.16b,#8
|
||||
.long 0xce6680a1 //sha512h v1.16b,v5.16b,v6.16b
|
||||
.long 0xce678a95 //sha512su1 v21.16b,v20.16b,v7.16b
|
||||
add v3.2d,v2.2d,v1.2d // "D + T1"
|
||||
.long 0xce648441 //sha512h2 v1.16b,v2.16b,v4.16b
|
||||
add v24.2d,v24.2d,v22.2d
|
||||
ld1 {v25.2d},[x3],#16
|
||||
ext v24.16b,v24.16b,v24.16b,#8
|
||||
ext v5.16b,v3.16b,v0.16b,#8
|
||||
ext v6.16b,v4.16b,v3.16b,#8
|
||||
add v0.2d,v0.2d,v24.2d // "T1 + H + K512[i]"
|
||||
.long 0xcec082f6 //sha512su0 v22.16b,v23.16b
|
||||
ext v7.16b,v18.16b,v19.16b,#8
|
||||
.long 0xce6680a0 //sha512h v0.16b,v5.16b,v6.16b
|
||||
.long 0xce678ab6 //sha512su1 v22.16b,v21.16b,v7.16b
|
||||
add v2.2d,v4.2d,v0.2d // "D + T1"
|
||||
.long 0xce618480 //sha512h2 v0.16b,v4.16b,v1.16b
|
||||
add v25.2d,v25.2d,v23.2d
|
||||
ld1 {v24.2d},[x3],#16
|
||||
ext v25.16b,v25.16b,v25.16b,#8
|
||||
ext v5.16b,v2.16b,v3.16b,#8
|
||||
ext v6.16b,v1.16b,v2.16b,#8
|
||||
add v3.2d,v3.2d,v25.2d // "T1 + H + K512[i]"
|
||||
.long 0xcec08217 //sha512su0 v23.16b,v16.16b
|
||||
ext v7.16b,v19.16b,v20.16b,#8
|
||||
.long 0xce6680a3 //sha512h v3.16b,v5.16b,v6.16b
|
||||
.long 0xce678ad7 //sha512su1 v23.16b,v22.16b,v7.16b
|
||||
add v4.2d,v1.2d,v3.2d // "D + T1"
|
||||
.long 0xce608423 //sha512h2 v3.16b,v1.16b,v0.16b
|
||||
add v24.2d,v24.2d,v16.2d
|
||||
ld1 {v25.2d},[x3],#16
|
||||
ext v24.16b,v24.16b,v24.16b,#8
|
||||
ext v5.16b,v4.16b,v2.16b,#8
|
||||
ext v6.16b,v0.16b,v4.16b,#8
|
||||
add v2.2d,v2.2d,v24.2d // "T1 + H + K512[i]"
|
||||
.long 0xcec08230 //sha512su0 v16.16b,v17.16b
|
||||
ext v7.16b,v20.16b,v21.16b,#8
|
||||
.long 0xce6680a2 //sha512h v2.16b,v5.16b,v6.16b
|
||||
.long 0xce678af0 //sha512su1 v16.16b,v23.16b,v7.16b
|
||||
add v1.2d,v0.2d,v2.2d // "D + T1"
|
||||
.long 0xce638402 //sha512h2 v2.16b,v0.16b,v3.16b
|
||||
add v25.2d,v25.2d,v17.2d
|
||||
ld1 {v24.2d},[x3],#16
|
||||
ext v25.16b,v25.16b,v25.16b,#8
|
||||
ext v5.16b,v1.16b,v4.16b,#8
|
||||
ext v6.16b,v3.16b,v1.16b,#8
|
||||
add v4.2d,v4.2d,v25.2d // "T1 + H + K512[i]"
|
||||
.long 0xcec08251 //sha512su0 v17.16b,v18.16b
|
||||
ext v7.16b,v21.16b,v22.16b,#8
|
||||
.long 0xce6680a4 //sha512h v4.16b,v5.16b,v6.16b
|
||||
.long 0xce678a11 //sha512su1 v17.16b,v16.16b,v7.16b
|
||||
add v0.2d,v3.2d,v4.2d // "D + T1"
|
||||
.long 0xce628464 //sha512h2 v4.16b,v3.16b,v2.16b
|
||||
add v24.2d,v24.2d,v18.2d
|
||||
ld1 {v25.2d},[x3],#16
|
||||
ext v24.16b,v24.16b,v24.16b,#8
|
||||
ext v5.16b,v0.16b,v1.16b,#8
|
||||
ext v6.16b,v2.16b,v0.16b,#8
|
||||
add v1.2d,v1.2d,v24.2d // "T1 + H + K512[i]"
|
||||
.long 0xcec08272 //sha512su0 v18.16b,v19.16b
|
||||
ext v7.16b,v22.16b,v23.16b,#8
|
||||
.long 0xce6680a1 //sha512h v1.16b,v5.16b,v6.16b
|
||||
.long 0xce678a32 //sha512su1 v18.16b,v17.16b,v7.16b
|
||||
add v3.2d,v2.2d,v1.2d // "D + T1"
|
||||
.long 0xce648441 //sha512h2 v1.16b,v2.16b,v4.16b
|
||||
add v25.2d,v25.2d,v19.2d
|
||||
ld1 {v24.2d},[x3],#16
|
||||
ext v25.16b,v25.16b,v25.16b,#8
|
||||
ext v5.16b,v3.16b,v0.16b,#8
|
||||
ext v6.16b,v4.16b,v3.16b,#8
|
||||
add v0.2d,v0.2d,v25.2d // "T1 + H + K512[i]"
|
||||
.long 0xcec08293 //sha512su0 v19.16b,v20.16b
|
||||
ext v7.16b,v23.16b,v16.16b,#8
|
||||
.long 0xce6680a0 //sha512h v0.16b,v5.16b,v6.16b
|
||||
.long 0xce678a53 //sha512su1 v19.16b,v18.16b,v7.16b
|
||||
add v2.2d,v4.2d,v0.2d // "D + T1"
|
||||
.long 0xce618480 //sha512h2 v0.16b,v4.16b,v1.16b
|
||||
add v24.2d,v24.2d,v20.2d
|
||||
ld1 {v25.2d},[x3],#16
|
||||
ext v24.16b,v24.16b,v24.16b,#8
|
||||
ext v5.16b,v2.16b,v3.16b,#8
|
||||
ext v6.16b,v1.16b,v2.16b,#8
|
||||
add v3.2d,v3.2d,v24.2d // "T1 + H + K512[i]"
|
||||
.long 0xcec082b4 //sha512su0 v20.16b,v21.16b
|
||||
ext v7.16b,v16.16b,v17.16b,#8
|
||||
.long 0xce6680a3 //sha512h v3.16b,v5.16b,v6.16b
|
||||
.long 0xce678a74 //sha512su1 v20.16b,v19.16b,v7.16b
|
||||
add v4.2d,v1.2d,v3.2d // "D + T1"
|
||||
.long 0xce608423 //sha512h2 v3.16b,v1.16b,v0.16b
|
||||
add v25.2d,v25.2d,v21.2d
|
||||
ld1 {v24.2d},[x3],#16
|
||||
ext v25.16b,v25.16b,v25.16b,#8
|
||||
ext v5.16b,v4.16b,v2.16b,#8
|
||||
ext v6.16b,v0.16b,v4.16b,#8
|
||||
add v2.2d,v2.2d,v25.2d // "T1 + H + K512[i]"
|
||||
.long 0xcec082d5 //sha512su0 v21.16b,v22.16b
|
||||
ext v7.16b,v17.16b,v18.16b,#8
|
||||
.long 0xce6680a2 //sha512h v2.16b,v5.16b,v6.16b
|
||||
.long 0xce678a95 //sha512su1 v21.16b,v20.16b,v7.16b
|
||||
add v1.2d,v0.2d,v2.2d // "D + T1"
|
||||
.long 0xce638402 //sha512h2 v2.16b,v0.16b,v3.16b
|
||||
add v24.2d,v24.2d,v22.2d
|
||||
ld1 {v25.2d},[x3],#16
|
||||
ext v24.16b,v24.16b,v24.16b,#8
|
||||
ext v5.16b,v1.16b,v4.16b,#8
|
||||
ext v6.16b,v3.16b,v1.16b,#8
|
||||
add v4.2d,v4.2d,v24.2d // "T1 + H + K512[i]"
|
||||
.long 0xcec082f6 //sha512su0 v22.16b,v23.16b
|
||||
ext v7.16b,v18.16b,v19.16b,#8
|
||||
.long 0xce6680a4 //sha512h v4.16b,v5.16b,v6.16b
|
||||
.long 0xce678ab6 //sha512su1 v22.16b,v21.16b,v7.16b
|
||||
add v0.2d,v3.2d,v4.2d // "D + T1"
|
||||
.long 0xce628464 //sha512h2 v4.16b,v3.16b,v2.16b
|
||||
add v25.2d,v25.2d,v23.2d
|
||||
ld1 {v24.2d},[x3],#16
|
||||
ext v25.16b,v25.16b,v25.16b,#8
|
||||
ext v5.16b,v0.16b,v1.16b,#8
|
||||
ext v6.16b,v2.16b,v0.16b,#8
|
||||
add v1.2d,v1.2d,v25.2d // "T1 + H + K512[i]"
|
||||
.long 0xcec08217 //sha512su0 v23.16b,v16.16b
|
||||
ext v7.16b,v19.16b,v20.16b,#8
|
||||
.long 0xce6680a1 //sha512h v1.16b,v5.16b,v6.16b
|
||||
.long 0xce678ad7 //sha512su1 v23.16b,v22.16b,v7.16b
|
||||
add v3.2d,v2.2d,v1.2d // "D + T1"
|
||||
.long 0xce648441 //sha512h2 v1.16b,v2.16b,v4.16b
|
||||
add v24.2d,v24.2d,v16.2d
|
||||
ld1 {v25.2d},[x3],#16
|
||||
ext v24.16b,v24.16b,v24.16b,#8
|
||||
ext v5.16b,v3.16b,v0.16b,#8
|
||||
ext v6.16b,v4.16b,v3.16b,#8
|
||||
add v0.2d,v0.2d,v24.2d // "T1 + H + K512[i]"
|
||||
.long 0xcec08230 //sha512su0 v16.16b,v17.16b
|
||||
ext v7.16b,v20.16b,v21.16b,#8
|
||||
.long 0xce6680a0 //sha512h v0.16b,v5.16b,v6.16b
|
||||
.long 0xce678af0 //sha512su1 v16.16b,v23.16b,v7.16b
|
||||
add v2.2d,v4.2d,v0.2d // "D + T1"
|
||||
.long 0xce618480 //sha512h2 v0.16b,v4.16b,v1.16b
|
||||
add v25.2d,v25.2d,v17.2d
|
||||
ld1 {v24.2d},[x3],#16
|
||||
ext v25.16b,v25.16b,v25.16b,#8
|
||||
ext v5.16b,v2.16b,v3.16b,#8
|
||||
ext v6.16b,v1.16b,v2.16b,#8
|
||||
add v3.2d,v3.2d,v25.2d // "T1 + H + K512[i]"
|
||||
.long 0xcec08251 //sha512su0 v17.16b,v18.16b
|
||||
ext v7.16b,v21.16b,v22.16b,#8
|
||||
.long 0xce6680a3 //sha512h v3.16b,v5.16b,v6.16b
|
||||
.long 0xce678a11 //sha512su1 v17.16b,v16.16b,v7.16b
|
||||
add v4.2d,v1.2d,v3.2d // "D + T1"
|
||||
.long 0xce608423 //sha512h2 v3.16b,v1.16b,v0.16b
|
||||
add v24.2d,v24.2d,v18.2d
|
||||
ld1 {v25.2d},[x3],#16
|
||||
ext v24.16b,v24.16b,v24.16b,#8
|
||||
ext v5.16b,v4.16b,v2.16b,#8
|
||||
ext v6.16b,v0.16b,v4.16b,#8
|
||||
add v2.2d,v2.2d,v24.2d // "T1 + H + K512[i]"
|
||||
.long 0xcec08272 //sha512su0 v18.16b,v19.16b
|
||||
ext v7.16b,v22.16b,v23.16b,#8
|
||||
.long 0xce6680a2 //sha512h v2.16b,v5.16b,v6.16b
|
||||
.long 0xce678a32 //sha512su1 v18.16b,v17.16b,v7.16b
|
||||
add v1.2d,v0.2d,v2.2d // "D + T1"
|
||||
.long 0xce638402 //sha512h2 v2.16b,v0.16b,v3.16b
|
||||
add v25.2d,v25.2d,v19.2d
|
||||
ld1 {v24.2d},[x3],#16
|
||||
ext v25.16b,v25.16b,v25.16b,#8
|
||||
ext v5.16b,v1.16b,v4.16b,#8
|
||||
ext v6.16b,v3.16b,v1.16b,#8
|
||||
add v4.2d,v4.2d,v25.2d // "T1 + H + K512[i]"
|
||||
.long 0xcec08293 //sha512su0 v19.16b,v20.16b
|
||||
ext v7.16b,v23.16b,v16.16b,#8
|
||||
.long 0xce6680a4 //sha512h v4.16b,v5.16b,v6.16b
|
||||
.long 0xce678a53 //sha512su1 v19.16b,v18.16b,v7.16b
|
||||
add v0.2d,v3.2d,v4.2d // "D + T1"
|
||||
.long 0xce628464 //sha512h2 v4.16b,v3.16b,v2.16b
|
||||
add v24.2d,v24.2d,v20.2d
|
||||
ld1 {v25.2d},[x3],#16
|
||||
ext v24.16b,v24.16b,v24.16b,#8
|
||||
ext v5.16b,v0.16b,v1.16b,#8
|
||||
ext v6.16b,v2.16b,v0.16b,#8
|
||||
add v1.2d,v1.2d,v24.2d // "T1 + H + K512[i]"
|
||||
.long 0xcec082b4 //sha512su0 v20.16b,v21.16b
|
||||
ext v7.16b,v16.16b,v17.16b,#8
|
||||
.long 0xce6680a1 //sha512h v1.16b,v5.16b,v6.16b
|
||||
.long 0xce678a74 //sha512su1 v20.16b,v19.16b,v7.16b
|
||||
add v3.2d,v2.2d,v1.2d // "D + T1"
|
||||
.long 0xce648441 //sha512h2 v1.16b,v2.16b,v4.16b
|
||||
add v25.2d,v25.2d,v21.2d
|
||||
ld1 {v24.2d},[x3],#16
|
||||
ext v25.16b,v25.16b,v25.16b,#8
|
||||
ext v5.16b,v3.16b,v0.16b,#8
|
||||
ext v6.16b,v4.16b,v3.16b,#8
|
||||
add v0.2d,v0.2d,v25.2d // "T1 + H + K512[i]"
|
||||
.long 0xcec082d5 //sha512su0 v21.16b,v22.16b
|
||||
ext v7.16b,v17.16b,v18.16b,#8
|
||||
.long 0xce6680a0 //sha512h v0.16b,v5.16b,v6.16b
|
||||
.long 0xce678a95 //sha512su1 v21.16b,v20.16b,v7.16b
|
||||
add v2.2d,v4.2d,v0.2d // "D + T1"
|
||||
.long 0xce618480 //sha512h2 v0.16b,v4.16b,v1.16b
|
||||
add v24.2d,v24.2d,v22.2d
|
||||
ld1 {v25.2d},[x3],#16
|
||||
ext v24.16b,v24.16b,v24.16b,#8
|
||||
ext v5.16b,v2.16b,v3.16b,#8
|
||||
ext v6.16b,v1.16b,v2.16b,#8
|
||||
add v3.2d,v3.2d,v24.2d // "T1 + H + K512[i]"
|
||||
.long 0xcec082f6 //sha512su0 v22.16b,v23.16b
|
||||
ext v7.16b,v18.16b,v19.16b,#8
|
||||
.long 0xce6680a3 //sha512h v3.16b,v5.16b,v6.16b
|
||||
.long 0xce678ab6 //sha512su1 v22.16b,v21.16b,v7.16b
|
||||
add v4.2d,v1.2d,v3.2d // "D + T1"
|
||||
.long 0xce608423 //sha512h2 v3.16b,v1.16b,v0.16b
|
||||
add v25.2d,v25.2d,v23.2d
|
||||
ld1 {v24.2d},[x3],#16
|
||||
ext v25.16b,v25.16b,v25.16b,#8
|
||||
ext v5.16b,v4.16b,v2.16b,#8
|
||||
ext v6.16b,v0.16b,v4.16b,#8
|
||||
add v2.2d,v2.2d,v25.2d // "T1 + H + K512[i]"
|
||||
.long 0xcec08217 //sha512su0 v23.16b,v16.16b
|
||||
ext v7.16b,v19.16b,v20.16b,#8
|
||||
.long 0xce6680a2 //sha512h v2.16b,v5.16b,v6.16b
|
||||
.long 0xce678ad7 //sha512su1 v23.16b,v22.16b,v7.16b
|
||||
add v1.2d,v0.2d,v2.2d // "D + T1"
|
||||
.long 0xce638402 //sha512h2 v2.16b,v0.16b,v3.16b
|
||||
ld1 {v25.2d},[x3],#16
|
||||
add v24.2d,v24.2d,v16.2d
|
||||
ld1 {v16.16b},[x1],#16 // load next input
|
||||
ext v24.16b,v24.16b,v24.16b,#8
|
||||
ext v5.16b,v1.16b,v4.16b,#8
|
||||
ext v6.16b,v3.16b,v1.16b,#8
|
||||
add v4.2d,v4.2d,v24.2d // "T1 + H + K512[i]"
|
||||
.long 0xce6680a4 //sha512h v4.16b,v5.16b,v6.16b
|
||||
rev64 v16.16b,v16.16b
|
||||
add v0.2d,v3.2d,v4.2d // "D + T1"
|
||||
.long 0xce628464 //sha512h2 v4.16b,v3.16b,v2.16b
|
||||
ld1 {v24.2d},[x3],#16
|
||||
add v25.2d,v25.2d,v17.2d
|
||||
ld1 {v17.16b},[x1],#16 // load next input
|
||||
ext v25.16b,v25.16b,v25.16b,#8
|
||||
ext v5.16b,v0.16b,v1.16b,#8
|
||||
ext v6.16b,v2.16b,v0.16b,#8
|
||||
add v1.2d,v1.2d,v25.2d // "T1 + H + K512[i]"
|
||||
.long 0xce6680a1 //sha512h v1.16b,v5.16b,v6.16b
|
||||
rev64 v17.16b,v17.16b
|
||||
add v3.2d,v2.2d,v1.2d // "D + T1"
|
||||
.long 0xce648441 //sha512h2 v1.16b,v2.16b,v4.16b
|
||||
ld1 {v25.2d},[x3],#16
|
||||
add v24.2d,v24.2d,v18.2d
|
||||
ld1 {v18.16b},[x1],#16 // load next input
|
||||
ext v24.16b,v24.16b,v24.16b,#8
|
||||
ext v5.16b,v3.16b,v0.16b,#8
|
||||
ext v6.16b,v4.16b,v3.16b,#8
|
||||
add v0.2d,v0.2d,v24.2d // "T1 + H + K512[i]"
|
||||
.long 0xce6680a0 //sha512h v0.16b,v5.16b,v6.16b
|
||||
rev64 v18.16b,v18.16b
|
||||
add v2.2d,v4.2d,v0.2d // "D + T1"
|
||||
.long 0xce618480 //sha512h2 v0.16b,v4.16b,v1.16b
|
||||
ld1 {v24.2d},[x3],#16
|
||||
add v25.2d,v25.2d,v19.2d
|
||||
ld1 {v19.16b},[x1],#16 // load next input
|
||||
ext v25.16b,v25.16b,v25.16b,#8
|
||||
ext v5.16b,v2.16b,v3.16b,#8
|
||||
ext v6.16b,v1.16b,v2.16b,#8
|
||||
add v3.2d,v3.2d,v25.2d // "T1 + H + K512[i]"
|
||||
.long 0xce6680a3 //sha512h v3.16b,v5.16b,v6.16b
|
||||
rev64 v19.16b,v19.16b
|
||||
add v4.2d,v1.2d,v3.2d // "D + T1"
|
||||
.long 0xce608423 //sha512h2 v3.16b,v1.16b,v0.16b
|
||||
ld1 {v25.2d},[x3],#16
|
||||
add v24.2d,v24.2d,v20.2d
|
||||
ld1 {v20.16b},[x1],#16 // load next input
|
||||
ext v24.16b,v24.16b,v24.16b,#8
|
||||
ext v5.16b,v4.16b,v2.16b,#8
|
||||
ext v6.16b,v0.16b,v4.16b,#8
|
||||
add v2.2d,v2.2d,v24.2d // "T1 + H + K512[i]"
|
||||
.long 0xce6680a2 //sha512h v2.16b,v5.16b,v6.16b
|
||||
rev64 v20.16b,v20.16b
|
||||
add v1.2d,v0.2d,v2.2d // "D + T1"
|
||||
.long 0xce638402 //sha512h2 v2.16b,v0.16b,v3.16b
|
||||
ld1 {v24.2d},[x3],#16
|
||||
add v25.2d,v25.2d,v21.2d
|
||||
ld1 {v21.16b},[x1],#16 // load next input
|
||||
ext v25.16b,v25.16b,v25.16b,#8
|
||||
ext v5.16b,v1.16b,v4.16b,#8
|
||||
ext v6.16b,v3.16b,v1.16b,#8
|
||||
add v4.2d,v4.2d,v25.2d // "T1 + H + K512[i]"
|
||||
.long 0xce6680a4 //sha512h v4.16b,v5.16b,v6.16b
|
||||
rev64 v21.16b,v21.16b
|
||||
add v0.2d,v3.2d,v4.2d // "D + T1"
|
||||
.long 0xce628464 //sha512h2 v4.16b,v3.16b,v2.16b
|
||||
ld1 {v25.2d},[x3],#16
|
||||
add v24.2d,v24.2d,v22.2d
|
||||
ld1 {v22.16b},[x1],#16 // load next input
|
||||
ext v24.16b,v24.16b,v24.16b,#8
|
||||
ext v5.16b,v0.16b,v1.16b,#8
|
||||
ext v6.16b,v2.16b,v0.16b,#8
|
||||
add v1.2d,v1.2d,v24.2d // "T1 + H + K512[i]"
|
||||
.long 0xce6680a1 //sha512h v1.16b,v5.16b,v6.16b
|
||||
rev64 v22.16b,v22.16b
|
||||
add v3.2d,v2.2d,v1.2d // "D + T1"
|
||||
.long 0xce648441 //sha512h2 v1.16b,v2.16b,v4.16b
|
||||
sub x3,x3,#80*8 // rewind
|
||||
add v25.2d,v25.2d,v23.2d
|
||||
ld1 {v23.16b},[x1],#16 // load next input
|
||||
ext v25.16b,v25.16b,v25.16b,#8
|
||||
ext v5.16b,v3.16b,v0.16b,#8
|
||||
ext v6.16b,v4.16b,v3.16b,#8
|
||||
add v0.2d,v0.2d,v25.2d // "T1 + H + K512[i]"
|
||||
.long 0xce6680a0 //sha512h v0.16b,v5.16b,v6.16b
|
||||
rev64 v23.16b,v23.16b
|
||||
add v2.2d,v4.2d,v0.2d // "D + T1"
|
||||
.long 0xce618480 //sha512h2 v0.16b,v4.16b,v1.16b
|
||||
add v0.2d,v0.2d,v26.2d // accumulate
|
||||
add v1.2d,v1.2d,v27.2d
|
||||
add v2.2d,v2.2d,v28.2d
|
||||
add v3.2d,v3.2d,v29.2d
|
||||
|
||||
cbnz x2,Loop_hw
|
||||
|
||||
st1 {v0.2d,v1.2d,v2.2d,v3.2d},[x0] // store context
|
||||
|
||||
ldr x29,[sp],#16
|
||||
ret
|
||||
|
||||
#endif
|
||||
#endif // !OPENSSL_NO_ASM
|
||||
#endif // defined(__aarch64__) && defined(__APPLE__)
|
||||
#if defined(__linux__) && defined(__ELF__)
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#if defined(BORINGSSL_PREFIX)
|
||||
#include <CCryptoBoringSSL_boringssl_prefix_symbols_asm.h>
|
||||
#endif
|
||||
// Copyright 2014-2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
// Copyright 2014-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the OpenSSL license (the "License"). You may not use
|
||||
// this file except in compliance with the License. You can obtain a copy
|
||||
@@ -43,6 +43,7 @@
|
||||
// Denver 2.01 10.5 (+26%) 6.70 (+8%)
|
||||
// X-Gene 20.0 (+100%) 12.8 (+300%(***))
|
||||
// Mongoose 2.36 13.0 (+50%) 8.36 (+33%)
|
||||
// Kryo 1.92 17.4 (+30%) 11.2 (+8%)
|
||||
//
|
||||
// (*) Software SHA256 results are of lesser relevance, presented
|
||||
// mostly for informational purposes.
|
||||
@@ -51,7 +52,7 @@
|
||||
// on Cortex-A53 (or by 4 cycles per round).
|
||||
// (***) Super-impressive coefficients over gcc-generated code are
|
||||
// indication of some compiler "pathology", most notably code
|
||||
// generated with -mgeneral-regs-only is significanty faster
|
||||
// generated with -mgeneral-regs-only is significantly faster
|
||||
// and the gap is only 40-90%.
|
||||
|
||||
#ifndef __KERNEL__
|
||||
@@ -67,6 +68,17 @@
|
||||
.type sha512_block_data_order,%function
|
||||
.align 6
|
||||
sha512_block_data_order:
|
||||
AARCH64_VALID_CALL_TARGET
|
||||
#ifndef __KERNEL__
|
||||
#if __has_feature(hwaddress_sanitizer) && __clang_major__ >= 10
|
||||
adrp x16,:pg_hi21_nc:OPENSSL_armcap_P
|
||||
#else
|
||||
adrp x16,OPENSSL_armcap_P
|
||||
#endif
|
||||
ldr w16,[x16,:lo12:OPENSSL_armcap_P]
|
||||
tst w16,#ARMV8_SHA512
|
||||
b.ne .Lv8_entry
|
||||
#endif
|
||||
AARCH64_SIGN_LINK_REGISTER
|
||||
stp x29,x30,[sp,#-128]!
|
||||
add x29,sp,#0
|
||||
@@ -92,7 +104,7 @@ sha512_block_data_order:
|
||||
ldr x19,[x30],#8 // *K++
|
||||
eor x28,x21,x22 // magic seed
|
||||
str x1,[x29,#112]
|
||||
#ifndef __ARMEB__
|
||||
#ifndef __AARCH64EB__
|
||||
rev x3,x3 // 0
|
||||
#endif
|
||||
ror x16,x24,#14
|
||||
@@ -115,7 +127,7 @@ sha512_block_data_order:
|
||||
add x27,x27,x28 // h+=Maj(a,b,c)
|
||||
ldr x28,[x30],#8 // *K++, x19 in next round
|
||||
//add x27,x27,x17 // h+=Sigma0(a)
|
||||
#ifndef __ARMEB__
|
||||
#ifndef __AARCH64EB__
|
||||
rev x4,x4 // 1
|
||||
#endif
|
||||
ldp x5,x6,[x1],#2*8
|
||||
@@ -140,7 +152,7 @@ sha512_block_data_order:
|
||||
add x26,x26,x19 // h+=Maj(a,b,c)
|
||||
ldr x19,[x30],#8 // *K++, x28 in next round
|
||||
//add x26,x26,x17 // h+=Sigma0(a)
|
||||
#ifndef __ARMEB__
|
||||
#ifndef __AARCH64EB__
|
||||
rev x5,x5 // 2
|
||||
#endif
|
||||
add x26,x26,x17 // h+=Sigma0(a)
|
||||
@@ -164,7 +176,7 @@ sha512_block_data_order:
|
||||
add x25,x25,x28 // h+=Maj(a,b,c)
|
||||
ldr x28,[x30],#8 // *K++, x19 in next round
|
||||
//add x25,x25,x17 // h+=Sigma0(a)
|
||||
#ifndef __ARMEB__
|
||||
#ifndef __AARCH64EB__
|
||||
rev x6,x6 // 3
|
||||
#endif
|
||||
ldp x7,x8,[x1],#2*8
|
||||
@@ -189,7 +201,7 @@ sha512_block_data_order:
|
||||
add x24,x24,x19 // h+=Maj(a,b,c)
|
||||
ldr x19,[x30],#8 // *K++, x28 in next round
|
||||
//add x24,x24,x17 // h+=Sigma0(a)
|
||||
#ifndef __ARMEB__
|
||||
#ifndef __AARCH64EB__
|
||||
rev x7,x7 // 4
|
||||
#endif
|
||||
add x24,x24,x17 // h+=Sigma0(a)
|
||||
@@ -213,7 +225,7 @@ sha512_block_data_order:
|
||||
add x23,x23,x28 // h+=Maj(a,b,c)
|
||||
ldr x28,[x30],#8 // *K++, x19 in next round
|
||||
//add x23,x23,x17 // h+=Sigma0(a)
|
||||
#ifndef __ARMEB__
|
||||
#ifndef __AARCH64EB__
|
||||
rev x8,x8 // 5
|
||||
#endif
|
||||
ldp x9,x10,[x1],#2*8
|
||||
@@ -238,7 +250,7 @@ sha512_block_data_order:
|
||||
add x22,x22,x19 // h+=Maj(a,b,c)
|
||||
ldr x19,[x30],#8 // *K++, x28 in next round
|
||||
//add x22,x22,x17 // h+=Sigma0(a)
|
||||
#ifndef __ARMEB__
|
||||
#ifndef __AARCH64EB__
|
||||
rev x9,x9 // 6
|
||||
#endif
|
||||
add x22,x22,x17 // h+=Sigma0(a)
|
||||
@@ -262,7 +274,7 @@ sha512_block_data_order:
|
||||
add x21,x21,x28 // h+=Maj(a,b,c)
|
||||
ldr x28,[x30],#8 // *K++, x19 in next round
|
||||
//add x21,x21,x17 // h+=Sigma0(a)
|
||||
#ifndef __ARMEB__
|
||||
#ifndef __AARCH64EB__
|
||||
rev x10,x10 // 7
|
||||
#endif
|
||||
ldp x11,x12,[x1],#2*8
|
||||
@@ -287,7 +299,7 @@ sha512_block_data_order:
|
||||
add x20,x20,x19 // h+=Maj(a,b,c)
|
||||
ldr x19,[x30],#8 // *K++, x28 in next round
|
||||
//add x20,x20,x17 // h+=Sigma0(a)
|
||||
#ifndef __ARMEB__
|
||||
#ifndef __AARCH64EB__
|
||||
rev x11,x11 // 8
|
||||
#endif
|
||||
add x20,x20,x17 // h+=Sigma0(a)
|
||||
@@ -311,7 +323,7 @@ sha512_block_data_order:
|
||||
add x27,x27,x28 // h+=Maj(a,b,c)
|
||||
ldr x28,[x30],#8 // *K++, x19 in next round
|
||||
//add x27,x27,x17 // h+=Sigma0(a)
|
||||
#ifndef __ARMEB__
|
||||
#ifndef __AARCH64EB__
|
||||
rev x12,x12 // 9
|
||||
#endif
|
||||
ldp x13,x14,[x1],#2*8
|
||||
@@ -336,7 +348,7 @@ sha512_block_data_order:
|
||||
add x26,x26,x19 // h+=Maj(a,b,c)
|
||||
ldr x19,[x30],#8 // *K++, x28 in next round
|
||||
//add x26,x26,x17 // h+=Sigma0(a)
|
||||
#ifndef __ARMEB__
|
||||
#ifndef __AARCH64EB__
|
||||
rev x13,x13 // 10
|
||||
#endif
|
||||
add x26,x26,x17 // h+=Sigma0(a)
|
||||
@@ -360,7 +372,7 @@ sha512_block_data_order:
|
||||
add x25,x25,x28 // h+=Maj(a,b,c)
|
||||
ldr x28,[x30],#8 // *K++, x19 in next round
|
||||
//add x25,x25,x17 // h+=Sigma0(a)
|
||||
#ifndef __ARMEB__
|
||||
#ifndef __AARCH64EB__
|
||||
rev x14,x14 // 11
|
||||
#endif
|
||||
ldp x15,x0,[x1],#2*8
|
||||
@@ -386,7 +398,7 @@ sha512_block_data_order:
|
||||
add x24,x24,x19 // h+=Maj(a,b,c)
|
||||
ldr x19,[x30],#8 // *K++, x28 in next round
|
||||
//add x24,x24,x17 // h+=Sigma0(a)
|
||||
#ifndef __ARMEB__
|
||||
#ifndef __AARCH64EB__
|
||||
rev x15,x15 // 12
|
||||
#endif
|
||||
add x24,x24,x17 // h+=Sigma0(a)
|
||||
@@ -411,7 +423,7 @@ sha512_block_data_order:
|
||||
add x23,x23,x28 // h+=Maj(a,b,c)
|
||||
ldr x28,[x30],#8 // *K++, x19 in next round
|
||||
//add x23,x23,x17 // h+=Sigma0(a)
|
||||
#ifndef __ARMEB__
|
||||
#ifndef __AARCH64EB__
|
||||
rev x0,x0 // 13
|
||||
#endif
|
||||
ldp x1,x2,[x1]
|
||||
@@ -437,7 +449,7 @@ sha512_block_data_order:
|
||||
add x22,x22,x19 // h+=Maj(a,b,c)
|
||||
ldr x19,[x30],#8 // *K++, x28 in next round
|
||||
//add x22,x22,x17 // h+=Sigma0(a)
|
||||
#ifndef __ARMEB__
|
||||
#ifndef __AARCH64EB__
|
||||
rev x1,x1 // 14
|
||||
#endif
|
||||
ldr x6,[sp,#24]
|
||||
@@ -463,7 +475,7 @@ sha512_block_data_order:
|
||||
add x21,x21,x28 // h+=Maj(a,b,c)
|
||||
ldr x28,[x30],#8 // *K++, x19 in next round
|
||||
//add x21,x21,x17 // h+=Sigma0(a)
|
||||
#ifndef __ARMEB__
|
||||
#ifndef __AARCH64EB__
|
||||
rev x2,x2 // 15
|
||||
#endif
|
||||
ldr x7,[sp,#0]
|
||||
@@ -1081,6 +1093,527 @@ sha512_block_data_order:
|
||||
.byte 83,72,65,53,49,50,32,98,108,111,99,107,32,116,114,97,110,115,102,111,114,109,32,102,111,114,32,65,82,77,118,56,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0
|
||||
.align 2
|
||||
.align 2
|
||||
.text
|
||||
#ifndef __KERNEL__
|
||||
.type sha512_block_armv8,%function
|
||||
.align 6
|
||||
sha512_block_armv8:
|
||||
.Lv8_entry:
|
||||
stp x29,x30,[sp,#-16]!
|
||||
add x29,sp,#0
|
||||
|
||||
ld1 {v16.16b,v17.16b,v18.16b,v19.16b},[x1],#64 // load input
|
||||
ld1 {v20.16b,v21.16b,v22.16b,v23.16b},[x1],#64
|
||||
|
||||
ld1 {v0.2d,v1.2d,v2.2d,v3.2d},[x0] // load context
|
||||
adrp x3,.LK512
|
||||
add x3,x3,:lo12:.LK512
|
||||
|
||||
rev64 v16.16b,v16.16b
|
||||
rev64 v17.16b,v17.16b
|
||||
rev64 v18.16b,v18.16b
|
||||
rev64 v19.16b,v19.16b
|
||||
rev64 v20.16b,v20.16b
|
||||
rev64 v21.16b,v21.16b
|
||||
rev64 v22.16b,v22.16b
|
||||
rev64 v23.16b,v23.16b
|
||||
b .Loop_hw
|
||||
|
||||
.align 4
|
||||
.Loop_hw:
|
||||
ld1 {v24.2d},[x3],#16
|
||||
subs x2,x2,#1
|
||||
sub x4,x1,#128
|
||||
orr v26.16b,v0.16b,v0.16b // offload
|
||||
orr v27.16b,v1.16b,v1.16b
|
||||
orr v28.16b,v2.16b,v2.16b
|
||||
orr v29.16b,v3.16b,v3.16b
|
||||
csel x1,x1,x4,ne // conditional rewind
|
||||
add v24.2d,v24.2d,v16.2d
|
||||
ld1 {v25.2d},[x3],#16
|
||||
ext v24.16b,v24.16b,v24.16b,#8
|
||||
ext v5.16b,v2.16b,v3.16b,#8
|
||||
ext v6.16b,v1.16b,v2.16b,#8
|
||||
add v3.2d,v3.2d,v24.2d // "T1 + H + K512[i]"
|
||||
.inst 0xcec08230 //sha512su0 v16.16b,v17.16b
|
||||
ext v7.16b,v20.16b,v21.16b,#8
|
||||
.inst 0xce6680a3 //sha512h v3.16b,v5.16b,v6.16b
|
||||
.inst 0xce678af0 //sha512su1 v16.16b,v23.16b,v7.16b
|
||||
add v4.2d,v1.2d,v3.2d // "D + T1"
|
||||
.inst 0xce608423 //sha512h2 v3.16b,v1.16b,v0.16b
|
||||
add v25.2d,v25.2d,v17.2d
|
||||
ld1 {v24.2d},[x3],#16
|
||||
ext v25.16b,v25.16b,v25.16b,#8
|
||||
ext v5.16b,v4.16b,v2.16b,#8
|
||||
ext v6.16b,v0.16b,v4.16b,#8
|
||||
add v2.2d,v2.2d,v25.2d // "T1 + H + K512[i]"
|
||||
.inst 0xcec08251 //sha512su0 v17.16b,v18.16b
|
||||
ext v7.16b,v21.16b,v22.16b,#8
|
||||
.inst 0xce6680a2 //sha512h v2.16b,v5.16b,v6.16b
|
||||
.inst 0xce678a11 //sha512su1 v17.16b,v16.16b,v7.16b
|
||||
add v1.2d,v0.2d,v2.2d // "D + T1"
|
||||
.inst 0xce638402 //sha512h2 v2.16b,v0.16b,v3.16b
|
||||
add v24.2d,v24.2d,v18.2d
|
||||
ld1 {v25.2d},[x3],#16
|
||||
ext v24.16b,v24.16b,v24.16b,#8
|
||||
ext v5.16b,v1.16b,v4.16b,#8
|
||||
ext v6.16b,v3.16b,v1.16b,#8
|
||||
add v4.2d,v4.2d,v24.2d // "T1 + H + K512[i]"
|
||||
.inst 0xcec08272 //sha512su0 v18.16b,v19.16b
|
||||
ext v7.16b,v22.16b,v23.16b,#8
|
||||
.inst 0xce6680a4 //sha512h v4.16b,v5.16b,v6.16b
|
||||
.inst 0xce678a32 //sha512su1 v18.16b,v17.16b,v7.16b
|
||||
add v0.2d,v3.2d,v4.2d // "D + T1"
|
||||
.inst 0xce628464 //sha512h2 v4.16b,v3.16b,v2.16b
|
||||
add v25.2d,v25.2d,v19.2d
|
||||
ld1 {v24.2d},[x3],#16
|
||||
ext v25.16b,v25.16b,v25.16b,#8
|
||||
ext v5.16b,v0.16b,v1.16b,#8
|
||||
ext v6.16b,v2.16b,v0.16b,#8
|
||||
add v1.2d,v1.2d,v25.2d // "T1 + H + K512[i]"
|
||||
.inst 0xcec08293 //sha512su0 v19.16b,v20.16b
|
||||
ext v7.16b,v23.16b,v16.16b,#8
|
||||
.inst 0xce6680a1 //sha512h v1.16b,v5.16b,v6.16b
|
||||
.inst 0xce678a53 //sha512su1 v19.16b,v18.16b,v7.16b
|
||||
add v3.2d,v2.2d,v1.2d // "D + T1"
|
||||
.inst 0xce648441 //sha512h2 v1.16b,v2.16b,v4.16b
|
||||
add v24.2d,v24.2d,v20.2d
|
||||
ld1 {v25.2d},[x3],#16
|
||||
ext v24.16b,v24.16b,v24.16b,#8
|
||||
ext v5.16b,v3.16b,v0.16b,#8
|
||||
ext v6.16b,v4.16b,v3.16b,#8
|
||||
add v0.2d,v0.2d,v24.2d // "T1 + H + K512[i]"
|
||||
.inst 0xcec082b4 //sha512su0 v20.16b,v21.16b
|
||||
ext v7.16b,v16.16b,v17.16b,#8
|
||||
.inst 0xce6680a0 //sha512h v0.16b,v5.16b,v6.16b
|
||||
.inst 0xce678a74 //sha512su1 v20.16b,v19.16b,v7.16b
|
||||
add v2.2d,v4.2d,v0.2d // "D + T1"
|
||||
.inst 0xce618480 //sha512h2 v0.16b,v4.16b,v1.16b
|
||||
add v25.2d,v25.2d,v21.2d
|
||||
ld1 {v24.2d},[x3],#16
|
||||
ext v25.16b,v25.16b,v25.16b,#8
|
||||
ext v5.16b,v2.16b,v3.16b,#8
|
||||
ext v6.16b,v1.16b,v2.16b,#8
|
||||
add v3.2d,v3.2d,v25.2d // "T1 + H + K512[i]"
|
||||
.inst 0xcec082d5 //sha512su0 v21.16b,v22.16b
|
||||
ext v7.16b,v17.16b,v18.16b,#8
|
||||
.inst 0xce6680a3 //sha512h v3.16b,v5.16b,v6.16b
|
||||
.inst 0xce678a95 //sha512su1 v21.16b,v20.16b,v7.16b
|
||||
add v4.2d,v1.2d,v3.2d // "D + T1"
|
||||
.inst 0xce608423 //sha512h2 v3.16b,v1.16b,v0.16b
|
||||
add v24.2d,v24.2d,v22.2d
|
||||
ld1 {v25.2d},[x3],#16
|
||||
ext v24.16b,v24.16b,v24.16b,#8
|
||||
ext v5.16b,v4.16b,v2.16b,#8
|
||||
ext v6.16b,v0.16b,v4.16b,#8
|
||||
add v2.2d,v2.2d,v24.2d // "T1 + H + K512[i]"
|
||||
.inst 0xcec082f6 //sha512su0 v22.16b,v23.16b
|
||||
ext v7.16b,v18.16b,v19.16b,#8
|
||||
.inst 0xce6680a2 //sha512h v2.16b,v5.16b,v6.16b
|
||||
.inst 0xce678ab6 //sha512su1 v22.16b,v21.16b,v7.16b
|
||||
add v1.2d,v0.2d,v2.2d // "D + T1"
|
||||
.inst 0xce638402 //sha512h2 v2.16b,v0.16b,v3.16b
|
||||
add v25.2d,v25.2d,v23.2d
|
||||
ld1 {v24.2d},[x3],#16
|
||||
ext v25.16b,v25.16b,v25.16b,#8
|
||||
ext v5.16b,v1.16b,v4.16b,#8
|
||||
ext v6.16b,v3.16b,v1.16b,#8
|
||||
add v4.2d,v4.2d,v25.2d // "T1 + H + K512[i]"
|
||||
.inst 0xcec08217 //sha512su0 v23.16b,v16.16b
|
||||
ext v7.16b,v19.16b,v20.16b,#8
|
||||
.inst 0xce6680a4 //sha512h v4.16b,v5.16b,v6.16b
|
||||
.inst 0xce678ad7 //sha512su1 v23.16b,v22.16b,v7.16b
|
||||
add v0.2d,v3.2d,v4.2d // "D + T1"
|
||||
.inst 0xce628464 //sha512h2 v4.16b,v3.16b,v2.16b
|
||||
add v24.2d,v24.2d,v16.2d
|
||||
ld1 {v25.2d},[x3],#16
|
||||
ext v24.16b,v24.16b,v24.16b,#8
|
||||
ext v5.16b,v0.16b,v1.16b,#8
|
||||
ext v6.16b,v2.16b,v0.16b,#8
|
||||
add v1.2d,v1.2d,v24.2d // "T1 + H + K512[i]"
|
||||
.inst 0xcec08230 //sha512su0 v16.16b,v17.16b
|
||||
ext v7.16b,v20.16b,v21.16b,#8
|
||||
.inst 0xce6680a1 //sha512h v1.16b,v5.16b,v6.16b
|
||||
.inst 0xce678af0 //sha512su1 v16.16b,v23.16b,v7.16b
|
||||
add v3.2d,v2.2d,v1.2d // "D + T1"
|
||||
.inst 0xce648441 //sha512h2 v1.16b,v2.16b,v4.16b
|
||||
add v25.2d,v25.2d,v17.2d
|
||||
ld1 {v24.2d},[x3],#16
|
||||
ext v25.16b,v25.16b,v25.16b,#8
|
||||
ext v5.16b,v3.16b,v0.16b,#8
|
||||
ext v6.16b,v4.16b,v3.16b,#8
|
||||
add v0.2d,v0.2d,v25.2d // "T1 + H + K512[i]"
|
||||
.inst 0xcec08251 //sha512su0 v17.16b,v18.16b
|
||||
ext v7.16b,v21.16b,v22.16b,#8
|
||||
.inst 0xce6680a0 //sha512h v0.16b,v5.16b,v6.16b
|
||||
.inst 0xce678a11 //sha512su1 v17.16b,v16.16b,v7.16b
|
||||
add v2.2d,v4.2d,v0.2d // "D + T1"
|
||||
.inst 0xce618480 //sha512h2 v0.16b,v4.16b,v1.16b
|
||||
add v24.2d,v24.2d,v18.2d
|
||||
ld1 {v25.2d},[x3],#16
|
||||
ext v24.16b,v24.16b,v24.16b,#8
|
||||
ext v5.16b,v2.16b,v3.16b,#8
|
||||
ext v6.16b,v1.16b,v2.16b,#8
|
||||
add v3.2d,v3.2d,v24.2d // "T1 + H + K512[i]"
|
||||
.inst 0xcec08272 //sha512su0 v18.16b,v19.16b
|
||||
ext v7.16b,v22.16b,v23.16b,#8
|
||||
.inst 0xce6680a3 //sha512h v3.16b,v5.16b,v6.16b
|
||||
.inst 0xce678a32 //sha512su1 v18.16b,v17.16b,v7.16b
|
||||
add v4.2d,v1.2d,v3.2d // "D + T1"
|
||||
.inst 0xce608423 //sha512h2 v3.16b,v1.16b,v0.16b
|
||||
add v25.2d,v25.2d,v19.2d
|
||||
ld1 {v24.2d},[x3],#16
|
||||
ext v25.16b,v25.16b,v25.16b,#8
|
||||
ext v5.16b,v4.16b,v2.16b,#8
|
||||
ext v6.16b,v0.16b,v4.16b,#8
|
||||
add v2.2d,v2.2d,v25.2d // "T1 + H + K512[i]"
|
||||
.inst 0xcec08293 //sha512su0 v19.16b,v20.16b
|
||||
ext v7.16b,v23.16b,v16.16b,#8
|
||||
.inst 0xce6680a2 //sha512h v2.16b,v5.16b,v6.16b
|
||||
.inst 0xce678a53 //sha512su1 v19.16b,v18.16b,v7.16b
|
||||
add v1.2d,v0.2d,v2.2d // "D + T1"
|
||||
.inst 0xce638402 //sha512h2 v2.16b,v0.16b,v3.16b
|
||||
add v24.2d,v24.2d,v20.2d
|
||||
ld1 {v25.2d},[x3],#16
|
||||
ext v24.16b,v24.16b,v24.16b,#8
|
||||
ext v5.16b,v1.16b,v4.16b,#8
|
||||
ext v6.16b,v3.16b,v1.16b,#8
|
||||
add v4.2d,v4.2d,v24.2d // "T1 + H + K512[i]"
|
||||
.inst 0xcec082b4 //sha512su0 v20.16b,v21.16b
|
||||
ext v7.16b,v16.16b,v17.16b,#8
|
||||
.inst 0xce6680a4 //sha512h v4.16b,v5.16b,v6.16b
|
||||
.inst 0xce678a74 //sha512su1 v20.16b,v19.16b,v7.16b
|
||||
add v0.2d,v3.2d,v4.2d // "D + T1"
|
||||
.inst 0xce628464 //sha512h2 v4.16b,v3.16b,v2.16b
|
||||
add v25.2d,v25.2d,v21.2d
|
||||
ld1 {v24.2d},[x3],#16
|
||||
ext v25.16b,v25.16b,v25.16b,#8
|
||||
ext v5.16b,v0.16b,v1.16b,#8
|
||||
ext v6.16b,v2.16b,v0.16b,#8
|
||||
add v1.2d,v1.2d,v25.2d // "T1 + H + K512[i]"
|
||||
.inst 0xcec082d5 //sha512su0 v21.16b,v22.16b
|
||||
ext v7.16b,v17.16b,v18.16b,#8
|
||||
.inst 0xce6680a1 //sha512h v1.16b,v5.16b,v6.16b
|
||||
.inst 0xce678a95 //sha512su1 v21.16b,v20.16b,v7.16b
|
||||
add v3.2d,v2.2d,v1.2d // "D + T1"
|
||||
.inst 0xce648441 //sha512h2 v1.16b,v2.16b,v4.16b
|
||||
add v24.2d,v24.2d,v22.2d
|
||||
ld1 {v25.2d},[x3],#16
|
||||
ext v24.16b,v24.16b,v24.16b,#8
|
||||
ext v5.16b,v3.16b,v0.16b,#8
|
||||
ext v6.16b,v4.16b,v3.16b,#8
|
||||
add v0.2d,v0.2d,v24.2d // "T1 + H + K512[i]"
|
||||
.inst 0xcec082f6 //sha512su0 v22.16b,v23.16b
|
||||
ext v7.16b,v18.16b,v19.16b,#8
|
||||
.inst 0xce6680a0 //sha512h v0.16b,v5.16b,v6.16b
|
||||
.inst 0xce678ab6 //sha512su1 v22.16b,v21.16b,v7.16b
|
||||
add v2.2d,v4.2d,v0.2d // "D + T1"
|
||||
.inst 0xce618480 //sha512h2 v0.16b,v4.16b,v1.16b
|
||||
add v25.2d,v25.2d,v23.2d
|
||||
ld1 {v24.2d},[x3],#16
|
||||
ext v25.16b,v25.16b,v25.16b,#8
|
||||
ext v5.16b,v2.16b,v3.16b,#8
|
||||
ext v6.16b,v1.16b,v2.16b,#8
|
||||
add v3.2d,v3.2d,v25.2d // "T1 + H + K512[i]"
|
||||
.inst 0xcec08217 //sha512su0 v23.16b,v16.16b
|
||||
ext v7.16b,v19.16b,v20.16b,#8
|
||||
.inst 0xce6680a3 //sha512h v3.16b,v5.16b,v6.16b
|
||||
.inst 0xce678ad7 //sha512su1 v23.16b,v22.16b,v7.16b
|
||||
add v4.2d,v1.2d,v3.2d // "D + T1"
|
||||
.inst 0xce608423 //sha512h2 v3.16b,v1.16b,v0.16b
|
||||
add v24.2d,v24.2d,v16.2d
|
||||
ld1 {v25.2d},[x3],#16
|
||||
ext v24.16b,v24.16b,v24.16b,#8
|
||||
ext v5.16b,v4.16b,v2.16b,#8
|
||||
ext v6.16b,v0.16b,v4.16b,#8
|
||||
add v2.2d,v2.2d,v24.2d // "T1 + H + K512[i]"
|
||||
.inst 0xcec08230 //sha512su0 v16.16b,v17.16b
|
||||
ext v7.16b,v20.16b,v21.16b,#8
|
||||
.inst 0xce6680a2 //sha512h v2.16b,v5.16b,v6.16b
|
||||
.inst 0xce678af0 //sha512su1 v16.16b,v23.16b,v7.16b
|
||||
add v1.2d,v0.2d,v2.2d // "D + T1"
|
||||
.inst 0xce638402 //sha512h2 v2.16b,v0.16b,v3.16b
|
||||
add v25.2d,v25.2d,v17.2d
|
||||
ld1 {v24.2d},[x3],#16
|
||||
ext v25.16b,v25.16b,v25.16b,#8
|
||||
ext v5.16b,v1.16b,v4.16b,#8
|
||||
ext v6.16b,v3.16b,v1.16b,#8
|
||||
add v4.2d,v4.2d,v25.2d // "T1 + H + K512[i]"
|
||||
.inst 0xcec08251 //sha512su0 v17.16b,v18.16b
|
||||
ext v7.16b,v21.16b,v22.16b,#8
|
||||
.inst 0xce6680a4 //sha512h v4.16b,v5.16b,v6.16b
|
||||
.inst 0xce678a11 //sha512su1 v17.16b,v16.16b,v7.16b
|
||||
add v0.2d,v3.2d,v4.2d // "D + T1"
|
||||
.inst 0xce628464 //sha512h2 v4.16b,v3.16b,v2.16b
|
||||
add v24.2d,v24.2d,v18.2d
|
||||
ld1 {v25.2d},[x3],#16
|
||||
ext v24.16b,v24.16b,v24.16b,#8
|
||||
ext v5.16b,v0.16b,v1.16b,#8
|
||||
ext v6.16b,v2.16b,v0.16b,#8
|
||||
add v1.2d,v1.2d,v24.2d // "T1 + H + K512[i]"
|
||||
.inst 0xcec08272 //sha512su0 v18.16b,v19.16b
|
||||
ext v7.16b,v22.16b,v23.16b,#8
|
||||
.inst 0xce6680a1 //sha512h v1.16b,v5.16b,v6.16b
|
||||
.inst 0xce678a32 //sha512su1 v18.16b,v17.16b,v7.16b
|
||||
add v3.2d,v2.2d,v1.2d // "D + T1"
|
||||
.inst 0xce648441 //sha512h2 v1.16b,v2.16b,v4.16b
|
||||
add v25.2d,v25.2d,v19.2d
|
||||
ld1 {v24.2d},[x3],#16
|
||||
ext v25.16b,v25.16b,v25.16b,#8
|
||||
ext v5.16b,v3.16b,v0.16b,#8
|
||||
ext v6.16b,v4.16b,v3.16b,#8
|
||||
add v0.2d,v0.2d,v25.2d // "T1 + H + K512[i]"
|
||||
.inst 0xcec08293 //sha512su0 v19.16b,v20.16b
|
||||
ext v7.16b,v23.16b,v16.16b,#8
|
||||
.inst 0xce6680a0 //sha512h v0.16b,v5.16b,v6.16b
|
||||
.inst 0xce678a53 //sha512su1 v19.16b,v18.16b,v7.16b
|
||||
add v2.2d,v4.2d,v0.2d // "D + T1"
|
||||
.inst 0xce618480 //sha512h2 v0.16b,v4.16b,v1.16b
|
||||
add v24.2d,v24.2d,v20.2d
|
||||
ld1 {v25.2d},[x3],#16
|
||||
ext v24.16b,v24.16b,v24.16b,#8
|
||||
ext v5.16b,v2.16b,v3.16b,#8
|
||||
ext v6.16b,v1.16b,v2.16b,#8
|
||||
add v3.2d,v3.2d,v24.2d // "T1 + H + K512[i]"
|
||||
.inst 0xcec082b4 //sha512su0 v20.16b,v21.16b
|
||||
ext v7.16b,v16.16b,v17.16b,#8
|
||||
.inst 0xce6680a3 //sha512h v3.16b,v5.16b,v6.16b
|
||||
.inst 0xce678a74 //sha512su1 v20.16b,v19.16b,v7.16b
|
||||
add v4.2d,v1.2d,v3.2d // "D + T1"
|
||||
.inst 0xce608423 //sha512h2 v3.16b,v1.16b,v0.16b
|
||||
add v25.2d,v25.2d,v21.2d
|
||||
ld1 {v24.2d},[x3],#16
|
||||
ext v25.16b,v25.16b,v25.16b,#8
|
||||
ext v5.16b,v4.16b,v2.16b,#8
|
||||
ext v6.16b,v0.16b,v4.16b,#8
|
||||
add v2.2d,v2.2d,v25.2d // "T1 + H + K512[i]"
|
||||
.inst 0xcec082d5 //sha512su0 v21.16b,v22.16b
|
||||
ext v7.16b,v17.16b,v18.16b,#8
|
||||
.inst 0xce6680a2 //sha512h v2.16b,v5.16b,v6.16b
|
||||
.inst 0xce678a95 //sha512su1 v21.16b,v20.16b,v7.16b
|
||||
add v1.2d,v0.2d,v2.2d // "D + T1"
|
||||
.inst 0xce638402 //sha512h2 v2.16b,v0.16b,v3.16b
|
||||
add v24.2d,v24.2d,v22.2d
|
||||
ld1 {v25.2d},[x3],#16
|
||||
ext v24.16b,v24.16b,v24.16b,#8
|
||||
ext v5.16b,v1.16b,v4.16b,#8
|
||||
ext v6.16b,v3.16b,v1.16b,#8
|
||||
add v4.2d,v4.2d,v24.2d // "T1 + H + K512[i]"
|
||||
.inst 0xcec082f6 //sha512su0 v22.16b,v23.16b
|
||||
ext v7.16b,v18.16b,v19.16b,#8
|
||||
.inst 0xce6680a4 //sha512h v4.16b,v5.16b,v6.16b
|
||||
.inst 0xce678ab6 //sha512su1 v22.16b,v21.16b,v7.16b
|
||||
add v0.2d,v3.2d,v4.2d // "D + T1"
|
||||
.inst 0xce628464 //sha512h2 v4.16b,v3.16b,v2.16b
|
||||
add v25.2d,v25.2d,v23.2d
|
||||
ld1 {v24.2d},[x3],#16
|
||||
ext v25.16b,v25.16b,v25.16b,#8
|
||||
ext v5.16b,v0.16b,v1.16b,#8
|
||||
ext v6.16b,v2.16b,v0.16b,#8
|
||||
add v1.2d,v1.2d,v25.2d // "T1 + H + K512[i]"
|
||||
.inst 0xcec08217 //sha512su0 v23.16b,v16.16b
|
||||
ext v7.16b,v19.16b,v20.16b,#8
|
||||
.inst 0xce6680a1 //sha512h v1.16b,v5.16b,v6.16b
|
||||
.inst 0xce678ad7 //sha512su1 v23.16b,v22.16b,v7.16b
|
||||
add v3.2d,v2.2d,v1.2d // "D + T1"
|
||||
.inst 0xce648441 //sha512h2 v1.16b,v2.16b,v4.16b
|
||||
add v24.2d,v24.2d,v16.2d
|
||||
ld1 {v25.2d},[x3],#16
|
||||
ext v24.16b,v24.16b,v24.16b,#8
|
||||
ext v5.16b,v3.16b,v0.16b,#8
|
||||
ext v6.16b,v4.16b,v3.16b,#8
|
||||
add v0.2d,v0.2d,v24.2d // "T1 + H + K512[i]"
|
||||
.inst 0xcec08230 //sha512su0 v16.16b,v17.16b
|
||||
ext v7.16b,v20.16b,v21.16b,#8
|
||||
.inst 0xce6680a0 //sha512h v0.16b,v5.16b,v6.16b
|
||||
.inst 0xce678af0 //sha512su1 v16.16b,v23.16b,v7.16b
|
||||
add v2.2d,v4.2d,v0.2d // "D + T1"
|
||||
.inst 0xce618480 //sha512h2 v0.16b,v4.16b,v1.16b
|
||||
add v25.2d,v25.2d,v17.2d
|
||||
ld1 {v24.2d},[x3],#16
|
||||
ext v25.16b,v25.16b,v25.16b,#8
|
||||
ext v5.16b,v2.16b,v3.16b,#8
|
||||
ext v6.16b,v1.16b,v2.16b,#8
|
||||
add v3.2d,v3.2d,v25.2d // "T1 + H + K512[i]"
|
||||
.inst 0xcec08251 //sha512su0 v17.16b,v18.16b
|
||||
ext v7.16b,v21.16b,v22.16b,#8
|
||||
.inst 0xce6680a3 //sha512h v3.16b,v5.16b,v6.16b
|
||||
.inst 0xce678a11 //sha512su1 v17.16b,v16.16b,v7.16b
|
||||
add v4.2d,v1.2d,v3.2d // "D + T1"
|
||||
.inst 0xce608423 //sha512h2 v3.16b,v1.16b,v0.16b
|
||||
add v24.2d,v24.2d,v18.2d
|
||||
ld1 {v25.2d},[x3],#16
|
||||
ext v24.16b,v24.16b,v24.16b,#8
|
||||
ext v5.16b,v4.16b,v2.16b,#8
|
||||
ext v6.16b,v0.16b,v4.16b,#8
|
||||
add v2.2d,v2.2d,v24.2d // "T1 + H + K512[i]"
|
||||
.inst 0xcec08272 //sha512su0 v18.16b,v19.16b
|
||||
ext v7.16b,v22.16b,v23.16b,#8
|
||||
.inst 0xce6680a2 //sha512h v2.16b,v5.16b,v6.16b
|
||||
.inst 0xce678a32 //sha512su1 v18.16b,v17.16b,v7.16b
|
||||
add v1.2d,v0.2d,v2.2d // "D + T1"
|
||||
.inst 0xce638402 //sha512h2 v2.16b,v0.16b,v3.16b
|
||||
add v25.2d,v25.2d,v19.2d
|
||||
ld1 {v24.2d},[x3],#16
|
||||
ext v25.16b,v25.16b,v25.16b,#8
|
||||
ext v5.16b,v1.16b,v4.16b,#8
|
||||
ext v6.16b,v3.16b,v1.16b,#8
|
||||
add v4.2d,v4.2d,v25.2d // "T1 + H + K512[i]"
|
||||
.inst 0xcec08293 //sha512su0 v19.16b,v20.16b
|
||||
ext v7.16b,v23.16b,v16.16b,#8
|
||||
.inst 0xce6680a4 //sha512h v4.16b,v5.16b,v6.16b
|
||||
.inst 0xce678a53 //sha512su1 v19.16b,v18.16b,v7.16b
|
||||
add v0.2d,v3.2d,v4.2d // "D + T1"
|
||||
.inst 0xce628464 //sha512h2 v4.16b,v3.16b,v2.16b
|
||||
add v24.2d,v24.2d,v20.2d
|
||||
ld1 {v25.2d},[x3],#16
|
||||
ext v24.16b,v24.16b,v24.16b,#8
|
||||
ext v5.16b,v0.16b,v1.16b,#8
|
||||
ext v6.16b,v2.16b,v0.16b,#8
|
||||
add v1.2d,v1.2d,v24.2d // "T1 + H + K512[i]"
|
||||
.inst 0xcec082b4 //sha512su0 v20.16b,v21.16b
|
||||
ext v7.16b,v16.16b,v17.16b,#8
|
||||
.inst 0xce6680a1 //sha512h v1.16b,v5.16b,v6.16b
|
||||
.inst 0xce678a74 //sha512su1 v20.16b,v19.16b,v7.16b
|
||||
add v3.2d,v2.2d,v1.2d // "D + T1"
|
||||
.inst 0xce648441 //sha512h2 v1.16b,v2.16b,v4.16b
|
||||
add v25.2d,v25.2d,v21.2d
|
||||
ld1 {v24.2d},[x3],#16
|
||||
ext v25.16b,v25.16b,v25.16b,#8
|
||||
ext v5.16b,v3.16b,v0.16b,#8
|
||||
ext v6.16b,v4.16b,v3.16b,#8
|
||||
add v0.2d,v0.2d,v25.2d // "T1 + H + K512[i]"
|
||||
.inst 0xcec082d5 //sha512su0 v21.16b,v22.16b
|
||||
ext v7.16b,v17.16b,v18.16b,#8
|
||||
.inst 0xce6680a0 //sha512h v0.16b,v5.16b,v6.16b
|
||||
.inst 0xce678a95 //sha512su1 v21.16b,v20.16b,v7.16b
|
||||
add v2.2d,v4.2d,v0.2d // "D + T1"
|
||||
.inst 0xce618480 //sha512h2 v0.16b,v4.16b,v1.16b
|
||||
add v24.2d,v24.2d,v22.2d
|
||||
ld1 {v25.2d},[x3],#16
|
||||
ext v24.16b,v24.16b,v24.16b,#8
|
||||
ext v5.16b,v2.16b,v3.16b,#8
|
||||
ext v6.16b,v1.16b,v2.16b,#8
|
||||
add v3.2d,v3.2d,v24.2d // "T1 + H + K512[i]"
|
||||
.inst 0xcec082f6 //sha512su0 v22.16b,v23.16b
|
||||
ext v7.16b,v18.16b,v19.16b,#8
|
||||
.inst 0xce6680a3 //sha512h v3.16b,v5.16b,v6.16b
|
||||
.inst 0xce678ab6 //sha512su1 v22.16b,v21.16b,v7.16b
|
||||
add v4.2d,v1.2d,v3.2d // "D + T1"
|
||||
.inst 0xce608423 //sha512h2 v3.16b,v1.16b,v0.16b
|
||||
add v25.2d,v25.2d,v23.2d
|
||||
ld1 {v24.2d},[x3],#16
|
||||
ext v25.16b,v25.16b,v25.16b,#8
|
||||
ext v5.16b,v4.16b,v2.16b,#8
|
||||
ext v6.16b,v0.16b,v4.16b,#8
|
||||
add v2.2d,v2.2d,v25.2d // "T1 + H + K512[i]"
|
||||
.inst 0xcec08217 //sha512su0 v23.16b,v16.16b
|
||||
ext v7.16b,v19.16b,v20.16b,#8
|
||||
.inst 0xce6680a2 //sha512h v2.16b,v5.16b,v6.16b
|
||||
.inst 0xce678ad7 //sha512su1 v23.16b,v22.16b,v7.16b
|
||||
add v1.2d,v0.2d,v2.2d // "D + T1"
|
||||
.inst 0xce638402 //sha512h2 v2.16b,v0.16b,v3.16b
|
||||
ld1 {v25.2d},[x3],#16
|
||||
add v24.2d,v24.2d,v16.2d
|
||||
ld1 {v16.16b},[x1],#16 // load next input
|
||||
ext v24.16b,v24.16b,v24.16b,#8
|
||||
ext v5.16b,v1.16b,v4.16b,#8
|
||||
ext v6.16b,v3.16b,v1.16b,#8
|
||||
add v4.2d,v4.2d,v24.2d // "T1 + H + K512[i]"
|
||||
.inst 0xce6680a4 //sha512h v4.16b,v5.16b,v6.16b
|
||||
rev64 v16.16b,v16.16b
|
||||
add v0.2d,v3.2d,v4.2d // "D + T1"
|
||||
.inst 0xce628464 //sha512h2 v4.16b,v3.16b,v2.16b
|
||||
ld1 {v24.2d},[x3],#16
|
||||
add v25.2d,v25.2d,v17.2d
|
||||
ld1 {v17.16b},[x1],#16 // load next input
|
||||
ext v25.16b,v25.16b,v25.16b,#8
|
||||
ext v5.16b,v0.16b,v1.16b,#8
|
||||
ext v6.16b,v2.16b,v0.16b,#8
|
||||
add v1.2d,v1.2d,v25.2d // "T1 + H + K512[i]"
|
||||
.inst 0xce6680a1 //sha512h v1.16b,v5.16b,v6.16b
|
||||
rev64 v17.16b,v17.16b
|
||||
add v3.2d,v2.2d,v1.2d // "D + T1"
|
||||
.inst 0xce648441 //sha512h2 v1.16b,v2.16b,v4.16b
|
||||
ld1 {v25.2d},[x3],#16
|
||||
add v24.2d,v24.2d,v18.2d
|
||||
ld1 {v18.16b},[x1],#16 // load next input
|
||||
ext v24.16b,v24.16b,v24.16b,#8
|
||||
ext v5.16b,v3.16b,v0.16b,#8
|
||||
ext v6.16b,v4.16b,v3.16b,#8
|
||||
add v0.2d,v0.2d,v24.2d // "T1 + H + K512[i]"
|
||||
.inst 0xce6680a0 //sha512h v0.16b,v5.16b,v6.16b
|
||||
rev64 v18.16b,v18.16b
|
||||
add v2.2d,v4.2d,v0.2d // "D + T1"
|
||||
.inst 0xce618480 //sha512h2 v0.16b,v4.16b,v1.16b
|
||||
ld1 {v24.2d},[x3],#16
|
||||
add v25.2d,v25.2d,v19.2d
|
||||
ld1 {v19.16b},[x1],#16 // load next input
|
||||
ext v25.16b,v25.16b,v25.16b,#8
|
||||
ext v5.16b,v2.16b,v3.16b,#8
|
||||
ext v6.16b,v1.16b,v2.16b,#8
|
||||
add v3.2d,v3.2d,v25.2d // "T1 + H + K512[i]"
|
||||
.inst 0xce6680a3 //sha512h v3.16b,v5.16b,v6.16b
|
||||
rev64 v19.16b,v19.16b
|
||||
add v4.2d,v1.2d,v3.2d // "D + T1"
|
||||
.inst 0xce608423 //sha512h2 v3.16b,v1.16b,v0.16b
|
||||
ld1 {v25.2d},[x3],#16
|
||||
add v24.2d,v24.2d,v20.2d
|
||||
ld1 {v20.16b},[x1],#16 // load next input
|
||||
ext v24.16b,v24.16b,v24.16b,#8
|
||||
ext v5.16b,v4.16b,v2.16b,#8
|
||||
ext v6.16b,v0.16b,v4.16b,#8
|
||||
add v2.2d,v2.2d,v24.2d // "T1 + H + K512[i]"
|
||||
.inst 0xce6680a2 //sha512h v2.16b,v5.16b,v6.16b
|
||||
rev64 v20.16b,v20.16b
|
||||
add v1.2d,v0.2d,v2.2d // "D + T1"
|
||||
.inst 0xce638402 //sha512h2 v2.16b,v0.16b,v3.16b
|
||||
ld1 {v24.2d},[x3],#16
|
||||
add v25.2d,v25.2d,v21.2d
|
||||
ld1 {v21.16b},[x1],#16 // load next input
|
||||
ext v25.16b,v25.16b,v25.16b,#8
|
||||
ext v5.16b,v1.16b,v4.16b,#8
|
||||
ext v6.16b,v3.16b,v1.16b,#8
|
||||
add v4.2d,v4.2d,v25.2d // "T1 + H + K512[i]"
|
||||
.inst 0xce6680a4 //sha512h v4.16b,v5.16b,v6.16b
|
||||
rev64 v21.16b,v21.16b
|
||||
add v0.2d,v3.2d,v4.2d // "D + T1"
|
||||
.inst 0xce628464 //sha512h2 v4.16b,v3.16b,v2.16b
|
||||
ld1 {v25.2d},[x3],#16
|
||||
add v24.2d,v24.2d,v22.2d
|
||||
ld1 {v22.16b},[x1],#16 // load next input
|
||||
ext v24.16b,v24.16b,v24.16b,#8
|
||||
ext v5.16b,v0.16b,v1.16b,#8
|
||||
ext v6.16b,v2.16b,v0.16b,#8
|
||||
add v1.2d,v1.2d,v24.2d // "T1 + H + K512[i]"
|
||||
.inst 0xce6680a1 //sha512h v1.16b,v5.16b,v6.16b
|
||||
rev64 v22.16b,v22.16b
|
||||
add v3.2d,v2.2d,v1.2d // "D + T1"
|
||||
.inst 0xce648441 //sha512h2 v1.16b,v2.16b,v4.16b
|
||||
sub x3,x3,#80*8 // rewind
|
||||
add v25.2d,v25.2d,v23.2d
|
||||
ld1 {v23.16b},[x1],#16 // load next input
|
||||
ext v25.16b,v25.16b,v25.16b,#8
|
||||
ext v5.16b,v3.16b,v0.16b,#8
|
||||
ext v6.16b,v4.16b,v3.16b,#8
|
||||
add v0.2d,v0.2d,v25.2d // "T1 + H + K512[i]"
|
||||
.inst 0xce6680a0 //sha512h v0.16b,v5.16b,v6.16b
|
||||
rev64 v23.16b,v23.16b
|
||||
add v2.2d,v4.2d,v0.2d // "D + T1"
|
||||
.inst 0xce618480 //sha512h2 v0.16b,v4.16b,v1.16b
|
||||
add v0.2d,v0.2d,v26.2d // accumulate
|
||||
add v1.2d,v1.2d,v27.2d
|
||||
add v2.2d,v2.2d,v28.2d
|
||||
add v3.2d,v3.2d,v29.2d
|
||||
|
||||
cbnz x2,.Loop_hw
|
||||
|
||||
st1 {v0.2d,v1.2d,v2.2d,v3.2d},[x0] // store context
|
||||
|
||||
ldr x29,[sp],#16
|
||||
ret
|
||||
.size sha512_block_armv8,.-sha512_block_armv8
|
||||
#endif
|
||||
#endif
|
||||
#endif // !OPENSSL_NO_ASM
|
||||
.section .note.GNU-stack,"",%progbits
|
||||
|
||||
@@ -179,6 +179,16 @@ struct X509_req_st {
|
||||
CRYPTO_refcount_t references;
|
||||
} /* X509_REQ */;
|
||||
|
||||
struct x509_revoked_st {
|
||||
ASN1_INTEGER *serialNumber;
|
||||
ASN1_TIME *revocationDate;
|
||||
STACK_OF(X509_EXTENSION) /* optional */ *extensions;
|
||||
// Set up if indirect CRL
|
||||
STACK_OF(GENERAL_NAME) *issuer;
|
||||
// Revocation reason
|
||||
int reason;
|
||||
} /* X509_REVOKED */;
|
||||
|
||||
typedef struct {
|
||||
ASN1_INTEGER *version;
|
||||
X509_ALGOR *sig_alg;
|
||||
|
||||
@@ -75,56 +75,74 @@ int X509_CRL_print_fp(FILE *fp, X509_CRL *x)
|
||||
|
||||
int X509_CRL_print(BIO *out, X509_CRL *x)
|
||||
{
|
||||
STACK_OF(X509_REVOKED) *rev;
|
||||
X509_REVOKED *r;
|
||||
long l;
|
||||
size_t i;
|
||||
char *p;
|
||||
|
||||
BIO_printf(out, "Certificate Revocation List (CRL):\n");
|
||||
l = X509_CRL_get_version(x);
|
||||
BIO_printf(out, "%8sVersion %lu (0x%lx)\n", "", l + 1, l);
|
||||
long version = X509_CRL_get_version(x);
|
||||
const X509_ALGOR *sig_alg;
|
||||
const ASN1_BIT_STRING *signature;
|
||||
X509_CRL_get0_signature(x, &signature, &sig_alg);
|
||||
// Note this and the other |X509_signature_print| call print the outer
|
||||
// signature algorithm twice, rather than both the inner and outer ones.
|
||||
// This matches OpenSSL, though it was probably a bug.
|
||||
X509_signature_print(out, sig_alg, NULL);
|
||||
p = X509_NAME_oneline(X509_CRL_get_issuer(x), NULL, 0);
|
||||
BIO_printf(out, "%8sIssuer: %s\n", "", p);
|
||||
OPENSSL_free(p);
|
||||
BIO_printf(out, "%8sLast Update: ", "");
|
||||
ASN1_TIME_print(out, X509_CRL_get0_lastUpdate(x));
|
||||
BIO_printf(out, "\n%8sNext Update: ", "");
|
||||
if (X509_CRL_get0_nextUpdate(x))
|
||||
ASN1_TIME_print(out, X509_CRL_get0_nextUpdate(x));
|
||||
else
|
||||
BIO_printf(out, "NONE");
|
||||
BIO_printf(out, "\n");
|
||||
|
||||
X509V3_extensions_print(out, "CRL extensions", X509_CRL_get0_extensions(x),
|
||||
0, 8);
|
||||
|
||||
rev = X509_CRL_get_REVOKED(x);
|
||||
|
||||
if (sk_X509_REVOKED_num(rev) > 0)
|
||||
BIO_printf(out, "Revoked Certificates:\n");
|
||||
else
|
||||
BIO_printf(out, "No Revoked Certificates.\n");
|
||||
|
||||
for (i = 0; i < sk_X509_REVOKED_num(rev); i++) {
|
||||
r = sk_X509_REVOKED_value(rev, i);
|
||||
BIO_printf(out, " Serial Number: ");
|
||||
i2a_ASN1_INTEGER(out, r->serialNumber);
|
||||
BIO_printf(out, "\n Revocation Date: ");
|
||||
ASN1_TIME_print(out, r->revocationDate);
|
||||
BIO_printf(out, "\n");
|
||||
X509V3_extensions_print(out, "CRL entry extensions",
|
||||
r->extensions, 0, 8);
|
||||
if (BIO_printf(out, "Certificate Revocation List (CRL):\n") <= 0 ||
|
||||
// TODO(https://crbug.com/boringssl/467): This loses information on some
|
||||
// invalid versions, but we should fix this by making invalid versions
|
||||
// impossible.
|
||||
BIO_printf(out, "%8sVersion %ld (0x%lx)\n", "", version + 1,
|
||||
(unsigned long)version) <= 0 ||
|
||||
// Note this and the other |X509_signature_print| call both print the
|
||||
// outer signature algorithm, rather than printing the inner and outer
|
||||
// ones separately. This matches OpenSSL, though it was probably a bug.
|
||||
!X509_signature_print(out, sig_alg, NULL)) {
|
||||
return 0;
|
||||
}
|
||||
X509_signature_print(out, sig_alg, signature);
|
||||
|
||||
return 1;
|
||||
char *issuer = X509_NAME_oneline(X509_CRL_get_issuer(x), NULL, 0);
|
||||
int ok = issuer != NULL &&
|
||||
BIO_printf(out, "%8sIssuer: %s\n", "", issuer) > 0;
|
||||
OPENSSL_free(issuer);
|
||||
if (!ok) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (BIO_printf(out, "%8sLast Update: ", "") <= 0 ||
|
||||
!ASN1_TIME_print(out, X509_CRL_get0_lastUpdate(x)) ||
|
||||
BIO_printf(out, "\n%8sNext Update: ", "") <= 0) {
|
||||
return 0;
|
||||
}
|
||||
if (X509_CRL_get0_nextUpdate(x)) {
|
||||
if (!ASN1_TIME_print(out, X509_CRL_get0_nextUpdate(x))) {
|
||||
return 0;
|
||||
}
|
||||
} else {
|
||||
if (BIO_printf(out, "NONE") <= 0) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (BIO_printf(out, "\n") <= 0 ||
|
||||
!X509V3_extensions_print(out, "CRL extensions",
|
||||
X509_CRL_get0_extensions(x), 0, 8)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
const STACK_OF(X509_REVOKED) *rev = X509_CRL_get_REVOKED(x);
|
||||
if (sk_X509_REVOKED_num(rev) > 0) {
|
||||
if (BIO_printf(out, "Revoked Certificates:\n") <= 0) {
|
||||
return 0;
|
||||
}
|
||||
} else {
|
||||
if (BIO_printf(out, "No Revoked Certificates.\n") <= 0) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < sk_X509_REVOKED_num(rev); i++) {
|
||||
const X509_REVOKED *r = sk_X509_REVOKED_value(rev, i);
|
||||
if (BIO_printf(out, " Serial Number: ") <= 0 ||
|
||||
i2a_ASN1_INTEGER(out, X509_REVOKED_get0_serialNumber(r)) <= 0 ||
|
||||
BIO_printf(out, "\n Revocation Date: ") <= 0 ||
|
||||
!ASN1_TIME_print(out, X509_REVOKED_get0_revocationDate(r)) ||
|
||||
BIO_printf(out, "\n") <= 0 ||
|
||||
!X509V3_extensions_print(out, "CRL entry extensions",
|
||||
X509_REVOKED_get0_extensions(r), 0, 8)) {
|
||||
}
|
||||
}
|
||||
|
||||
return X509_signature_print(out, sig_alg, signature);
|
||||
}
|
||||
@@ -103,8 +103,12 @@ int X509_REQ_print_ex(BIO *bio, X509_REQ *x, unsigned long nmflags,
|
||||
}
|
||||
}
|
||||
if (!(cflag & X509_FLAG_NO_VERSION)) {
|
||||
/* TODO(https://crbug.com/boringssl/467): This loses information on some
|
||||
* invalid versions, but we should fix this by making invalid versions
|
||||
* impossible. */
|
||||
l = X509_REQ_get_version(x);
|
||||
if (BIO_printf(bio, "%8sVersion: %ld (0x%lx)\n", "", l + 1, l) <= 0) {
|
||||
if (BIO_printf(bio, "%8sVersion: %ld (0x%lx)\n", "", l + 1,
|
||||
(unsigned long)l) <= 0) {
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,6 +54,8 @@
|
||||
* copied and put under another distribution licence
|
||||
* [including the GNU Public Licence.] */
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
#include <CCryptoBoringSSL_asn1.h>
|
||||
#include <CCryptoBoringSSL_bio.h>
|
||||
#include <CCryptoBoringSSL_digest.h>
|
||||
@@ -98,7 +100,6 @@ int X509_print_ex(BIO *bp, X509 *x, unsigned long nmflags,
|
||||
char *m = NULL, mlch = ' ';
|
||||
int nmindent = 0;
|
||||
X509_CINF *ci;
|
||||
ASN1_INTEGER *bs;
|
||||
EVP_PKEY *pkey = NULL;
|
||||
const char *neg;
|
||||
|
||||
@@ -118,38 +119,42 @@ int X509_print_ex(BIO *bp, X509 *x, unsigned long nmflags,
|
||||
goto err;
|
||||
}
|
||||
if (!(cflag & X509_FLAG_NO_VERSION)) {
|
||||
/* TODO(https://crbug.com/boringssl/467): This loses information on some
|
||||
* invalid versions, but we should fix this by making invalid versions
|
||||
* impossible. */
|
||||
l = X509_get_version(x);
|
||||
if (BIO_printf(bp, "%8sVersion: %lu (0x%lx)\n", "", l + 1, l) <= 0)
|
||||
if (BIO_printf(bp, "%8sVersion: %ld (0x%lx)\n", "", l + 1,
|
||||
(unsigned long)l) <= 0) {
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
if (!(cflag & X509_FLAG_NO_SERIAL)) {
|
||||
|
||||
if (BIO_write(bp, " Serial Number:", 22) <= 0)
|
||||
if (BIO_write(bp, " Serial Number:", 22) <= 0) {
|
||||
goto err;
|
||||
|
||||
bs = X509_get_serialNumber(x);
|
||||
if (bs->length < (int)sizeof(long)
|
||||
|| (bs->length == sizeof(long) && (bs->data[0] & 0x80) == 0)) {
|
||||
l = ASN1_INTEGER_get(bs);
|
||||
if (bs->type == V_ASN1_NEG_INTEGER) {
|
||||
l = -l;
|
||||
neg = "-";
|
||||
} else
|
||||
neg = "";
|
||||
if (BIO_printf(bp, " %s%lu (%s0x%lx)\n", neg, l, neg, l) <= 0)
|
||||
goto err;
|
||||
} else {
|
||||
neg = (bs->type == V_ASN1_NEG_INTEGER) ? " (Negative)" : "";
|
||||
if (BIO_printf(bp, "\n%12s%s", "", neg) <= 0)
|
||||
goto err;
|
||||
|
||||
for (i = 0; i < bs->length; i++) {
|
||||
if (BIO_printf(bp, "%02x%c", bs->data[i],
|
||||
((i + 1 == bs->length) ? '\n' : ':')) <= 0)
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
|
||||
const ASN1_INTEGER *serial = X509_get0_serialNumber(x);
|
||||
/* |ASN1_INTEGER_get| returns -1 on overflow, so this check skips
|
||||
* negative and large serial numbers. */
|
||||
l = ASN1_INTEGER_get(serial);
|
||||
if (l >= 0) {
|
||||
assert(serial->type != V_ASN1_NEG_INTEGER);
|
||||
if (BIO_printf(bp, " %ld (0x%lx)\n", l, (unsigned long)l) <= 0) {
|
||||
goto err;
|
||||
}
|
||||
} else {
|
||||
neg = (serial->type == V_ASN1_NEG_INTEGER) ? " (Negative)" : "";
|
||||
if (BIO_printf(bp, "\n%12s%s", "", neg) <= 0) {
|
||||
goto err;
|
||||
}
|
||||
|
||||
for (i = 0; i < serial->length; i++) {
|
||||
if (BIO_printf(bp, "%02x%c", serial->data[i],
|
||||
((i + 1 == serial->length) ? '\n' : ':')) <= 0) {
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!(cflag & X509_FLAG_NO_SIGNAME)) {
|
||||
|
||||
@@ -74,7 +74,7 @@ long X509_get_version(const X509 *x509)
|
||||
|
||||
int X509_set_version(X509 *x, long version)
|
||||
{
|
||||
// TODO(davidben): Reject invalid version numbers.
|
||||
// TODO(https://crbug.com/boringssl/467): Reject invalid version numbers.
|
||||
if (x == NULL)
|
||||
return (0);
|
||||
if (version == 0) {
|
||||
|
||||
@@ -64,6 +64,9 @@
|
||||
|
||||
int X509_CRL_set_version(X509_CRL *x, long version)
|
||||
{
|
||||
/* TODO(https://crbug.com/boringssl/467): Reject invalid version
|
||||
* numbers. Also correctly handle |X509_CRL_VERSION_1|, which should omit
|
||||
* the encoding. */
|
||||
if (x == NULL)
|
||||
return (0);
|
||||
if (x->crl->version == NULL) {
|
||||
@@ -116,16 +119,8 @@ int X509_CRL_set1_nextUpdate(X509_CRL *x, const ASN1_TIME *tm)
|
||||
|
||||
int X509_CRL_sort(X509_CRL *c)
|
||||
{
|
||||
size_t i;
|
||||
X509_REVOKED *r;
|
||||
/*
|
||||
* sort the data so it will be written in serial number order
|
||||
*/
|
||||
/* Sort the data so it will be written in serial number order. */
|
||||
sk_X509_REVOKED_sort(c->crl->revoked);
|
||||
for (i = 0; i < sk_X509_REVOKED_num(c->crl->revoked); i++) {
|
||||
r = sk_X509_REVOKED_value(c->crl->revoked, i);
|
||||
r->sequence = i;
|
||||
}
|
||||
c->crl->enc.modified = 1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -64,6 +64,8 @@
|
||||
|
||||
int X509_REQ_set_version(X509_REQ *x, long version)
|
||||
{
|
||||
/* TODO(https://crbug.com/boringssl/467): Reject invalid version
|
||||
* numbers. */
|
||||
if (x == NULL)
|
||||
return (0);
|
||||
return (ASN1_INTEGER_set(x->req_info->version, version));
|
||||
|
||||
@@ -127,7 +127,10 @@ static int crl_inf_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it,
|
||||
* affect the output of X509_CRL_print().
|
||||
*/
|
||||
case ASN1_OP_D2I_POST:
|
||||
/* TODO(davidben): Check that default |versions| are never encoded and
|
||||
/* TODO(https://crbug.com/boringssl/467): Reject invalid version
|
||||
* numbers.
|
||||
*
|
||||
* TODO(davidben): Check that default |versions| are never encoded and
|
||||
* that |extensions| is only present in v2. */
|
||||
|
||||
(void)sk_X509_REVOKED_set_cmp_func(a->revoked, X509_REVOKED_cmp);
|
||||
|
||||
@@ -82,6 +82,9 @@ static int rinf_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it,
|
||||
if (!rinf->attributes)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* TODO(https://crbug.com/boringssl/467): Add an |ASN1_OP_D2I_POST| callback
|
||||
* and check the version. */
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -172,12 +172,13 @@ STACK_OF(CONF_VALUE) *i2v_GENERAL_NAME(X509V3_EXT_METHOD *method,
|
||||
case GEN_IPADD:
|
||||
p = gen->d.ip->data;
|
||||
if (gen->d.ip->length == 4)
|
||||
BIO_snprintf(oline, sizeof oline,
|
||||
BIO_snprintf(oline, sizeof(oline),
|
||||
"%d.%d.%d.%d", p[0], p[1], p[2], p[3]);
|
||||
else if (gen->d.ip->length == 16) {
|
||||
oline[0] = 0;
|
||||
for (i = 0; i < 8; i++) {
|
||||
BIO_snprintf(htmp, sizeof htmp, "%X", p[0] << 8 | p[1]);
|
||||
uint16_t v = ((uint16_t)p[0] << 8) | p[1];
|
||||
BIO_snprintf(htmp, sizeof(htmp), "%X", v);
|
||||
p += 2;
|
||||
OPENSSL_strlcat(oline, htmp, sizeof(oline));
|
||||
if (i != 7)
|
||||
@@ -246,7 +247,8 @@ int GENERAL_NAME_print(BIO *out, GENERAL_NAME *gen)
|
||||
else if (gen->d.ip->length == 16) {
|
||||
BIO_printf(out, "IP Address");
|
||||
for (i = 0; i < 8; i++) {
|
||||
BIO_printf(out, ":%X", p[0] << 8 | p[1]);
|
||||
uint16_t v = ((uint16_t)p[0] << 8) | p[1];
|
||||
BIO_printf(out, ":%X", v);
|
||||
p += 2;
|
||||
}
|
||||
BIO_puts(out, "\n");
|
||||
|
||||
@@ -203,7 +203,8 @@ static int print_nc_ipadd(BIO *bp, ASN1_OCTET_STRING *ip)
|
||||
p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7]);
|
||||
} else if (len == 32) {
|
||||
for (i = 0; i < 16; i++) {
|
||||
BIO_printf(bp, "%X", p[0] << 8 | p[1]);
|
||||
uint16_t v = ((uint16_t)p[0] << 8) | p[1];
|
||||
BIO_printf(bp, "%X", v);
|
||||
p += 2;
|
||||
if (i == 7)
|
||||
BIO_puts(bp, "/");
|
||||
|
||||
@@ -708,44 +708,11 @@ typedef int (*equal_fn) (const unsigned char *pattern, size_t pattern_len,
|
||||
const unsigned char *subject, size_t subject_len,
|
||||
unsigned int flags);
|
||||
|
||||
/* Skip pattern prefix to match "wildcard" subject */
|
||||
static void skip_prefix(const unsigned char **p, size_t *plen,
|
||||
const unsigned char *subject, size_t subject_len,
|
||||
unsigned int flags)
|
||||
{
|
||||
const unsigned char *pattern = *p;
|
||||
size_t pattern_len = *plen;
|
||||
|
||||
/*
|
||||
* If subject starts with a leading '.' followed by more octets, and
|
||||
* pattern is longer, compare just an equal-length suffix with the
|
||||
* full subject (starting at the '.'), provided the prefix contains
|
||||
* no NULs.
|
||||
*/
|
||||
if ((flags & _X509_CHECK_FLAG_DOT_SUBDOMAINS) == 0)
|
||||
return;
|
||||
|
||||
while (pattern_len > subject_len && *pattern) {
|
||||
if ((flags & X509_CHECK_FLAG_SINGLE_LABEL_SUBDOMAINS) &&
|
||||
*pattern == '.')
|
||||
break;
|
||||
++pattern;
|
||||
--pattern_len;
|
||||
}
|
||||
|
||||
/* Skip if entire prefix acceptable */
|
||||
if (pattern_len == subject_len) {
|
||||
*p = pattern;
|
||||
*plen = pattern_len;
|
||||
}
|
||||
}
|
||||
|
||||
/* Compare while ASCII ignoring case. */
|
||||
static int equal_nocase(const unsigned char *pattern, size_t pattern_len,
|
||||
const unsigned char *subject, size_t subject_len,
|
||||
unsigned int flags)
|
||||
{
|
||||
skip_prefix(&pattern, &pattern_len, subject, subject_len, flags);
|
||||
if (pattern_len != subject_len)
|
||||
return 0;
|
||||
while (pattern_len) {
|
||||
@@ -774,7 +741,6 @@ static int equal_case(const unsigned char *pattern, size_t pattern_len,
|
||||
const unsigned char *subject, size_t subject_len,
|
||||
unsigned int flags)
|
||||
{
|
||||
skip_prefix(&pattern, &pattern_len, subject, subject_len, flags);
|
||||
if (pattern_len != subject_len)
|
||||
return 0;
|
||||
return !OPENSSL_memcmp(pattern, subject, pattern_len);
|
||||
@@ -821,7 +787,6 @@ static int wildcard_match(const unsigned char *prefix, size_t prefix_len,
|
||||
const unsigned char *wildcard_start;
|
||||
const unsigned char *wildcard_end;
|
||||
const unsigned char *p;
|
||||
int allow_multi = 0;
|
||||
int allow_idna = 0;
|
||||
|
||||
if (subject_len < prefix_len + suffix_len)
|
||||
@@ -840,8 +805,6 @@ static int wildcard_match(const unsigned char *prefix, size_t prefix_len,
|
||||
if (wildcard_start == wildcard_end)
|
||||
return 0;
|
||||
allow_idna = 1;
|
||||
if (flags & X509_CHECK_FLAG_MULTI_LABEL_WILDCARDS)
|
||||
allow_multi = 1;
|
||||
}
|
||||
/* IDNA labels cannot match partial wildcards */
|
||||
if (!allow_idna &&
|
||||
@@ -853,14 +816,13 @@ static int wildcard_match(const unsigned char *prefix, size_t prefix_len,
|
||||
return 1;
|
||||
/*
|
||||
* Check that the part matched by the wildcard contains only
|
||||
* permitted characters and only matches a single label unless
|
||||
* allow_multi is set.
|
||||
* permitted characters and only matches a single label.
|
||||
*/
|
||||
for (p = wildcard_start; p != wildcard_end; ++p)
|
||||
if (!(('0' <= *p && *p <= '9') ||
|
||||
('A' <= *p && *p <= 'Z') ||
|
||||
('a' <= *p && *p <= 'z') ||
|
||||
*p == '-' || (allow_multi && *p == '.')))
|
||||
*p == '-'))
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
@@ -892,12 +854,8 @@ static const unsigned char *valid_star(const unsigned char *p, size_t len,
|
||||
*/
|
||||
if (star != NULL || (state & LABEL_IDNA) != 0 || dots)
|
||||
return NULL;
|
||||
/* Only full-label '*.example.com' wildcards? */
|
||||
if ((flags & X509_CHECK_FLAG_NO_PARTIAL_WILDCARDS)
|
||||
&& (!atstart || !atend))
|
||||
return NULL;
|
||||
/* No 'foo*bar' wildcards */
|
||||
if (!atstart && !atend)
|
||||
/* Only full-label '*.example.com' wildcards. */
|
||||
if (!atstart || !atend)
|
||||
return NULL;
|
||||
star = &p[i];
|
||||
state &= ~LABEL_START;
|
||||
@@ -1059,17 +1017,12 @@ static int do_x509_check(X509 *x, const char *chk, size_t chklen,
|
||||
int rv = 0;
|
||||
equal_fn equal;
|
||||
|
||||
/* See below, this flag is internal-only */
|
||||
flags &= ~_X509_CHECK_FLAG_DOT_SUBDOMAINS;
|
||||
if (check_type == GEN_EMAIL) {
|
||||
cnid = NID_pkcs9_emailAddress;
|
||||
alt_type = V_ASN1_IA5STRING;
|
||||
equal = equal_email;
|
||||
} else if (check_type == GEN_DNS) {
|
||||
cnid = NID_commonName;
|
||||
/* Implicit client-side DNS sub-domain pattern */
|
||||
if (chklen > 1 && chk[0] == '.')
|
||||
flags |= _X509_CHECK_FLAG_DOT_SUBDOMAINS;
|
||||
alt_type = V_ASN1_IA5STRING;
|
||||
if (flags & X509_CHECK_FLAG_NO_WILDCARDS)
|
||||
equal = equal_nocase;
|
||||
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
This directory is derived from BoringSSL cloned from https://boringssl.googlesource.com/boringssl at revision 3a667d10e94186fd503966f5638e134fe9fb4080
|
||||
This directory is derived from BoringSSL cloned from https://boringssl.googlesource.com/boringssl at revision 295b31324f8c557dcd3c1c831857e33a7f23bc52
|
||||
@@ -118,6 +118,9 @@
|
||||
// ARMV8_PMULL indicates support for carryless multiplication.
|
||||
#define ARMV8_PMULL (1 << 5)
|
||||
|
||||
// ARMV8_SHA512 indicates support for hardware SHA-512 instructions.
|
||||
#define ARMV8_SHA512 (1 << 6)
|
||||
|
||||
#if defined(__ASSEMBLER__)
|
||||
|
||||
// Support macros for
|
||||
|
||||
@@ -508,6 +508,25 @@ OPENSSL_EXPORT int BIO_append_filename(BIO *bio, const char *filename);
|
||||
// |FILE| will be closed when |bio| is freed.
|
||||
OPENSSL_EXPORT int BIO_rw_filename(BIO *bio, const char *filename);
|
||||
|
||||
// BIO_tell returns the file offset of |bio|, or a negative number on error or
|
||||
// if |bio| does not support the operation.
|
||||
//
|
||||
// TODO(https://crbug.com/boringssl/465): On platforms where |long| is 32-bit,
|
||||
// this function cannot report 64-bit offsets.
|
||||
OPENSSL_EXPORT long BIO_tell(BIO *bio);
|
||||
|
||||
// BIO_seek sets the file offset of |bio| to |offset|. It returns a non-negative
|
||||
// number on success and a negative number on error. If |bio| is a file
|
||||
// descriptor |BIO|, it returns the resulting file offset on success. If |bio|
|
||||
// is a file |BIO|, it returns zero on success.
|
||||
//
|
||||
// WARNING: This function's return value conventions differs from most functions
|
||||
// in this library.
|
||||
//
|
||||
// TODO(https://crbug.com/boringssl/465): On platforms where |long| is 32-bit,
|
||||
// this function cannot handle 64-bit offsets.
|
||||
OPENSSL_EXPORT long BIO_seek(BIO *bio, long offset);
|
||||
|
||||
|
||||
// Socket BIOs.
|
||||
//
|
||||
|
||||
@@ -658,6 +658,14 @@ struct bn_gencb_st {
|
||||
int (*callback)(int event, int n, struct bn_gencb_st *);
|
||||
};
|
||||
|
||||
// BN_GENCB_new returns a newly-allocated |BN_GENCB| object, or NULL on
|
||||
// allocation failure. The result must be released with |BN_GENCB_free| when
|
||||
// done.
|
||||
OPENSSL_EXPORT BN_GENCB *BN_GENCB_new(void);
|
||||
|
||||
// BN_GENCB_free releases memory associated with |callback|.
|
||||
OPENSSL_EXPORT void BN_GENCB_free(BN_GENCB *callback);
|
||||
|
||||
// BN_GENCB_set configures |callback| to call |f| and sets |callout->arg| to
|
||||
// |arg|.
|
||||
OPENSSL_EXPORT void BN_GENCB_set(BN_GENCB *callback,
|
||||
|
||||
@@ -267,6 +267,7 @@
|
||||
#define BIO_s_file BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, BIO_s_file)
|
||||
#define BIO_s_mem BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, BIO_s_mem)
|
||||
#define BIO_s_socket BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, BIO_s_socket)
|
||||
#define BIO_seek BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, BIO_seek)
|
||||
#define BIO_set_close BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, BIO_set_close)
|
||||
#define BIO_set_conn_hostname BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, BIO_set_conn_hostname)
|
||||
#define BIO_set_conn_int_port BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, BIO_set_conn_int_port)
|
||||
@@ -291,6 +292,7 @@
|
||||
#define BIO_should_write BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, BIO_should_write)
|
||||
#define BIO_shutdown_wr BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, BIO_shutdown_wr)
|
||||
#define BIO_snprintf BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, BIO_snprintf)
|
||||
#define BIO_tell BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, BIO_tell)
|
||||
#define BIO_test_flags BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, BIO_test_flags)
|
||||
#define BIO_up_ref BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, BIO_up_ref)
|
||||
#define BIO_vfree BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, BIO_vfree)
|
||||
@@ -314,6 +316,8 @@
|
||||
#define BN_CTX_new BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, BN_CTX_new)
|
||||
#define BN_CTX_start BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, BN_CTX_start)
|
||||
#define BN_GENCB_call BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, BN_GENCB_call)
|
||||
#define BN_GENCB_free BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, BN_GENCB_free)
|
||||
#define BN_GENCB_new BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, BN_GENCB_new)
|
||||
#define BN_GENCB_set BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, BN_GENCB_set)
|
||||
#define BN_MONT_CTX_copy BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, BN_MONT_CTX_copy)
|
||||
#define BN_MONT_CTX_free BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, BN_MONT_CTX_free)
|
||||
@@ -872,6 +876,7 @@
|
||||
#define ERR_remove_thread_state BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, ERR_remove_thread_state)
|
||||
#define ERR_restore_state BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, ERR_restore_state)
|
||||
#define ERR_save_state BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, ERR_save_state)
|
||||
#define ERR_set_error_data BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, ERR_set_error_data)
|
||||
#define ERR_set_mark BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, ERR_set_mark)
|
||||
#define EVP_AEAD_CTX_aead BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_AEAD_CTX_aead)
|
||||
#define EVP_AEAD_CTX_cleanup BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_AEAD_CTX_cleanup)
|
||||
@@ -1570,6 +1575,7 @@
|
||||
#define RSA_sign_pss_mgf1 BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, RSA_sign_pss_mgf1)
|
||||
#define RSA_sign_raw BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, RSA_sign_raw)
|
||||
#define RSA_size BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, RSA_size)
|
||||
#define RSA_test_flags BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, RSA_test_flags)
|
||||
#define RSA_up_ref BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, RSA_up_ref)
|
||||
#define RSA_verify BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, RSA_verify)
|
||||
#define RSA_verify_PKCS1_PSS_mgf1 BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, RSA_verify_PKCS1_PSS_mgf1)
|
||||
|
||||
@@ -272,6 +272,7 @@
|
||||
#define _BIO_s_file BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, BIO_s_file)
|
||||
#define _BIO_s_mem BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, BIO_s_mem)
|
||||
#define _BIO_s_socket BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, BIO_s_socket)
|
||||
#define _BIO_seek BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, BIO_seek)
|
||||
#define _BIO_set_close BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, BIO_set_close)
|
||||
#define _BIO_set_conn_hostname BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, BIO_set_conn_hostname)
|
||||
#define _BIO_set_conn_int_port BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, BIO_set_conn_int_port)
|
||||
@@ -296,6 +297,7 @@
|
||||
#define _BIO_should_write BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, BIO_should_write)
|
||||
#define _BIO_shutdown_wr BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, BIO_shutdown_wr)
|
||||
#define _BIO_snprintf BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, BIO_snprintf)
|
||||
#define _BIO_tell BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, BIO_tell)
|
||||
#define _BIO_test_flags BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, BIO_test_flags)
|
||||
#define _BIO_up_ref BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, BIO_up_ref)
|
||||
#define _BIO_vfree BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, BIO_vfree)
|
||||
@@ -319,6 +321,8 @@
|
||||
#define _BN_CTX_new BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, BN_CTX_new)
|
||||
#define _BN_CTX_start BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, BN_CTX_start)
|
||||
#define _BN_GENCB_call BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, BN_GENCB_call)
|
||||
#define _BN_GENCB_free BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, BN_GENCB_free)
|
||||
#define _BN_GENCB_new BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, BN_GENCB_new)
|
||||
#define _BN_GENCB_set BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, BN_GENCB_set)
|
||||
#define _BN_MONT_CTX_copy BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, BN_MONT_CTX_copy)
|
||||
#define _BN_MONT_CTX_free BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, BN_MONT_CTX_free)
|
||||
@@ -877,6 +881,7 @@
|
||||
#define _ERR_remove_thread_state BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, ERR_remove_thread_state)
|
||||
#define _ERR_restore_state BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, ERR_restore_state)
|
||||
#define _ERR_save_state BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, ERR_save_state)
|
||||
#define _ERR_set_error_data BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, ERR_set_error_data)
|
||||
#define _ERR_set_mark BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, ERR_set_mark)
|
||||
#define _EVP_AEAD_CTX_aead BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, EVP_AEAD_CTX_aead)
|
||||
#define _EVP_AEAD_CTX_cleanup BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, EVP_AEAD_CTX_cleanup)
|
||||
@@ -1575,6 +1580,7 @@
|
||||
#define _RSA_sign_pss_mgf1 BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, RSA_sign_pss_mgf1)
|
||||
#define _RSA_sign_raw BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, RSA_sign_raw)
|
||||
#define _RSA_size BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, RSA_size)
|
||||
#define _RSA_test_flags BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, RSA_test_flags)
|
||||
#define _RSA_up_ref BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, RSA_up_ref)
|
||||
#define _RSA_verify BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, RSA_verify)
|
||||
#define _RSA_verify_PKCS1_PSS_mgf1 BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, RSA_verify_PKCS1_PSS_mgf1)
|
||||
|
||||
@@ -105,8 +105,9 @@ OPENSSL_INLINE const uint32_t *OPENSSL_ia32cap_get(void) {
|
||||
|
||||
#if defined(OPENSSL_ARM) || defined(OPENSSL_AARCH64)
|
||||
|
||||
#if defined(OPENSSL_APPLE)
|
||||
// iOS builds use the static ARM configuration.
|
||||
#if defined(OPENSSL_APPLE) && defined(OPENSSL_ARM)
|
||||
// We do not detect any features at runtime for Apple's 32-bit ARM platforms. On
|
||||
// 64-bit ARM, we detect some post-ARMv8.0 features.
|
||||
#define OPENSSL_STATIC_ARMCAP
|
||||
#endif
|
||||
|
||||
|
||||
@@ -183,6 +183,11 @@ OPENSSL_EXPORT uint32_t ERR_get_error_line(const char **file, int *line);
|
||||
// can be printed. This is always set if |data| is non-NULL.
|
||||
#define ERR_FLAG_STRING 1
|
||||
|
||||
// ERR_FLAG_MALLOCED is passed into |ERR_set_error_data| to indicate that |data|
|
||||
// was allocated with |OPENSSL_malloc|. It is never returned from
|
||||
// |ERR_get_error_line_data|.
|
||||
#define ERR_FLAG_MALLOCED 2
|
||||
|
||||
// ERR_get_error_line_data acts like |ERR_get_error_line|, but also returns the
|
||||
// error-specific data pointer and flags. The flags are a bitwise-OR of
|
||||
// |ERR_FLAG_*| values. The error-specific data is owned by the error queue
|
||||
@@ -408,9 +413,10 @@ OPENSSL_EXPORT char *ERR_error_string(uint32_t packed_error, char *buf);
|
||||
// ERR_GET_FUNC returns zero. BoringSSL errors do not report a function code.
|
||||
#define ERR_GET_FUNC(packed_error) 0
|
||||
|
||||
// ERR_TXT_STRING is provided for compatibility with code that assumes that
|
||||
// it's using OpenSSL.
|
||||
// ERR_TXT_* are provided for compatibility with code that assumes that it's
|
||||
// using OpenSSL.
|
||||
#define ERR_TXT_STRING ERR_FLAG_STRING
|
||||
#define ERR_TXT_MALLOCED ERR_FLAG_MALLOCED
|
||||
|
||||
|
||||
// Private functions.
|
||||
@@ -444,6 +450,17 @@ OPENSSL_EXPORT void ERR_add_error_data(unsigned count, ...);
|
||||
OPENSSL_EXPORT void ERR_add_error_dataf(const char *format, ...)
|
||||
OPENSSL_PRINTF_FORMAT_FUNC(1, 2);
|
||||
|
||||
// ERR_set_error_data sets the data on the most recent error to |data|, which
|
||||
// must be a NUL-terminated string. |flags| must contain |ERR_FLAG_STRING|. If
|
||||
// |flags| contains |ERR_FLAG_MALLOCED|, this function takes ownership of
|
||||
// |data|, which must have been allocated with |OPENSSL_malloc|. Otherwise, it
|
||||
// saves a copy of |data|.
|
||||
//
|
||||
// Note this differs from OpenSSL which, when |ERR_FLAG_MALLOCED| is unset,
|
||||
// saves the pointer as-is and requires it remain valid for the lifetime of the
|
||||
// address space.
|
||||
OPENSSL_EXPORT void ERR_set_error_data(char *data, int flags);
|
||||
|
||||
// ERR_NUM_ERRORS is one more than the limit of the number of errors in the
|
||||
// queue.
|
||||
#define ERR_NUM_ERRORS 16
|
||||
|
||||
@@ -615,6 +615,9 @@ OPENSSL_EXPORT void *RSA_get_ex_data(const RSA *rsa, int idx);
|
||||
// constants.
|
||||
OPENSSL_EXPORT int RSA_flags(const RSA *rsa);
|
||||
|
||||
// RSA_test_flags returns the subset of flags in |flags| which are set in |rsa|.
|
||||
OPENSSL_EXPORT int RSA_test_flags(const RSA *rsa, int flags);
|
||||
|
||||
// RSA_blinding_on returns one.
|
||||
OPENSSL_EXPORT int RSA_blinding_on(RSA *rsa, BN_CTX *ctx);
|
||||
|
||||
|
||||
@@ -249,17 +249,6 @@ DEFINE_STACK_OF(X509_TRUST)
|
||||
(ASN1_STRFLGS_ESC_CTRL | ASN1_STRFLGS_ESC_MSB | XN_FLAG_SEP_MULTILINE | \
|
||||
XN_FLAG_SPC_EQ | XN_FLAG_FN_LN | XN_FLAG_FN_ALIGN)
|
||||
|
||||
struct x509_revoked_st {
|
||||
ASN1_INTEGER *serialNumber;
|
||||
ASN1_TIME *revocationDate;
|
||||
STACK_OF(X509_EXTENSION) /* optional */ *extensions;
|
||||
// Set up if indirect CRL
|
||||
STACK_OF(GENERAL_NAME) *issuer;
|
||||
// Revocation reason
|
||||
int reason;
|
||||
int sequence; // load sequence
|
||||
};
|
||||
|
||||
DEFINE_STACK_OF(X509_REVOKED)
|
||||
|
||||
DECLARE_STACK_OF(GENERAL_NAMES)
|
||||
|
||||
@@ -890,19 +890,16 @@ OPENSSL_EXPORT STACK_OF(OPENSSL_STRING) *X509_get1_ocsp(X509 *x);
|
||||
#define X509_CHECK_FLAG_ALWAYS_CHECK_SUBJECT 0
|
||||
// Disable wildcard matching for dnsName fields and common name.
|
||||
#define X509_CHECK_FLAG_NO_WILDCARDS 0x2
|
||||
// Wildcards must not match a partial label.
|
||||
#define X509_CHECK_FLAG_NO_PARTIAL_WILDCARDS 0x4
|
||||
// Allow (non-partial) wildcards to match multiple labels.
|
||||
#define X509_CHECK_FLAG_MULTI_LABEL_WILDCARDS 0x8
|
||||
// Constraint verifier subdomain patterns to match a single labels.
|
||||
#define X509_CHECK_FLAG_SINGLE_LABEL_SUBDOMAINS 0x10
|
||||
// X509_CHECK_FLAG_NO_PARTIAL_WILDCARDS does nothing, but is necessary in
|
||||
// OpenSSL to enable standard wildcard matching. In BoringSSL, this behavior is
|
||||
// always enabled.
|
||||
#define X509_CHECK_FLAG_NO_PARTIAL_WILDCARDS 0
|
||||
// Deprecated: this flag does nothing
|
||||
#define X509_CHECK_FLAG_MULTI_LABEL_WILDCARDS 0
|
||||
// Deprecated: this flag does nothing
|
||||
#define X509_CHECK_FLAG_SINGLE_LABEL_SUBDOMAINS 0
|
||||
// Skip the subject common name fallback if subjectAltNames is missing.
|
||||
#define X509_CHECK_FLAG_NEVER_CHECK_SUBJECT 0x20
|
||||
//
|
||||
// Match reference identifiers starting with "." to any sub-domain.
|
||||
// This is a non-public flag, turned on implicitly when the subject
|
||||
// reference identity is a DNS name.
|
||||
#define _X509_CHECK_FLAG_DOT_SUBDOMAINS 0x8000
|
||||
|
||||
OPENSSL_EXPORT int X509_check_host(X509 *x, const char *chk, size_t chklen,
|
||||
unsigned int flags, char **peername);
|
||||
|
||||
@@ -264,6 +264,7 @@
|
||||
%xdefine _BIO_s_file _ %+ BORINGSSL_PREFIX %+ _BIO_s_file
|
||||
%xdefine _BIO_s_mem _ %+ BORINGSSL_PREFIX %+ _BIO_s_mem
|
||||
%xdefine _BIO_s_socket _ %+ BORINGSSL_PREFIX %+ _BIO_s_socket
|
||||
%xdefine _BIO_seek _ %+ BORINGSSL_PREFIX %+ _BIO_seek
|
||||
%xdefine _BIO_set_close _ %+ BORINGSSL_PREFIX %+ _BIO_set_close
|
||||
%xdefine _BIO_set_conn_hostname _ %+ BORINGSSL_PREFIX %+ _BIO_set_conn_hostname
|
||||
%xdefine _BIO_set_conn_int_port _ %+ BORINGSSL_PREFIX %+ _BIO_set_conn_int_port
|
||||
@@ -288,6 +289,7 @@
|
||||
%xdefine _BIO_should_write _ %+ BORINGSSL_PREFIX %+ _BIO_should_write
|
||||
%xdefine _BIO_shutdown_wr _ %+ BORINGSSL_PREFIX %+ _BIO_shutdown_wr
|
||||
%xdefine _BIO_snprintf _ %+ BORINGSSL_PREFIX %+ _BIO_snprintf
|
||||
%xdefine _BIO_tell _ %+ BORINGSSL_PREFIX %+ _BIO_tell
|
||||
%xdefine _BIO_test_flags _ %+ BORINGSSL_PREFIX %+ _BIO_test_flags
|
||||
%xdefine _BIO_up_ref _ %+ BORINGSSL_PREFIX %+ _BIO_up_ref
|
||||
%xdefine _BIO_vfree _ %+ BORINGSSL_PREFIX %+ _BIO_vfree
|
||||
@@ -311,6 +313,8 @@
|
||||
%xdefine _BN_CTX_new _ %+ BORINGSSL_PREFIX %+ _BN_CTX_new
|
||||
%xdefine _BN_CTX_start _ %+ BORINGSSL_PREFIX %+ _BN_CTX_start
|
||||
%xdefine _BN_GENCB_call _ %+ BORINGSSL_PREFIX %+ _BN_GENCB_call
|
||||
%xdefine _BN_GENCB_free _ %+ BORINGSSL_PREFIX %+ _BN_GENCB_free
|
||||
%xdefine _BN_GENCB_new _ %+ BORINGSSL_PREFIX %+ _BN_GENCB_new
|
||||
%xdefine _BN_GENCB_set _ %+ BORINGSSL_PREFIX %+ _BN_GENCB_set
|
||||
%xdefine _BN_MONT_CTX_copy _ %+ BORINGSSL_PREFIX %+ _BN_MONT_CTX_copy
|
||||
%xdefine _BN_MONT_CTX_free _ %+ BORINGSSL_PREFIX %+ _BN_MONT_CTX_free
|
||||
@@ -869,6 +873,7 @@
|
||||
%xdefine _ERR_remove_thread_state _ %+ BORINGSSL_PREFIX %+ _ERR_remove_thread_state
|
||||
%xdefine _ERR_restore_state _ %+ BORINGSSL_PREFIX %+ _ERR_restore_state
|
||||
%xdefine _ERR_save_state _ %+ BORINGSSL_PREFIX %+ _ERR_save_state
|
||||
%xdefine _ERR_set_error_data _ %+ BORINGSSL_PREFIX %+ _ERR_set_error_data
|
||||
%xdefine _ERR_set_mark _ %+ BORINGSSL_PREFIX %+ _ERR_set_mark
|
||||
%xdefine _EVP_AEAD_CTX_aead _ %+ BORINGSSL_PREFIX %+ _EVP_AEAD_CTX_aead
|
||||
%xdefine _EVP_AEAD_CTX_cleanup _ %+ BORINGSSL_PREFIX %+ _EVP_AEAD_CTX_cleanup
|
||||
@@ -1567,6 +1572,7 @@
|
||||
%xdefine _RSA_sign_pss_mgf1 _ %+ BORINGSSL_PREFIX %+ _RSA_sign_pss_mgf1
|
||||
%xdefine _RSA_sign_raw _ %+ BORINGSSL_PREFIX %+ _RSA_sign_raw
|
||||
%xdefine _RSA_size _ %+ BORINGSSL_PREFIX %+ _RSA_size
|
||||
%xdefine _RSA_test_flags _ %+ BORINGSSL_PREFIX %+ _RSA_test_flags
|
||||
%xdefine _RSA_up_ref _ %+ BORINGSSL_PREFIX %+ _RSA_up_ref
|
||||
%xdefine _RSA_verify _ %+ BORINGSSL_PREFIX %+ _RSA_verify
|
||||
%xdefine _RSA_verify_PKCS1_PSS_mgf1 _ %+ BORINGSSL_PREFIX %+ _RSA_verify_PKCS1_PSS_mgf1
|
||||
@@ -3108,6 +3114,7 @@
|
||||
%xdefine BIO_s_file BORINGSSL_PREFIX %+ _BIO_s_file
|
||||
%xdefine BIO_s_mem BORINGSSL_PREFIX %+ _BIO_s_mem
|
||||
%xdefine BIO_s_socket BORINGSSL_PREFIX %+ _BIO_s_socket
|
||||
%xdefine BIO_seek BORINGSSL_PREFIX %+ _BIO_seek
|
||||
%xdefine BIO_set_close BORINGSSL_PREFIX %+ _BIO_set_close
|
||||
%xdefine BIO_set_conn_hostname BORINGSSL_PREFIX %+ _BIO_set_conn_hostname
|
||||
%xdefine BIO_set_conn_int_port BORINGSSL_PREFIX %+ _BIO_set_conn_int_port
|
||||
@@ -3132,6 +3139,7 @@
|
||||
%xdefine BIO_should_write BORINGSSL_PREFIX %+ _BIO_should_write
|
||||
%xdefine BIO_shutdown_wr BORINGSSL_PREFIX %+ _BIO_shutdown_wr
|
||||
%xdefine BIO_snprintf BORINGSSL_PREFIX %+ _BIO_snprintf
|
||||
%xdefine BIO_tell BORINGSSL_PREFIX %+ _BIO_tell
|
||||
%xdefine BIO_test_flags BORINGSSL_PREFIX %+ _BIO_test_flags
|
||||
%xdefine BIO_up_ref BORINGSSL_PREFIX %+ _BIO_up_ref
|
||||
%xdefine BIO_vfree BORINGSSL_PREFIX %+ _BIO_vfree
|
||||
@@ -3155,6 +3163,8 @@
|
||||
%xdefine BN_CTX_new BORINGSSL_PREFIX %+ _BN_CTX_new
|
||||
%xdefine BN_CTX_start BORINGSSL_PREFIX %+ _BN_CTX_start
|
||||
%xdefine BN_GENCB_call BORINGSSL_PREFIX %+ _BN_GENCB_call
|
||||
%xdefine BN_GENCB_free BORINGSSL_PREFIX %+ _BN_GENCB_free
|
||||
%xdefine BN_GENCB_new BORINGSSL_PREFIX %+ _BN_GENCB_new
|
||||
%xdefine BN_GENCB_set BORINGSSL_PREFIX %+ _BN_GENCB_set
|
||||
%xdefine BN_MONT_CTX_copy BORINGSSL_PREFIX %+ _BN_MONT_CTX_copy
|
||||
%xdefine BN_MONT_CTX_free BORINGSSL_PREFIX %+ _BN_MONT_CTX_free
|
||||
@@ -3713,6 +3723,7 @@
|
||||
%xdefine ERR_remove_thread_state BORINGSSL_PREFIX %+ _ERR_remove_thread_state
|
||||
%xdefine ERR_restore_state BORINGSSL_PREFIX %+ _ERR_restore_state
|
||||
%xdefine ERR_save_state BORINGSSL_PREFIX %+ _ERR_save_state
|
||||
%xdefine ERR_set_error_data BORINGSSL_PREFIX %+ _ERR_set_error_data
|
||||
%xdefine ERR_set_mark BORINGSSL_PREFIX %+ _ERR_set_mark
|
||||
%xdefine EVP_AEAD_CTX_aead BORINGSSL_PREFIX %+ _EVP_AEAD_CTX_aead
|
||||
%xdefine EVP_AEAD_CTX_cleanup BORINGSSL_PREFIX %+ _EVP_AEAD_CTX_cleanup
|
||||
@@ -4411,6 +4422,7 @@
|
||||
%xdefine RSA_sign_pss_mgf1 BORINGSSL_PREFIX %+ _RSA_sign_pss_mgf1
|
||||
%xdefine RSA_sign_raw BORINGSSL_PREFIX %+ _RSA_sign_raw
|
||||
%xdefine RSA_size BORINGSSL_PREFIX %+ _RSA_size
|
||||
%xdefine RSA_test_flags BORINGSSL_PREFIX %+ _RSA_test_flags
|
||||
%xdefine RSA_up_ref BORINGSSL_PREFIX %+ _RSA_up_ref
|
||||
%xdefine RSA_verify BORINGSSL_PREFIX %+ _RSA_verify
|
||||
%xdefine RSA_verify_PKCS1_PSS_mgf1 BORINGSSL_PREFIX %+ _RSA_verify_PKCS1_PSS_mgf1
|
||||
|
||||
+4
-2
@@ -20,8 +20,10 @@ RUN apt-get update && apt-get install -y wget
|
||||
RUN apt-get update && apt-get install -y lsof dnsutils netcat-openbsd net-tools curl jq python2.7 # used by integration tests
|
||||
|
||||
# ruby and jazzy for docs generation
|
||||
RUN apt-get update && apt-get install -y ruby ruby-dev libsqlite3-dev
|
||||
RUN if [ "${ubuntu_version}" == "focal" ] ; then gem install jazzy --no-document ; fi
|
||||
RUN apt-get update && apt-get install -y ruby ruby-dev libsqlite3-dev build-essential
|
||||
# jazzy no longer works on xenial as ruby is too old.
|
||||
RUN if [ "${ubuntu_version}" = "focal" ] ; then echo "gem: --no-document" > ~/.gemrc; fi
|
||||
RUN if [ "${ubuntu_version}" = "focal" ] ; then gem install jazzy; fi
|
||||
|
||||
# cmake build
|
||||
RUN apt-get update && apt-get install -y cmake ninja-build
|
||||
|
||||
@@ -31,7 +31,7 @@ if [[ "$(uname -s)" == "Linux" ]]; then
|
||||
if [[ ! -d "$source_kitten_source_path" ]]; then
|
||||
git clone https://github.com/jpsim/SourceKitten.git "$source_kitten_source_path"
|
||||
fi
|
||||
source_kitten_path="$source_kitten_source_path/.build/x86_64-unknown-linux/debug"
|
||||
source_kitten_path="$source_kitten_source_path/.build/debug"
|
||||
if [[ ! -d "$source_kitten_path" ]]; then
|
||||
rm -rf "$source_kitten_source_path/.swift-version"
|
||||
cd "$source_kitten_source_path" && swift build && cd "$root_path"
|
||||
@@ -39,7 +39,7 @@ if [[ "$(uname -s)" == "Linux" ]]; then
|
||||
# generate
|
||||
for module in "${modules[@]}"; do
|
||||
if [[ ! -f "$root_path/.build/sourcekitten/$module.json" ]]; then
|
||||
"$source_kitten_path/sourcekitten" doc --spm-module $module > "$root_path/.build/sourcekitten/$module.json"
|
||||
"$source_kitten_path/sourcekitten" doc --spm --module-name $module > "$root_path/.build/sourcekitten/$module.json"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
Reference in new issue
Block a user