	.file	"extr_crypto4xx_alg.c_crypto4xx_setkey_aes_gcm.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"GCM hash key setting failed = %d\n"
	.text
	.p2align 4
	.globl	crypto4xx_setkey_aes_gcm
	.type	crypto4xx_setkey_aes_gcm, @function
crypto4xx_setkey_aes_gcm:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	mov	r14, rsi
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	mov	r13d, edx
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	mov	r12, rdi
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	sub	rsp, 8
	.cfi_def_cfa_offset 48
	call	crypto_aead_tfm@PLT
	mov	rdi, rax
	call	crypto_tfm_ctx@PLT
	mov	edi, r13d
	mov	rbp, rax
	call	crypto4xx_aes_gcm_validate_keylen@PLT
	test	rax, rax
	jne	.L9
	mov	rsi, r12
	mov	ecx, r13d
	mov	rdx, r14
	mov	rdi, rbp
	call	crypto4xx_aead_setup_fallback@PLT
	mov	r12d, eax
	test	eax, eax
	jne	.L1
	cmp	QWORD PTR 16[rbp], 0
	jne	.L4
	cmp	QWORD PTR 8[rbp], 0
	jne	.L4
.L5:
	lea	esi, -16[r13]
	mov	rdi, rbp
	shr	esi, 2
	add	rsi, QWORD PTR SA_AES128_GCM_LEN[rip]
	call	crypto4xx_alloc_sa@PLT
	mov	r12d, eax
	test	eax, eax
	jne	.L1
	mov	r12, QWORD PTR 16[rbp]
	lea	eax, 0[0+r13*4]
	or	eax, DWORD PTR SA_AES_GCM_CONTENTS[rip]
	mov	r9d, DWORD PTR SA_NO_HEADER_PROC[rip]
	mov	r8d, DWORD PTR SA_LOAD_IV_FROM_STATE[rip]
	mov	DWORD PTR 12[r12], eax
	mov	eax, DWORD PTR DIR_INBOUND[rip]
	mov	rdi, r12
	mov	ecx, DWORD PTR SA_LOAD_HASH_FROM_SA[rip]
	mov	edx, DWORD PTR SA_NOT_SAVE_IV[rip]
	push	rax
	.cfi_def_cfa_offset 56
	mov	eax, DWORD PTR SA_OPCODE_HASH_DECRYPT[rip]
	mov	esi, DWORD PTR SA_SAVE_HASH[rip]
	push	rax
	.cfi_def_cfa_offset 64
	mov	eax, DWORD PTR SA_OP_GROUP_BASIC[rip]
	push	rax
	.cfi_def_cfa_offset 72
	mov	eax, DWORD PTR SA_PAD_TYPE_ZERO[rip]
	push	rax
	.cfi_def_cfa_offset 80
	mov	eax, DWORD PTR SA_CIPHER_ALG_AES[rip]
	push	rax
	.cfi_def_cfa_offset 88
	mov	eax, DWORD PTR SA_HASH_ALG_GHASH[rip]
	push	rax
	.cfi_def_cfa_offset 96
	call	set_dynamic_sa_command_0@PLT
	mov	eax, DWORD PTR SA_NOT_COPY_HDR[rip]
	add	rsp, 48
	.cfi_def_cfa_offset 48
	mov	r9d, DWORD PTR SA_SEQ_MASK_ON[rip]
	mov	r8d, DWORD PTR SA_EXTENDED_SN_OFF[rip]
	mov	ecx, DWORD PTR CRYPTO_FEEDBACK_MODE_NO_FB[rip]
	mov	rdi, r12
	mov	edx, DWORD PTR SA_HASH_MODE_HASH[rip]
	mov	esi, DWORD PTR CRYPTO_MODE_CTR[rip]
	push	rax
	.cfi_def_cfa_offset 56
	mov	eax, DWORD PTR SA_COPY_PAYLOAD[rip]
	push	rax
	.cfi_def_cfa_offset 64
	mov	eax, DWORD PTR SA_NOT_COPY_PAD[rip]
	push	rax
	.cfi_def_cfa_offset 72
	mov	eax, DWORD PTR SA_MC_DISABLE[rip]
	push	rax
	.cfi_def_cfa_offset 80
	call	set_dynamic_sa_command_1@PLT
	mov	eax, r13d
	add	rsp, 32
	.cfi_def_cfa_offset 48
	mov	rdi, r12
	shr	eax, 3
	mov	DWORD PTR 8[r12], eax
	call	get_dynamic_sa_key_field@PLT
	mov	edx, r13d
	mov	rsi, r14
	mov	edi, eax
	call	crypto4xx_memcpy_to_le32@PLT
	mov	rdi, r12
	call	get_dynamic_sa_inner_digest@PLT
	mov	edx, r13d
	mov	rsi, r14
	mov	edi, eax
	call	crypto4xx_compute_gcm_hash_key_sw@PLT
	mov	r12d, eax
	test	eax, eax
	jne	.L10
	mov	eax, DWORD PTR 0[rbp]
	mov	rsi, QWORD PTR 16[rbp]
	mov	rdi, QWORD PTR 8[rbp]
	lea	edx, 0[0+rax*4]
	call	memcpy@PLT
	mov	edx, DWORD PTR DIR_OUTBOUND[rip]
	mov	rax, QWORD PTR 8[rbp]
	mov	DWORD PTR 4[rax], edx
	mov	edx, DWORD PTR SA_OPCODE_ENCRYPT_HASH[rip]
	mov	DWORD PTR [rax], edx
