	.file	"extr_ecrdsa.c_ecrdsa_verify.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	ecrdsa_verify, @function
ecrdsa_verify:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	r15
	push	r14
	push	r13
	push	r12
	push	rbx
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	mov	rbx, rdi
	sub	rsp, 88
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -56[rbp], rax
	xor	eax, eax
	call	crypto_akcipher_reqtfm@PLT
	mov	rdi, rax
	call	akcipher_tfm_ctx@PLT
	movsx	rcx, DWORD PTR ECRDSA_MAX_SIG_SIZE[rip]
	mov	rsi, rsp
	mov	r12, rax
	lea	rax, 15[rcx]
	mov	rdx, rax
	and	rax, -4096
	sub	rsi, rax
	and	rdx, -16
	mov	rax, rsi
	cmp	rsp, rax
	je	.L3
.L68:
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	cmp	rsp, rax
	jne	.L68
.L3:
	and	edx, 4095
	sub	rsp, rdx
	test	rdx, rdx
	jne	.L69
.L4:
	movsx	r8, DWORD PTR STREEBOG512_DIGEST_SIZE[rip]
	mov	rsi, rsp
	mov	r9, rsp
	lea	rax, 15[r8]
	mov	rdx, rax
	and	rax, -4096
	sub	rsi, rax
	and	rdx, -16
	mov	rax, rsi
	cmp	rsp, rax
	je	.L6
.L70:
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	cmp	rsp, rax
	jne	.L70
.L6:
	and	edx, 4095
	sub	rsp, rdx
	test	rdx, rdx
	jne	.L71
.L7:
	movsx	rax, DWORD PTR ECRDSA_MAX_DIGITS[rip]
	movsx	r10, DWORD PTR [rbx]
	mov	rdi, rsp
	mov	r14, rsp
	lea	rax, 15[0+rax*4]
	shr	r10, 2
	mov	rsi, rax
	mov	rdx, rax
	mov	r15, r10
	and	rsi, -4096
	and	rdx, -16
	sub	rdi, rsi
	mov	rsi, rdi
	cmp	rsp, rsi
	je	.L9
.L72:
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	cmp	rsp, rsi
	jne	.L72
.L9:
	and	edx, 4095
	sub	rsp, rdx
	test	rdx, rdx
	je	.L10
	or	QWORD PTR -8[rsp+rdx], 0
.L10:
	mov	rsi, rax
	mov	rdi, rsp
	mov	rdx, rax
	mov	r13, rsp
	and	rsi, -4096
	and	rdx, -16
	sub	rdi, rsi
	mov	rsi, rdi
	cmp	rsp, rsi
	je	.L12
.L73:
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	cmp	rsp, rsi
	jne	.L73
.L12:
	and	edx, 4095
	sub	rsp, rdx
	test	rdx, rdx
	je	.L13
	or	QWORD PTR -8[rsp+rdx], 0
.L13:
	mov	rsi, rax
	mov	rdi, rsp
	mov	rdx, rax
	mov	QWORD PTR -88[rbp], rsp
	and	rsi, -4096
	and	rdx, -16
	sub	rdi, rsi
	mov	rsi, rdi
	cmp	rsp, rsi
	je	.L15
.L74:
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	cmp	rsp, rsi
	jne	.L74
.L15:
	and	edx, 4095
	sub	rsp, rdx
	test	rdx, rdx
	je	.L16
	or	QWORD PTR -8[rsp+rdx], 0
.L16:
	mov	rsi, rax
	mov	rdi, rsp
	mov	rdx, rax
	mov	QWORD PTR -96[rbp], rsp
	and	rsi, -4096
	and	rdx, -16
	sub	rdi, rsi
	mov	rsi, rdi
	cmp	rsp, rsi
	je	.L18
.L75:
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	cmp	rsp, rsi
	jne	.L75
.L18:
	and	edx, 4095
	sub	rsp, rdx
	test	rdx, rdx
	je	.L19
	or	QWORD PTR -8[rsp+rdx], 0
.L19:
	lea	rdx, 3[rsp]
	mov	rsi, rdx
	and	rdx, -4
	shr	rsi, 2
	mov	QWORD PTR -104[rbp], rdx
	mov	rdx, rax
	and	rax, -4096
	mov	QWORD PTR -128[rbp], rsi
	mov	rsi, rsp
	and	rdx, -16
	sub	rsi, rax
	mov	rax, rsi
