	.file	"extr_rsa_ossl.c_rsa_ossl_public_decrypt.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	rsa_ossl_public_decrypt, @function
rsa_ossl_public_decrypt:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	mov	r14, rsi
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13d, edi
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	rbx, rcx
	sub	rsp, 40
	.cfi_def_cfa_offset 96
	mov	rdi, QWORD PTR 8[rcx]
	mov	QWORD PTR 24[rsp], rdx
	mov	DWORD PTR 20[rsp], r8d
	call	BN_num_bits@PLT
	cmp	rax, QWORD PTR OPENSSL_RSA_MAX_MODULUS_BITS[rip]
	jg	.L36
	mov	rsi, QWORD PTR 24[rbx]
	mov	rdi, QWORD PTR 8[rbx]
	call	BN_ucmp@PLT
	test	rax, rax
	jle	.L34
	mov	rdi, QWORD PTR 8[rbx]
	call	BN_num_bits@PLT
	cmp	rax, QWORD PTR OPENSSL_RSA_SMALL_MODULUS_BITS[rip]
	jg	.L37
.L5:
	xor	eax, eax
	call	BN_CTX_new@PLT
	mov	r15, rax
	test	rax, rax
	je	.L17
	mov	rdi, rax
	call	BN_CTX_start@PLT
	mov	rdi, r15
	call	BN_CTX_get@PLT
	mov	rdi, r15
	mov	QWORD PTR 8[rsp], rax
	call	BN_CTX_get@PLT
	mov	rdi, QWORD PTR 8[rbx]
	mov	QWORD PTR [rsp], rax
	call	BN_num_bytes@PLT
	mov	edi, eax
	mov	ebp, eax
	call	OPENSSL_malloc@PLT
	cmp	QWORD PTR [rsp], 0
	mov	r12, rax
	je	.L22
	test	rax, rax
	je	.L22
	cmp	ebp, r13d
	jl	.L38
	mov	rdx, QWORD PTR 8[rsp]
	mov	esi, r13d
	mov	rdi, r14
	mov	r13d, -1
	call	BN_bin2bn@PLT
	test	rax, rax
	je	.L6
	mov	rsi, QWORD PTR 8[rbx]
	mov	rdi, QWORD PTR 8[rsp]
	call	BN_ucmp@PLT
	test	rax, rax
	jns	.L39
	mov	r14, QWORD PTR 8[rbx]
	mov	eax, DWORD PTR [rbx]
	test	DWORD PTR RSA_FLAG_CACHE_PUBLIC[rip], eax
	jne	.L40
.L11:
	mov	rax, QWORD PTR 32[rbx]
	mov	rdx, QWORD PTR 24[rbx]
	mov	r8, r15
	mov	rcx, r14
	mov	r9d, DWORD PTR 16[rbx]
	mov	rdi, QWORD PTR [rsp]
	mov	r13d, -1
	mov	rsi, QWORD PTR 8[rsp]
	call	[QWORD PTR [rax]]
	test	eax, eax
	je	.L6
	cmp	DWORD PTR 20[rsp], 128
	je	.L41
	mov	rdi, QWORD PTR [rsp]
	mov	edx, ebp
	mov	rsi, r12
	call	BN_bn2binpad@PLT
	mov	r13d, eax
	mov	eax, DWORD PTR 20[rsp]
	cmp	eax, 130
	je	.L14
	jg	.L15
	cmp	eax, 129
	jne	.L15
	mov	rdi, QWORD PTR 24[rsp]
	mov	ecx, r13d
	mov	r8d, ebp
	mov	rdx, r12
	mov	esi, ebp
	call	RSA_padding_check_PKCS1_type_1@PLT
	mov	r13d, eax
.L16:
	test	r13d, r13d
	jns	.L6
	mov	esi, DWORD PTR RSA_R_PADDING_CHECK_FAILED[rip]
	mov	edi, DWORD PTR RSA_F_RSA_OSSL_PUBLIC_DECRYPT[rip]
	call	RSAerr@PLT
	.p2align 4,,10
	.p2align 3