.L1:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	eax, r12d
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L4:
	.cfi_restore_state
	mov	rdi, rbp
	call	crypto4xx_free_sa@PLT
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L9:
	mov	esi, DWORD PTR CRYPTO_TFM_RES_BAD_KEY_LEN[rip]
	mov	rdi, r12
	call	crypto_aead_set_flags@PLT
	mov	r12d, DWORD PTR EINVAL[rip]
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	pop	rbp
	.cfi_def_cfa_offset 32
	neg	r12d
	mov	eax, r12d
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L10:
	.cfi_restore_state
	mov	esi, eax
	lea	rdi, .LC0[rip]
	call	pr_err@PLT
	mov	rdi, rbp
	call	crypto4xx_free_sa@PLT
	jmp	.L1
	.cfi_endproc
.LFE0:
	.size	crypto4xx_setkey_aes_gcm, .-crypto4xx_setkey_aes_gcm
	.comm	SA_SEQ_MASK_ON,4,4
	.comm	SA_SAVE_HASH,4,4
	.comm	SA_PAD_TYPE_ZERO,4,4
	.comm	SA_OP_GROUP_BASIC,4,4
	.comm	SA_OPCODE_HASH_DECRYPT,4,4
	.comm	SA_OPCODE_ENCRYPT_HASH,4,4
	.comm	SA_NO_HEADER_PROC,4,4
	.comm	SA_NOT_SAVE_IV,4,4
	.comm	SA_NOT_COPY_PAD,4,4
	.comm	SA_NOT_COPY_HDR,4,4
	.comm	SA_MC_DISABLE,4,4
	.comm	SA_LOAD_IV_FROM_STATE,4,4
	.comm	SA_LOAD_HASH_FROM_SA,4,4
	.comm	SA_HASH_MODE_HASH,4,4
	.comm	SA_HASH_ALG_GHASH,4,4
	.comm	SA_EXTENDED_SN_OFF,4,4
	.comm	SA_COPY_PAYLOAD,4,4
	.comm	SA_CIPHER_ALG_AES,4,4
	.comm	SA_AES_GCM_CONTENTS,4,4
	.comm	SA_AES128_GCM_LEN,8,8
	.comm	EINVAL,4,4
	.comm	DIR_OUTBOUND,4,4
	.comm	DIR_INBOUND,4,4
	.comm	CRYPTO_TFM_RES_BAD_KEY_LEN,4,4
	.comm	CRYPTO_MODE_CTR,4,4
	.comm	CRYPTO_FEEDBACK_MODE_NO_FB,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_crypto4xx_alg.c_crypto4xx_setkey_aes_gcm.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"GCM hash key setting failed = %d\012\000"
	.text
	.align	2
	.global	crypto4xx_setkey_aes_gcm
	.syntax unified
	.arm
	.fpu softvfp
	.type	crypto4xx_setkey_aes_gcm, %function