.L20:
	cmp	rsp, rax
	je	.L21
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L69:
	or	QWORD PTR -8[rsp+rdx], 0
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L71:
	or	QWORD PTR -8[rsp+rdx], 0
	jmp	.L7
.L21:
	mov	rax, rdx
	and	eax, 4095
	sub	rsp, rax
	test	rax, rax
	je	.L22
	or	QWORD PTR -8[rsp+rax], 0
.L22:
	mov	rsi, QWORD PTR -104[rbp]
	mov	rdi, QWORD PTR -96[rbp]
	mov	edx, r15d
	mov	QWORD PTR -112[rbp], r9
	mov	QWORD PTR -80[rbp], r8
	mov	QWORD PTR -72[rbp], rcx
	mov	QWORD PTR -120[rbp], rsp
	call	ECC_POINT_INIT@PLT
	mov	rdx, QWORD PTR 8[r12]
	mov	rcx, QWORD PTR -72[rbp]
	mov	r8, QWORD PTR -80[rbp]
	mov	r9, QWORD PTR -112[rbp]
	mov	QWORD PTR -64[rbp], rax
	test	rdx, rdx
	je	.L25
	mov	edi, DWORD PTR 24[r12]
	test	edi, edi
	je	.L25
	mov	esi, DWORD PTR 8[rbx]
	test	esi, esi
	je	.L25
	mov	eax, DWORD PTR 20[r12]
	test	eax, eax
	je	.L25
	mov	eax, DWORD PTR [rbx]
	cmp	eax, DWORD PTR [r12]
	jne	.L25
	movsx	rdx, DWORD PTR 8[rdx]
	movsx	rsi, eax
	mov	rdi, rdx
	sal	rdx, 2
	cmp	rsi, rdx
	jne	.L25
	cmp	edi, DWORD PTR 16[r12]
	jne	.L25
	add	eax, eax
	cmp	eax, DWORD PTR 4[rbx]
	je	.L76
	.p2align 4,,10
	.p2align 3
.L25:
	mov	eax, DWORD PTR EBADMSG[rip]
	neg	eax
.L1:
	mov	rsi, QWORD PTR -56[rbp]
	xor	rsi, QWORD PTR fs:40
	jne	.L77
	lea	rsp, -40[rbp]
	pop	rbx
	pop	r12
	pop	r13
	pop	r14
	pop	r15
	pop	rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L76:
	.cfi_restore_state
	cdqe
	xor	edi, edi
	mov	QWORD PTR -80[rbp], r9
	cmp	rcx, rax
	mov	QWORD PTR -72[rbp], r8
	setb	dil
	call	WARN_ON@PLT
	test	rax, rax
	jne	.L25
	movsx	rax, DWORD PTR [rbx]
	mov	r8, QWORD PTR -72[rbp]
	xor	edi, edi
	cmp	r8, rax
	setb	dil
	call	WARN_ON@PLT
	test	rax, rax
	jne	.L25
	mov	ecx, DWORD PTR 4[rbx]
	mov	edi, DWORD PTR 8[rbx]
	mov	esi, ecx
	mov	DWORD PTR -72[rbp], ecx
	call	sg_nents_for_len@PLT
	mov	r9, QWORD PTR -80[rbp]
	mov	edi, DWORD PTR 8[rbx]
	mov	ecx, DWORD PTR -72[rbp]
	mov	esi, eax
	mov	rdx, r9
	mov	QWORD PTR -112[rbp], r9
	call	sg_copy_to_buffer@PLT
	mov	r8d, DWORD PTR 4[rbx]
	mov	ecx, DWORD PTR [rbx]
	mov	edi, DWORD PTR 8[rbx]
	lea	esi, [r8+rcx]
	mov	DWORD PTR -80[rbp], ecx
	mov	DWORD PTR -72[rbp], r8d
	call	sg_nents_for_len@PLT
	mov	r8d, DWORD PTR -72[rbp]
	mov	ecx, DWORD PTR -80[rbp]
	mov	rdx, r14
	mov	edi, DWORD PTR 8[rbx]
	mov	esi, eax
	call	sg_pcopy_to_buffer@PLT
	mov	r9, QWORD PTR -112[rbp]
	mov	rdi, QWORD PTR -96[rbp]
	mov	edx, r15d
	mov	rsi, r9
	mov	QWORD PTR -72[rbp], r9
	call	vli_from_be64@PLT
	mov	r9, QWORD PTR -72[rbp]
	mov	eax, r15d
	mov	rdi, r13
	mov	edx, r15d
	lea	rsi, [r9+rax*4]
	call	vli_from_be64@PLT
	mov	esi, r15d
	mov	rdi, r13
	call	vli_is_zero@PLT
	test	rax, rax
	jne	.L66
	mov	rax, QWORD PTR 8[r12]
	mov	edx, r15d
	mov	rdi, r13
	mov	rsi, QWORD PTR [rax]
	call	vli_cmp@PLT
	cmp	eax, 1
	je	.L66
	mov	rbx, QWORD PTR -96[rbp]
	mov	esi, r15d
	mov	rdi, rbx
	call	vli_is_zero@PLT
	test	rax, rax
	jne	.L66
	mov	rax, QWORD PTR 8[r12]
	mov	edx, r15d
	mov	rdi, rbx
	mov	rsi, QWORD PTR [rax]
	call	vli_cmp@PLT
	sub	eax, 1
	je	.L66
	mov	rbx, QWORD PTR -104[rbp]
	mov	edx, r15d
	mov	rsi, r14
	mov	rdi, rbx
	call	vli_from_le64@PLT
	mov	rax, QWORD PTR 8[r12]
	mov	edx, r15d
	mov	rdi, rbx
	mov	rsi, QWORD PTR [rax]
	call	vli_cmp@PLT
	sub	eax, 1
	je	.L78