.L6:
	mov	rdi, r15
	call	BN_CTX_end@PLT
	mov	rdi, r15
	call	BN_CTX_free@PLT
	mov	esi, ebp
	mov	rdi, r12
	call	OPENSSL_clear_free@PLT
.L1:
	add	rsp, 40
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, r13d
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L37:
	.cfi_restore_state
	mov	rdi, QWORD PTR 24[rbx]
	call	BN_num_bits@PLT
	cmp	rax, QWORD PTR OPENSSL_RSA_MAX_PUBEXP_BITS[rip]
	jle	.L5
.L34:
	mov	esi, DWORD PTR RSA_R_BAD_E_VALUE[rip]
	mov	edi, DWORD PTR RSA_F_RSA_OSSL_PUBLIC_DECRYPT[rip]
	mov	r13d, -1
	call	RSAerr@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L17:
	xor	r12d, r12d
	mov	r13d, -1
	xor	ebp, ebp
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L38:
	mov	esi, DWORD PTR RSA_R_DATA_GREATER_THAN_MOD_LEN[rip]
	mov	edi, DWORD PTR RSA_F_RSA_OSSL_PUBLIC_DECRYPT[rip]
	mov	r13d, -1
	call	RSAerr@PLT
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L39:
	mov	esi, DWORD PTR RSA_R_DATA_TOO_LARGE_FOR_MODULUS[rip]
	mov	edi, DWORD PTR RSA_F_RSA_OSSL_PUBLIC_DECRYPT[rip]
	call	RSAerr@PLT
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L22:
	mov	esi, DWORD PTR ERR_R_MALLOC_FAILURE[rip]
	mov	edi, DWORD PTR RSA_F_RSA_OSSL_PUBLIC_DECRYPT[rip]
	mov	r13d, -1
	call	RSAerr@PLT
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L40:
	mov	esi, DWORD PTR 40[rbx]
	lea	rdi, 16[rbx]
	mov	rcx, r15
	mov	rdx, r14
	call	BN_MONT_CTX_set_locked@PLT
	test	eax, eax
	je	.L6
	mov	r14, QWORD PTR 8[rbx]
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L15:
	mov	esi, DWORD PTR RSA_R_UNKNOWN_PADDING_TYPE[rip]
	mov	edi, DWORD PTR RSA_F_RSA_OSSL_PUBLIC_DECRYPT[rip]
	mov	r13d, -1
	call	RSAerr@PLT
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L14:
	mov	rdi, QWORD PTR 24[rsp]
	mov	edx, r13d
	mov	rsi, r12
	call	memcpy@PLT
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L41:
	mov	r14, QWORD PTR [rsp]
	mov	rdi, r14
	call	bn_get_words@PLT
	mov	eax, DWORD PTR [rax]
	and	eax, 15
	cmp	eax, 12
	je	.L13
	mov	rsi, QWORD PTR 8[rbx]
	mov	rdx, r14
	mov	rdi, r14
	call	BN_sub@PLT
	test	eax, eax
	je	.L6
.L13:
	mov	rdi, QWORD PTR [rsp]
	mov	edx, ebp
	mov	rsi, r12
	call	BN_bn2binpad@PLT
	mov	rdi, QWORD PTR 24[rsp]
	mov	r8d, ebp
	mov	rdx, r12
	mov	ecx, eax
	mov	esi, ebp
	call	RSA_padding_check_X931@PLT
	mov	r13d, eax
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L36:
	mov	esi, DWORD PTR RSA_R_MODULUS_TOO_LARGE[rip]
	mov	edi, DWORD PTR RSA_F_RSA_OSSL_PUBLIC_DECRYPT[rip]
	mov	r13d, -1
	call	RSAerr@PLT
	jmp	.L1
	.cfi_endproc