crypto4xx_setkey_aes_gcm:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	sub	sp, sp, #32
	mov	r6, r2
	mov	r5, r1
	mov	r4, r0
	bl	crypto_aead_tfm
	bl	crypto_tfm_ctx
	mov	r7, r0
	mov	r0, r6
	bl	crypto4xx_aes_gcm_validate_keylen
	cmp	r0, #0
	bne	.L12
	mov	r1, r4
	mov	r3, r6
	mov	r2, r5
	mov	r0, r7
	bl	crypto4xx_aead_setup_fallback
	subs	r4, r0, #0
	bne	.L1
	ldr	r3, [r7, #8]
	cmp	r3, #0
	bne	.L4
	ldr	r3, [r7, #4]
	cmp	r3, #0
	bne	.L4
.L5:
	ldr	r3, .L14
	sub	r1, r6, #16
	ldr	r3, [r3]
	mov	r0, r7
	add	r1, r3, r1, lsr #2
	bl	crypto4xx_alloc_sa
	subs	r4, r0, #0
	bne	.L1
	ldr	r3, .L14+4
	ldr	lr, .L14+8
	ldr	r3, [r3]
	ldr	r1, .L14+12
	ldr	ip, .L14+16
	ldr	r4, [r7, #8]
	ldr	ip, [ip]
	ldr	r8, [lr]
	orr	r3, r3, r6, lsl #2
	ldr	lr, [r1]
	ldr	r0, .L14+20
	ldr	r2, .L14+24
	ldr	r1, .L14+28
	str	r3, [r4, #12]
	ldr	r3, .L14+32
	ldr	r0, [r0]
	ldr	r2, [r2]
	ldr	r1, [r1]
	str	ip, [sp, #28]
	ldr	ip, [r3]
	ldr	r3, .L14+36
	str	r0, [sp, #24]
	ldr	r0, [r3]
	str	r2, [sp, #12]
	stm	sp, {r0, ip}
	str	r1, [sp, #8]
	ldr	r3, .L14+40
	ldr	r2, .L14+44
	ldr	r1, .L14+48
	str	lr, [sp, #16]
	str	r8, [sp, #20]
	mov	r0, r4
	ldr	r3, [r3]
	ldr	r2, [r2]
	ldr	r1, [r1]
	bl	set_dynamic_sa_command_0
	ldr	ip, .L14+52
	ldr	r0, .L14+56
	ldr	r3, .L14+60
	ldr	r2, .L14+64
	ldr	r1, .L14+68
	ldr	ip, [ip]
	ldr	r0, [r0]
	ldr	lr, .L14+72
	ldr	r3, [r3]
	ldr	r2, [r2]
	ldr	r1, [r1]
	ldr	lr, [lr]
	stm	sp, {r0, ip}
	str	r3, [sp, #16]
	str	r2, [sp, #12]
	str	r1, [sp, #8]
	ldr	r3, .L14+76
	ldr	r2, .L14+80
	ldr	r1, .L14+84
	str	lr, [sp, #20]
	ldr	r2, [r2]
	ldr	r1, [r1]
	mov	r0, r4
	ldr	r3, [r3]
	bl	set_dynamic_sa_command_1
	lsr	r3, r6, #3
	str	r3, [r4, #8]
	mov	r0, r4
	bl	get_dynamic_sa_key_field
	mov	r2, r6
	mov	r1, r5
	bl	crypto4xx_memcpy_to_le32
	mov	r0, r4
	bl	get_dynamic_sa_inner_digest
	mov	r2, r6
	mov	r1, r5
	bl	crypto4xx_compute_gcm_hash_key_sw
	subs	r4, r0, #0
	bne	.L13
	ldr	r2, [r7]
	ldr	r1, [r7, #8]
	lsl	r2, r2, #2
	ldr	r0, [r7, #4]
	bl	memcpy
	ldr	r1, .L14+88
	ldr	r2, .L14+92
	ldr	r3, [r7, #4]
	ldr	r1, [r1]
	ldr	r2, [r2]
	str	r1, [r3, #4]
	str	r2, [r3]
.L1:
	mov	r0, r4
	add	sp, sp, #32
	@ sp needed
	pop	{r4, r5, r6, r7, r8, pc}
.L4:
	mov	r0, r7
	bl	crypto4xx_free_sa
	b	.L5
.L12:
	ldr	r3, .L14+96
	mov	r0, r4
	ldr	r1, [r3]
	bl	crypto_aead_set_flags
	ldr	r3, .L14+100
	ldr	r4, [r3]
	rsb	r4, r4, #0
	mov	r0, r4
	add	sp, sp, #32
	@ sp needed
	pop	{r4, r5, r6, r7, r8, pc}
.L13:
	mov	r1, r4
	ldr	r0, .L14+104
	bl	pr_err
	mov	r0, r7
	bl	crypto4xx_free_sa
	b	.L1
.L15:
	.align	2
.L14:
	.word	SA_AES128_GCM_LEN
	.word	SA_AES_GCM_CONTENTS
	.word	SA_OP_GROUP_BASIC
	.word	SA_PAD_TYPE_ZERO
	.word	DIR_INBOUND
	.word	SA_OPCODE_HASH_DECRYPT
	.word	SA_CIPHER_ALG_AES
	.word	SA_HASH_ALG_GHASH
	.word	SA_NO_HEADER_PROC
	.word	SA_LOAD_IV_FROM_STATE
	.word	SA_LOAD_HASH_FROM_SA
	.word	SA_NOT_SAVE_IV
	.word	SA_SAVE_HASH
	.word	SA_SEQ_MASK_ON
	.word	SA_EXTENDED_SN_OFF
	.word	SA_COPY_PAYLOAD
	.word	SA_NOT_COPY_PAD
	.word	SA_MC_DISABLE
	.word	SA_NOT_COPY_HDR
	.word	CRYPTO_FEEDBACK_MODE_NO_FB
	.word	SA_HASH_MODE_HASH
	.word	CRYPTO_MODE_CTR
	.word	DIR_OUTBOUND
	.word	SA_OPCODE_ENCRYPT_HASH
	.word	CRYPTO_TFM_RES_BAD_KEY_LEN
	.word	EINVAL
	.word	.LC0
	.size	crypto4xx_setkey_aes_gcm, .-crypto4xx_setkey_aes_gcm
	.comm	SA_SEQ_MASK_ON,4,4
	.comm	SA_SAVE_HASH,4,4
	.comm	SA_PAD_TYPE_ZERO,4,4
	.comm	SA_OP_GROUP_BASIC,4,4
	.comm	SA_OPCODE_HASH_DECRYPT,4,4
	.comm	SA_OPCODE_ENCRYPT_HASH,4,4
	.comm	SA_NO_HEADER_PROC,4,4
	.comm	SA_NOT_SAVE_IV,4,4
	.comm	SA_NOT_COPY_PAD,4,4
	.comm	SA_NOT_COPY_HDR,4,4
	.comm	SA_MC_DISABLE,4,4
	.comm	SA_LOAD_IV_FROM_STATE,4,4
	.comm	SA_LOAD_HASH_FROM_SA,4,4
	.comm	SA_HASH_MODE_HASH,4,4
	.comm	SA_HASH_ALG_GHASH,4,4
	.comm	SA_EXTENDED_SN_OFF,4,4
	.comm	SA_COPY_PAYLOAD,4,4
	.comm	SA_CIPHER_ALG_AES,4,4
	.comm	SA_AES_GCM_CONTENTS,4,4
	.comm	SA_AES128_GCM_LEN,4,4
	.comm	EINVAL,4,4
	.comm	DIR_OUTBOUND,4,4
	.comm	DIR_INBOUND,4,4
	.comm	CRYPTO_TFM_RES_BAD_KEY_LEN,4,4
	.comm	CRYPTO_MODE_CTR,4,4
	.comm	CRYPTO_FEEDBACK_MODE_NO_FB,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