.L28:
	mov	rdi, QWORD PTR -104[rbp]
	mov	esi, r15d
	call	vli_is_zero@PLT
	test	rax, rax
	je	.L29
	mov	rax, QWORD PTR -128[rbp]
	mov	DWORD PTR 0[0+rax*4], 1
.L29:
	mov	rax, QWORD PTR 8[r12]
	mov	r14, QWORD PTR -104[rbp]
	mov	ecx, r15d
	mov	rdx, QWORD PTR [rax]
	mov	rsi, r14
	mov	rdi, r14
	call	vli_mod_inv@PLT
	mov	rax, QWORD PTR 8[r12]
	mov	r8d, r15d
	mov	rdx, r14
	mov	rsi, QWORD PTR -96[rbp]
	mov	rdi, QWORD PTR -120[rbp]
	mov	rcx, QWORD PTR [rax]
	call	vli_mod_mult_slow@PLT
	mov	rax, QWORD PTR 8[r12]
	mov	ecx, r15d
	mov	rdx, r13
	mov	rbx, QWORD PTR -88[rbp]
	mov	rsi, QWORD PTR [rax]
	mov	rdi, rbx
	call	vli_sub@PLT
	mov	rax, QWORD PTR 8[r12]
	mov	r8d, r15d
	mov	rdx, r14
	mov	rsi, rbx
	mov	rdi, rbx
	mov	rcx, QWORD PTR [rax]
	call	vli_mod_mult_slow@PLT
	mov	rsi, QWORD PTR -120[rbp]
	lea	rdi, -64[rbp]
	mov	rcx, rbx
	mov	r9, QWORD PTR 8[r12]
	lea	r8, 16[r12]
	lea	rdx, 8[r9]
	call	ecc_point_mult_shamir@PLT
	mov	rax, QWORD PTR 8[r12]
	mov	rdi, QWORD PTR -64[rbp]
	mov	edx, r15d
	mov	rsi, QWORD PTR [rax]
	call	vli_cmp@PLT
	sub	eax, 1
	je	.L79
.L30:
	mov	rdi, QWORD PTR -64[rbp]
	mov	edx, r15d
	mov	rsi, r13
	call	vli_cmp@PLT
	test	eax, eax
	je	.L1
.L66:
	mov	eax, DWORD PTR EKEYREJECTED[rip]
	neg	eax
	jmp	.L1
.L77:
	call	__stack_chk_fail@PLT
.L78:
	mov	rax, QWORD PTR 8[r12]
	mov	rsi, QWORD PTR -104[rbp]
	mov	ecx, r15d
	mov	rdx, QWORD PTR [rax]
	mov	rdi, rsi
	call	vli_sub@PLT
	jmp	.L28
.L79:
	mov	rax, QWORD PTR 8[r12]
	mov	rdi, QWORD PTR -64[rbp]
	mov	ecx, r15d
	mov	rdx, QWORD PTR [rax]
	mov	rsi, rdi
	call	vli_sub@PLT
	jmp	.L30
	.cfi_endproc
