1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

AppleM1: Update openssl to v1.1.1l

This commit is contained in:
winlin 2022-08-14 19:05:01 +08:00
parent 1fe12b8e8c
commit b787656eea
990 changed files with 13406 additions and 18710 deletions

View file

@ -1,5 +1,5 @@
#! /usr/bin/env perl
# Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved.
# Copyright 2016-2021 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
@ -133,10 +133,10 @@ poly1305_init:
# ifdef __thumb2__
itete eq
# endif
addeq r12,r11,#(poly1305_emit-.Lpoly1305_init)
addne r12,r11,#(poly1305_emit_neon-.Lpoly1305_init)
addeq r11,r11,#(poly1305_blocks-.Lpoly1305_init)
addne r11,r11,#(poly1305_blocks_neon-.Lpoly1305_init)
addeq r12,r11,#(.Lpoly1305_emit-.Lpoly1305_init)
addne r12,r11,#(.Lpoly1305_emit_neon-.Lpoly1305_init)
addeq r11,r11,#(.Lpoly1305_blocks-.Lpoly1305_init)
addne r11,r11,#(.Lpoly1305_blocks_neon-.Lpoly1305_init)
# endif
# ifdef __thumb2__
orr r12,r12,#1 @ thumb-ify address
@ -352,6 +352,7 @@ $code.=<<___;
.type poly1305_emit,%function
.align 5
poly1305_emit:
.Lpoly1305_emit:
stmdb sp!,{r4-r11}
.Lpoly1305_emit_enter:
@ -671,6 +672,7 @@ poly1305_init_neon:
.type poly1305_blocks_neon,%function
.align 5
poly1305_blocks_neon:
.Lpoly1305_blocks_neon:
ldr ip,[$ctx,#36] @ is_base2_26
ands $len,$len,#-16
beq .Lno_data_neon
@ -1157,6 +1159,7 @@ poly1305_blocks_neon:
.type poly1305_emit_neon,%function
.align 5
poly1305_emit_neon:
.Lpoly1305_emit_neon:
ldr ip,[$ctx,#36] @ is_base2_26
stmdb sp!,{r4-r11}
@ -1250,4 +1253,4 @@ foreach (split("\n",$code)) {
print $_,"\n";
}
close STDOUT; # enforce flush
close STDOUT or die "error closing STDOUT: $!"; # enforce flush

View file

@ -1,5 +1,5 @@
#! /usr/bin/env perl
# Copyright 2016-2019 The OpenSSL Project Authors. All Rights Reserved.
# Copyright 2016-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
@ -57,10 +57,14 @@ $code.=<<___;
// forward "declarations" are required for Apple
.extern OPENSSL_armcap_P
.globl poly1305_blocks
.globl poly1305_emit
.hidden OPENSSL_armcap_P
.globl poly1305_init
.hidden poly1305_init
.globl poly1305_blocks
.hidden poly1305_blocks
.globl poly1305_emit
.hidden poly1305_emit
.type poly1305_init,%function
.align 5
poly1305_init:
@ -860,8 +864,8 @@ poly1305_blocks_neon:
st1 {$ACC4}[0],[$ctx]
.Lno_data_neon:
.inst 0xd50323bf // autiasp
ldr x29,[sp],#80
.inst 0xd50323bf // autiasp
ret
.size poly1305_blocks_neon,.-poly1305_blocks_neon
@ -943,4 +947,4 @@ foreach (split("\n",$code)) {
print $_,"\n";
}
close STDOUT;
close STDOUT or die "error closing STDOUT: $!";

View file

@ -1,5 +1,5 @@
#! /usr/bin/env perl
# Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.
# Copyright 2016-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
@ -433,5 +433,5 @@ ___
$output=pop and open STDOUT,">$output";
print $code;
close STDOUT;
close STDOUT or die "error closing STDOUT: $!";

View file

@ -1,5 +1,5 @@
#! /usr/bin/env perl
# Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved.
# Copyright 2016-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
@ -642,4 +642,4 @@ ___
$code =~ s/\`([^\`]*)\`/eval $1/gem;
print $code;
close STDOUT;
close STDOUT or die "error closing STDOUT: $!";

View file

@ -1,5 +1,5 @@
#! /usr/bin/env perl
# Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved.
# Copyright 2016-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
@ -736,4 +736,4 @@ ___
$code =~ s/\`([^\`]*)\`/eval $1/gem;
print $code;
close STDOUT;
close STDOUT or die "error closing STDOUT: $!";

View file

@ -1,5 +1,5 @@
#! /usr/bin/env perl
# Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.
# Copyright 2016-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
@ -224,4 +224,4 @@ $code =~ s/\`([^\`]*)\`/eval $1/gem;
$code =~ s/\b(srlg\s+)(%r[0-9]+\s*,)\s*([0-9]+)/$1$2$2$3/gm;
print $code;
close STDOUT;
close STDOUT or die "error closing STDOUT: $!";

View file

@ -1,5 +1,5 @@
#! /usr/bin/env perl
# Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.
# Copyright 2016-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
@ -1117,4 +1117,4 @@ foreach (split("\n",$code)) {
print $_,"\n";
}
close STDOUT;
close STDOUT or die "error closing STDOUT: $!";

View file

@ -1,5 +1,5 @@
#! /usr/bin/env perl
# Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved.
# Copyright 2016-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
@ -71,7 +71,7 @@ if ($sse2) {
$avx = ($1>=2.09) + ($1>=2.10);
}
if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|based on LLVM) ([3-9]\.[0-9]+)/) {
if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:clang|LLVM) version|based on LLVM) ([0-9]+\.[0-9]+)/) {
$avx = ($2>=3.0) + ($2>3.0);
}
}
@ -1812,4 +1812,4 @@ sub vlazy_reduction {
&asm_finish();
close STDOUT;
close STDOUT or die "error closing STDOUT: $!";

View file

@ -1,5 +1,5 @@
#! /usr/bin/env perl
# Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved.
# Copyright 2016-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
@ -90,7 +90,7 @@ if (!$avx && $win64 && ($flavour =~ /masm/ || $ENV{ASM} =~ /ml64/) &&
$avx = ($1>=10) + ($1>=12);
}
if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|.*based on LLVM) ([3-9]\.[0-9]+)/) {
if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:clang|LLVM) version|.*based on LLVM) ([0-9]+\.[0-9]+)/) {
$avx = ($2>=3.0) + ($2>3.0);
}
@ -168,6 +168,7 @@ $code.=<<___;
.type poly1305_init,\@function,3
.align 32
poly1305_init:
.cfi_startproc
xor %rax,%rax
mov %rax,0($ctx) # initialize hash value
mov %rax,8($ctx)
@ -219,6 +220,7 @@ $code.=<<___;
mov \$1,%eax
.Lno_key:
ret
.cfi_endproc
.size poly1305_init,.-poly1305_init
.type poly1305_blocks,\@function,4
@ -298,6 +300,7 @@ $code.=<<___;
.type poly1305_emit,\@function,3
.align 32
poly1305_emit:
.cfi_startproc
.Lemit:
mov 0($ctx),%r8 # load hash value
mov 8($ctx),%r9
@ -318,6 +321,7 @@ poly1305_emit:
mov %rcx,8($mac)
ret
.cfi_endproc
.size poly1305_emit,.-poly1305_emit
___
if ($avx) {
@ -342,15 +346,18 @@ $code.=<<___;
.type __poly1305_block,\@abi-omnipotent
.align 32
__poly1305_block:
.cfi_startproc
___
&poly1305_iteration();
$code.=<<___;
ret
.cfi_endproc
.size __poly1305_block,.-__poly1305_block
.type __poly1305_init_avx,\@abi-omnipotent
.align 32
__poly1305_init_avx:
.cfi_startproc
mov $r0,$h0
mov $r1,$h1
xor $h2,$h2
@ -508,6 +515,7 @@ __poly1305_init_avx:
lea -48-64($ctx),$ctx # size [de-]optimization
ret
.cfi_endproc
.size __poly1305_init_avx,.-__poly1305_init_avx
.type poly1305_blocks_avx,\@function,4
@ -1373,6 +1381,7 @@ $code.=<<___;
.type poly1305_emit_avx,\@function,3
.align 32
poly1305_emit_avx:
.cfi_startproc
cmpl \$0,20($ctx) # is_base2_26?
je .Lemit
@ -1423,6 +1432,7 @@ poly1305_emit_avx:
mov %rcx,8($mac)
ret
.cfi_endproc
.size poly1305_emit_avx,.-poly1305_emit_avx
___
@ -2741,6 +2751,7 @@ $code.=<<___;
.type poly1305_init_base2_44,\@function,3
.align 32
poly1305_init_base2_44:
.cfi_startproc
xor %rax,%rax
mov %rax,0($ctx) # initialize hash value
mov %rax,8($ctx)
@ -2782,6 +2793,7 @@ ___
$code.=<<___;
mov \$1,%eax
ret
.cfi_endproc
.size poly1305_init_base2_44,.-poly1305_init_base2_44
___
{
@ -2793,6 +2805,7 @@ $code.=<<___;
.type poly1305_blocks_vpmadd52,\@function,4
.align 32
poly1305_blocks_vpmadd52:
.cfi_startproc
shr \$4,$len
jz .Lno_data_vpmadd52 # too short
@ -2899,6 +2912,7 @@ poly1305_blocks_vpmadd52:
.Lno_data_vpmadd52:
ret
.cfi_endproc
.size poly1305_blocks_vpmadd52,.-poly1305_blocks_vpmadd52
___
}
@ -2916,6 +2930,7 @@ $code.=<<___;
.type poly1305_blocks_vpmadd52_4x,\@function,4
.align 32
poly1305_blocks_vpmadd52_4x:
.cfi_startproc
shr \$4,$len
jz .Lno_data_vpmadd52_4x # too short
@ -3340,6 +3355,7 @@ poly1305_blocks_vpmadd52_4x:
.Lno_data_vpmadd52_4x:
ret
.cfi_endproc
.size poly1305_blocks_vpmadd52_4x,.-poly1305_blocks_vpmadd52_4x
___
}
@ -3358,6 +3374,7 @@ $code.=<<___;
.type poly1305_blocks_vpmadd52_8x,\@function,4
.align 32
poly1305_blocks_vpmadd52_8x:
.cfi_startproc
shr \$4,$len
jz .Lno_data_vpmadd52_8x # too short
@ -3713,6 +3730,7 @@ $code.=<<___;
.Lno_data_vpmadd52_8x:
ret
.cfi_endproc
.size poly1305_blocks_vpmadd52_8x,.-poly1305_blocks_vpmadd52_8x
___
}
@ -3720,6 +3738,7 @@ $code.=<<___;
.type poly1305_emit_base2_44,\@function,3
.align 32
poly1305_emit_base2_44:
.cfi_startproc
mov 0($ctx),%r8 # load hash value
mov 8($ctx),%r9
mov 16($ctx),%r10
@ -3750,6 +3769,7 @@ poly1305_emit_base2_44:
mov %rcx,8($mac)
ret
.cfi_endproc
.size poly1305_emit_base2_44,.-poly1305_emit_base2_44
___
} } }
@ -3800,6 +3820,7 @@ $code.=<<___;
.type xor128_encrypt_n_pad,\@abi-omnipotent
.align 16
xor128_encrypt_n_pad:
.cfi_startproc
sub $otp,$inp
sub $otp,$out
mov $len,%r10 # put len aside
@ -3841,12 +3862,14 @@ xor128_encrypt_n_pad:
.Ldone_enc:
mov $otp,%rax
ret
.cfi_endproc
.size xor128_encrypt_n_pad,.-xor128_encrypt_n_pad
.globl xor128_decrypt_n_pad
.type xor128_decrypt_n_pad,\@abi-omnipotent
.align 16
xor128_decrypt_n_pad:
.cfi_startproc
sub $otp,$inp
sub $otp,$out
mov $len,%r10 # put len aside
@ -3892,6 +3915,7 @@ xor128_decrypt_n_pad:
.Ldone_dec:
mov $otp,%rax
ret
.cfi_endproc
.size xor128_decrypt_n_pad,.-xor128_decrypt_n_pad
___
}
@ -4156,4 +4180,4 @@ foreach (split('\n',$code)) {
print $_,"\n";
}
close STDOUT;
close STDOUT or die "error closing STDOUT: $!";

View file

@ -17,6 +17,7 @@ GENERATE[poly1305-armv8.S]=asm/poly1305-armv8.pl $(PERLASM_SCHEME)
INCLUDE[poly1305-armv8.o]=..
GENERATE[poly1305-mips.S]=asm/poly1305-mips.pl $(PERLASM_SCHEME)
INCLUDE[poly1305-mips.o]=..
GENERATE[poly1305-s390x.S]=asm/poly1305-s390x.pl $(PERLASM_SCHEME)
BEGINRAW[Makefile(unix)]
{- $builddir -}/poly1305-%.S: {- $sourcedir -}/asm/poly1305-%.pl

View file

@ -11,7 +11,7 @@
#include <string.h>
#include <openssl/crypto.h>
#include "internal/poly1305.h"
#include "crypto/poly1305.h"
#include "poly1305_local.h"
size_t Poly1305_ctx_size(void)
@ -89,7 +89,7 @@ static void
poly1305_blocks(void *ctx, const unsigned char *inp, size_t len, u32 padbit);
/*
* Type-agnostic "rip-off" from constant_time_locl.h
* Type-agnostic "rip-off" from constant_time.h
*/
# define CONSTANT_TIME_CARRY(a,b) ( \
(a ^ ((a ^ b) | ((a - b) ^ b))) >> (sizeof(a) * 8 - 1) \

View file

@ -1,5 +1,5 @@
/*
* Copyright 2007-2018 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 2007-2021 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
@ -10,10 +10,10 @@
#include <stdio.h>
#include "internal/cryptlib.h"
#include <openssl/evp.h>
#include "internal/asn1_int.h"
#include "internal/poly1305.h"
#include "crypto/asn1.h"
#include "crypto/poly1305.h"
#include "poly1305_local.h"
#include "internal/evp_int.h"
#include "crypto/evp.h"
/*
* POLY1305 "ASN1" method. This is just here to indicate the maximum
@ -43,7 +43,7 @@ static int poly1305_pkey_ctrl(EVP_PKEY *pkey, int op, long arg1, void *arg2)
static int poly1305_pkey_public_cmp(const EVP_PKEY *a, const EVP_PKEY *b)
{
return ASN1_OCTET_STRING_cmp(EVP_PKEY_get0(a), EVP_PKEY_get0(b));
return ASN1_OCTET_STRING_cmp(EVP_PKEY_get0(a), EVP_PKEY_get0(b)) == 0;
}
static int poly1305_set_priv_key(EVP_PKEY *pkey, const unsigned char *priv,

View file

@ -13,9 +13,9 @@
#include <openssl/x509v3.h>
#include <openssl/evp.h>
#include <openssl/err.h>
#include "internal/poly1305.h"
#include "crypto/poly1305.h"
#include "poly1305_local.h"
#include "internal/evp_int.h"
#include "crypto/evp.h"
/* POLY1305 pkey context structure */