.LFE0:
	.size	rsa_ossl_public_decrypt, .-rsa_ossl_public_decrypt
	.comm	RSA_R_UNKNOWN_PADDING_TYPE,4,4
	.comm	RSA_R_PADDING_CHECK_FAILED,4,4
	.comm	RSA_R_MODULUS_TOO_LARGE,4,4
	.comm	RSA_R_DATA_TOO_LARGE_FOR_MODULUS,4,4
	.comm	RSA_R_DATA_GREATER_THAN_MOD_LEN,4,4
	.comm	RSA_R_BAD_E_VALUE,4,4
	.comm	RSA_F_RSA_OSSL_PUBLIC_DECRYPT,4,4
	.comm	RSA_FLAG_CACHE_PUBLIC,4,4
	.comm	OPENSSL_RSA_SMALL_MODULUS_BITS,8,8
	.comm	OPENSSL_RSA_MAX_PUBEXP_BITS,8,8
	.comm	OPENSSL_RSA_MAX_MODULUS_BITS,8,8
	.comm	ERR_R_MALLOC_FAILURE,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_rsa_ossl.c_rsa_ossl_public_decrypt.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	rsa_ossl_public_decrypt, %function
rsa_ossl_public_decrypt:
	@ args = 4, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r8, r0
	sub	sp, sp, #20
	ldr	r0, [r3, #4]
	mov	r4, r3
	str	r2, [sp, #12]
	mov	r9, r1
	bl	BN_num_bits
	ldr	r3, .L37
	ldr	r3, [r3]
	cmp	r0, r3
	ldrgt	r2, .L37+4
	bgt	.L30
	ldr	r1, [r4, #12]
	ldr	r0, [r4, #4]
	bl	BN_ucmp
	cmp	r0, #0
	ble	.L29
	ldr	r0, [r4, #4]
	bl	BN_num_bits
	ldr	r3, .L37+8
	ldr	r3, [r3]
	cmp	r0, r3
	bgt	.L32
.L5:
	bl	BN_CTX_new
	subs	r5, r0, #0
	beq	.L16
	bl	BN_CTX_start
	mov	r0, r5
	bl	BN_CTX_get
	mov	fp, r0
	mov	r0, r5
	bl	BN_CTX_get
	mov	r10, r0
	ldr	r0, [r4, #4]
	bl	BN_num_bytes
	mov	r7, r0
	bl	OPENSSL_malloc
	cmp	r0, #0
	cmpne	r10, #0
	mov	r6, r0
	ldreq	r2, .L37+12
	beq	.L28
	cmp	r7, r8
	blt	.L33
	mov	r1, r8
	mov	r0, r9
	mov	r2, fp
	bl	BN_bin2bn
	cmp	r0, #0
	beq	.L20
	mov	r0, fp
	ldr	r1, [r4, #4]
	bl	BN_ucmp
	cmp	r0, #0
	ldrge	r2, .L37+16
	bge	.L28
	ldr	r3, .L37+20
	ldr	r1, [r4]
	ldr	r2, [r3]
	ldr	r3, [r4, #4]
	tst	r1, r2
	bne	.L34
.L10:
	ldr	r1, [r4, #8]
	ldr	r2, [r4, #16]
	str	r1, [sp, #4]
	str	r5, [sp]
	ldr	r8, [r2]
	mov	r1, fp
	mov	r0, r10
	ldr	r2, [r4, #12]
	blx	r8
	cmp	r0, #0
	beq	.L20
	ldr	r3, [sp, #56]
	mov	r0, r10
	cmp	r3, #128
	beq	.L35
	mov	r2, r7
	mov	r1, r6
	bl	BN_bn2binpad
	ldr	r3, [sp, #56]
	mov	r4, r0
	cmp	r3, #130
	beq	.L13
	bgt	.L14
	cmp	r3, #129
	bne	.L14
	mov	r3, r0
	mov	r2, r6
	mov	r1, r7
	ldr	r0, [sp, #12]
	str	r7, [sp]
	bl	RSA_padding_check_PKCS1_type_1
	mov	r4, r0
.L15:
	cmp	r4, #0
	bge	.L6
	ldr	r2, .L37+24
	ldr	r3, .L37+28
	ldr	r1, [r2]
	ldr	r0, [r3]
	bl	RSAerr
	b	.L6
.L32:
	ldr	r0, [r4, #12]
	bl	BN_num_bits
	ldr	r3, .L37+32
	ldr	r3, [r3]
	cmp	r0, r3
	ble	.L5
.L29:
	ldr	r2, .L37+36
.L30:
	ldr	r3, .L37+28
	ldr	r1, [r2]
	ldr	r0, [r3]
	bl	RSAerr
	mvn	r4, #0
	b	.L1
.L33:
	ldr	r2, .L37+40
.L28:
	ldr	r3, .L37+28
	ldr	r1, [r2]
	ldr	r0, [r3]
	bl	RSAerr
	mvn	r4, #0
.L6:
	mov	r0, r5
	bl	BN_CTX_end
	mov	r0, r5
	bl	BN_CTX_free
	mov	r1, r7
	mov	r0, r6
	bl	OPENSSL_clear_free
.L1:
	mov	r0, r4
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L16:
	mov	r6, r5
	mvn	r4, #0
	mov	r7, r5
	b	.L6
.L34:
	mov	r2, r3
	ldr	r1, [r4, #20]
	mov	r3, r5
	add	r0, r4, #8
	bl	BN_MONT_CTX_set_locked
	cmp	r0, #0
	bne	.L36
.L20:
	mvn	r4, #0
	b	.L6
.L36:
	ldr	r3, [r4, #4]
	b	.L10
.L14:
	ldr	r2, .L37+44
	b	.L28
.L13:
	mov	r2, r4
	mov	r1, r6
	ldr	r0, [sp, #12]
	bl	memcpy
	b	.L15
.L35:
	bl	bn_get_words
	ldr	r3, [r0]
	and	r3, r3, #15
	cmp	r3, #12
	beq	.L12
	mov	r2, r10
	mov	r0, r10
	ldr	r1, [r4, #4]
	bl	BN_sub
	cmp	r0, #0
	beq	.L20
.L12:
	mov	r2, r7
	mov	r1, r6
	mov	r0, r10
	bl	BN_bn2binpad
	mov	r2, r6
	mov	r3, r0
	mov	r1, r7
	ldr	r0, [sp, #12]
	str	r7, [sp]
	bl	RSA_padding_check_X931
	mov	r4, r0
	b	.L15
.L38:
	.align	2
.L37:
	.word	OPENSSL_RSA_MAX_MODULUS_BITS
	.word	RSA_R_MODULUS_TOO_LARGE
	.word	OPENSSL_RSA_SMALL_MODULUS_BITS
	.word	ERR_R_MALLOC_FAILURE
	.word	RSA_R_DATA_TOO_LARGE_FOR_MODULUS
	.word	RSA_FLAG_CACHE_PUBLIC
	.word	RSA_R_PADDING_CHECK_FAILED
	.word	RSA_F_RSA_OSSL_PUBLIC_DECRYPT
	.word	OPENSSL_RSA_MAX_PUBEXP_BITS
	.word	RSA_R_BAD_E_VALUE
	.word	RSA_R_DATA_GREATER_THAN_MOD_LEN
	.word	RSA_R_UNKNOWN_PADDING_TYPE
	.size	rsa_ossl_public_decrypt, .-rsa_ossl_public_decrypt
	.comm	RSA_R_UNKNOWN_PADDING_TYPE,4,4
	.comm	RSA_R_PADDING_CHECK_FAILED,4,4
	.comm	RSA_R_MODULUS_TOO_LARGE,4,4
	.comm	RSA_R_DATA_TOO_LARGE_FOR_MODULUS,4,4
	.comm	RSA_R_DATA_GREATER_THAN_MOD_LEN,4,4
	.comm	RSA_R_BAD_E_VALUE,4,4
	.comm	RSA_F_RSA_OSSL_PUBLIC_DECRYPT,4,4
	.comm	RSA_FLAG_CACHE_PUBLIC,4,4
	.comm	OPENSSL_RSA_SMALL_MODULUS_BITS,4,4
	.comm	OPENSSL_RSA_MAX_PUBEXP_BITS,4,4
	.comm	OPENSSL_RSA_MAX_MODULUS_BITS,4,4
	.comm	ERR_R_MALLOC_FAILURE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