.LFE0:
	.size	ecrdsa_verify, .-ecrdsa_verify
	.comm	STREEBOG512_DIGEST_SIZE,4,4
	.comm	EKEYREJECTED,4,4
	.comm	ECRDSA_MAX_SIG_SIZE,4,4
	.comm	ECRDSA_MAX_DIGITS,4,4
	.comm	EBADMSG,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_ecrdsa.c_ecrdsa_verify.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	ecrdsa_verify, %function
ecrdsa_verify:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	add	fp, sp, #32
	sub	sp, sp, #44
	ldr	r3, .L39
	mov	r5, r0
	ldr	r3, [r3]
	str	r3, [fp, #-40]
	mov	r3,#0
	bl	crypto_akcipher_reqtfm
	bl	akcipher_tfm_ctx
	ldr	r3, .L39+4
	ldr	r1, .L39+8
	ldr	r2, .L39+12
	ldr	r3, [r3]
	ldr	r10, [r1]
	ldr	r2, [r2]
	add	ip, r3, #7
	bic	ip, ip, #7
	add	r1, r10, #7
	lsl	r2, r2, #2
	sub	sp, sp, ip
	bic	r1, r1, #7
	add	r2, r2, #7
	bic	r2, r2, #7
	str	r3, [fp, #-48]
	add	r3, sp, #8
	sub	sp, sp, r1
	str	r3, [fp, #-56]
	add	r3, sp, #8
	sub	sp, sp, r2
	str	r3, [fp, #-60]
	add	r3, sp, #8
	sub	sp, sp, r2
	ldr	r8, [r5]
	str	r3, [fp, #-52]
	add	r3, sp, #8
	sub	sp, sp, r2
	mov	r4, r0
	add	r9, sp, #8
	sub	sp, sp, r2
	add	r7, sp, #8
	lsr	r6, r8, #2
	sub	sp, sp, r2
	mov	r1, r7
	mov	r2, r6
	mov	r0, r9
	str	r3, [fp, #-64]
	bl	ECC_POINT_INIT
	ldr	r2, [r4, #4]
	add	r3, sp, #8
	cmp	r2, #0
	str	r3, [fp, #-68]
	str	r0, [fp, #-44]
	ldr	r3, [fp, #-48]
	beq	.L4
	ldr	r1, [r4, #16]
	cmp	r1, #0
	beq	.L4
	ldr	r1, [r5, #8]
	cmp	r1, #0
	beq	.L4
	ldr	r1, [r4, #12]
	cmp	r1, #0
	beq	.L4
	ldr	r1, [r5]
	ldr	r0, [r4]
	cmp	r1, r0
	beq	.L35
.L4:
	ldr	r3, .L39+16
	ldr	r0, [r3]
	rsb	r0, r0, #0
.L1:
	ldr	r3, .L39
	ldr	r2, [r3]
	ldr	r3, [fp, #-40]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L36
	sub	sp, fp, #32
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L35:
	ldr	r2, [r2, #4]
	cmp	r1, r2, lsl #2
	bne	.L4
	ldr	r1, [r4, #8]
	cmp	r2, r1
	bne	.L4
	ldr	r1, [r5, #4]
	lsl	r0, r2, #3
	cmp	r1, r2, lsl #3
	bne	.L4
	cmp	r3, r0
	movcs	r0, #0
	movcc	r0, #1
	bl	WARN_ON
	cmp	r0, #0
	bne	.L4
	ldr	r0, [r5]
	cmp	r10, r0
	movcs	r0, #0
	movcc	r0, #1
	bl	WARN_ON
	cmp	r0, #0
	bne	.L4
	ldmib	r5, {r1, r10}
	mov	r0, r10
	bl	sg_nents_for_len
	ldr	r3, [r5, #4]
	mov	r1, r0
	ldr	r2, [fp, #-56]
	mov	r0, r10
	bl	sg_copy_to_buffer
	ldmib	r5, {r1, r10}
	ldr	r3, [r5]
	mov	r0, r10
	add	r1, r1, r3
	bl	sg_nents_for_len
	ldr	r3, [r5, #4]
	mov	r1, r0
	str	r3, [sp]
	ldr	r3, [r5]
	ldr	r2, [fp, #-60]
	mov	r0, r10
	bl	sg_pcopy_to_buffer
	ldr	r5, [fp, #-56]
	mov	r2, r6
	mov	r1, r5
	mov	r0, r9
	bl	vli_from_be64
	bic	r1, r8, #3
	add	r1, r5, r1
	ldr	r5, [fp, #-52]
	mov	r2, r6
	mov	r0, r5
	bl	vli_from_be64
	mov	r1, r6
	mov	r0, r5
	bl	vli_is_zero
	cmp	r0, #0
	bne	.L33
	ldr	r3, [r4, #4]
	mov	r2, r6
	ldr	r1, [r3]
	ldr	r0, [fp, #-52]
	bl	vli_cmp
	cmp	r0, #1
	beq	.L33
	mov	r1, r6
	mov	r0, r9
	bl	vli_is_zero
	cmp	r0, #0
	bne	.L33
	ldr	r3, [r4, #4]
	mov	r2, r6
	mov	r0, r9
	ldr	r1, [r3]
	bl	vli_cmp
	cmp	r0, #1
	beq	.L33
	mov	r2, r6
	ldr	r1, [fp, #-60]
	mov	r0, r7
	bl	vli_from_le64
	ldr	r3, [r4, #4]
	mov	r2, r6
	mov	r0, r7
	ldr	r1, [r3]
	bl	vli_cmp
	cmp	r0, #1
	beq	.L37
.L7:
	mov	r1, r6
	mov	r0, r7
	bl	vli_is_zero
	cmp	r0, #0
	movne	r3, #1
	ldr	r2, [r4, #4]
	strne	r3, [r7]
	mov	r1, r7
	mov	r3, r6
	ldr	r2, [r2]
	mov	r0, r7
	bl	vli_mod_inv
	ldr	r3, [r4, #4]
	ldr	r8, [fp, #-68]
	str	r6, [sp]
	mov	r1, r9
	mov	r2, r7
	ldr	r3, [r3]
	mov	r0, r8
	bl	vli_mod_mult_slow
	ldr	r5, [fp, #-64]
	ldr	r2, [r4, #4]
	mov	r3, r6
	ldr	r1, [r2]
	mov	r0, r5
	ldr	r2, [fp, #-52]
	bl	vli_sub
	ldr	r3, [r4, #4]
	str	r6, [sp]
	mov	r2, r7
	mov	r1, r5
	ldr	r3, [r3]
	mov	r0, r5
	bl	vli_mod_mult_slow
	ldr	r2, [r4, #4]
	add	r0, r4, #8
	mov	r3, r5
	mov	r1, r8
	str	r2, [sp, #4]
	str	r0, [sp]
	add	r2, r2, #4
	sub	r0, fp, #44
	bl	ecc_point_mult_shamir
	ldr	r3, [r4, #4]
	mov	r2, r6
	ldr	r1, [r3]
	ldr	r0, [fp, #-44]
	bl	vli_cmp
	cmp	r0, #1
	beq	.L38
.L9:
	mov	r2, r6
	ldr	r1, [fp, #-52]
	ldr	r0, [fp, #-44]
	bl	vli_cmp
	cmp	r0, #0
	beq	.L1
.L33:
	ldr	r3, .L39+20
	ldr	r0, [r3]
	rsb	r0, r0, #0
	b	.L1
.L36:
	bl	__stack_chk_fail
.L38:
	ldr	r3, [r4, #4]
	ldr	r1, [fp, #-44]
	ldr	r2, [r3]
	mov	r0, r1
	mov	r3, r6
	bl	vli_sub
	b	.L9
.L37:
	ldr	r2, [r4, #4]
	mov	r3, r6
	mov	r1, r7
	mov	r0, r7
	ldr	r2, [r2]
	bl	vli_sub
	b	.L7
.L40:
	.align	2
.L39:
	.word	.LC0
	.word	ECRDSA_MAX_SIG_SIZE
	.word	STREEBOG512_DIGEST_SIZE
	.word	ECRDSA_MAX_DIGITS
	.word	EBADMSG
	.word	EKEYREJECTED
	.size	ecrdsa_verify, .-ecrdsa_verify
	.comm	STREEBOG512_DIGEST_SIZE,4,4
	.comm	EKEYREJECTED,4,4
	.comm	ECRDSA_MAX_SIG_SIZE,4,4
	.comm	ECRDSA_MAX_DIGITS,4,4
	.comm	EBADMSG,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
