	.file	"extr_wps_common.c_wps_derive_keys.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"WPS: Own DH private key not available"
	.align 8
.LC1:
	.string	"WPS: Peer DH public key not available"
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC2:
	.string	"WPS: DH Private Key"
.LC3:
	.string	"WPS: DH peer Public Key"
	.section	.rodata.str1.8
	.align 8
.LC4:
	.string	"WPS: Failed to derive DH shared key"
	.section	.rodata.str1.1
.LC5:
	.string	"WPS: DH shared key"
.LC6:
	.string	"WPS: DHKey"
.LC7:
	.string	"WPS: KDK"
	.section	.rodata.str1.8
	.align 8
.LC8:
	.string	"Wi-Fi Easy and Secure Key Derivation"
	.section	.rodata.str1.1
.LC9:
	.string	"WPS: AuthKey"
.LC10:
	.string	"WPS: KeyWrapKey"
.LC11:
	.string	"WPS: EMSK"
	.text
	.p2align 4
	.globl	wps_derive_keys
	.type	wps_derive_keys, @function
wps_derive_keys:
.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
	.cfi_offset 15, -24
	mov	r15, rdi
	push	r14
	push	r13
	push	r12
	push	rbx
	sub	rsp, 104
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -56[rbp], rax
	xor	eax, eax
	movsx	rax, DWORD PTR SHA256_MAC_LEN[rip]
	mov	rsi, rsp
	mov	rbx, rax
	lea	rax, 15[0+rax*4]
	mov	rcx, rax
	mov	rdx, rax
	and	rcx, -4096
	and	rdx, -16
	sub	rsi, rcx
	mov	rcx, rsi
	cmp	rsp, rcx
	je	.L3
.L28:
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	cmp	rsp, rcx
	jne	.L28
.L3:
	and	edx, 4095
	sub	rsp, rdx
	test	rdx, rdx
	jne	.L29
.L4:
	mov	rdx, rax
	mov	rcx, rsp
	and	rax, -4096
	mov	r13, rsp
	sub	rcx, rax
	and	rdx, -16
	mov	rax, rcx
	cmp	rsp, rax
	je	.L6
.L30:
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	cmp	rsp, rax
	jne	.L30
.L6:
	and	edx, 4095
	sub	rsp, rdx
	test	rdx, rdx
	jne	.L31
.L7:
	mov	eax, DWORD PTR WPS_KEYWRAPKEY_LEN[rip]
	add	eax, DWORD PTR WPS_AUTHKEY_LEN[rip]
	mov	rcx, rsp
	mov	QWORD PTR -136[rbp], rsp
	add	eax, DWORD PTR WPS_EMSK_LEN[rip]
	mov	DWORD PTR -140[rbp], eax
	cdqe
	lea	rax, 15[0+rax*4]
	mov	rdx, rax
	and	rax, -4096
	sub	rcx, rax
	and	rdx, -16
	mov	rax, rcx
	cmp	rsp, rax
	je	.L9
.L32:
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	cmp	rsp, rax
	jne	.L32
.L9:
	and	edx, 4095
	sub	rsp, rdx
	test	rdx, rdx
	je	.L10
	or	QWORD PTR -8[rsp+rdx], 0
.L10:
	mov	rdx, QWORD PTR 48[r15]
	mov	edi, DWORD PTR MSG_DEBUG[rip]
	mov	r12, rsp
	test	rdx, rdx
	je	.L33
	mov	r14, QWORD PTR 72[r15]
	cmp	QWORD PTR 80[r15], 0
	cmove	r14, QWORD PTR 64[r15]
	test	r14, r14
	je	.L34
	lea	rsi, .LC2[rip]
	call	wpa_hexdump_buf_key@PLT
	mov	edi, DWORD PTR MSG_DEBUG[rip]
	mov	rdx, r14
	lea	rsi, .LC3[rip]
	call	wpa_hexdump_buf@PLT
	mov	rdx, QWORD PTR 48[r15]
	mov	rdi, QWORD PTR 56[r15]
	mov	rsi, r14
	call	dh5_derive_shared@PLT
	mov	rdi, QWORD PTR 56[r15]
	mov	r14, rax
	call	dh5_free@PLT
	mov	QWORD PTR 56[r15], 0
	mov	rdi, r14
	mov	esi, 192
	call	wpabuf_zeropad@PLT
	mov	r14, rax
	test	rax, rax
	je	.L35
	mov	rdi, QWORD PTR 48[r15]
	sal	ebx, 2
	call	wpabuf_clear_free@PLT
	mov	QWORD PTR 48[r15], 0
	mov	rdx, r14
	mov	edi, DWORD PTR MSG_DEBUG[rip]
	lea	rsi, .LC5[rip]
	call	wpa_hexdump_buf_key@PLT
	mov	rdi, r14
	call	wpabuf_head@PLT
	mov	rdi, r14
	mov	QWORD PTR -112[rbp], rax
	call	wpabuf_len@PLT
	lea	r8, -80[rbp]
	lea	r11, -112[rbp]
	mov	rcx, r13
	mov	rdx, r8
	mov	rsi, r11
	mov	edi, 1
	mov	QWORD PTR -128[rbp], r8
	mov	QWORD PTR -120[rbp], r11
	mov	QWORD PTR -80[rbp], rax
	call	sha256_vector@PLT
	mov	edi, DWORD PTR MSG_DEBUG[rip]
	mov	ecx, ebx
	mov	rdx, r13
	lea	rsi, .LC6[rip]
	call	wpa_hexdump_key@PLT
	mov	rdi, r14
	call	wpabuf_clear_free@PLT
	mov	rdx, QWORD PTR 32[r15]
	mov	rax, QWORD PTR 40[r15]
	mov	esi, ebx
	mov	r11, QWORD PTR -120[rbp]
	mov	r14, QWORD PTR -136[rbp]
	mov	rdi, r13
	mov	QWORD PTR -104[rbp], rdx
	mov	rdx, QWORD PTR ETH_ALEN[rip]
	mov	r8, QWORD PTR -128[rbp]
	mov	QWORD PTR -112[rbp], rax
	mov	rcx, r11
	mov	r9, r14
	mov	QWORD PTR -72[rbp], rdx
	mov	rdx, QWORD PTR 24[r15]
	mov	rax, QWORD PTR WPS_NONCE_LEN[rip]
	mov	QWORD PTR -96[rbp], rdx
	mov	edx, 3
	mov	QWORD PTR -80[rbp], rax
	mov	QWORD PTR -64[rbp], rax
	call	hmac_sha256_vector@PLT
	mov	edi, DWORD PTR MSG_DEBUG[rip]
	mov	ecx, ebx
	mov	rdx, r14
	lea	rsi, .LC7[rip]
	call	wpa_hexdump_key@PLT
	mov	r9d, DWORD PTR -140[rbp]
	xor	edx, edx
	xor	esi, esi
	mov	r8, r12
	lea	rcx, .LC8[rip]
	mov	rdi, r14
	sal	r9d, 2
	call	wps_kdf@PLT
	mov	rdi, QWORD PTR 16[r15]
	mov	edx, DWORD PTR WPS_AUTHKEY_LEN[rip]
	mov	rsi, r12
	call	os_memcpy@PLT
	movsx	rax, DWORD PTR WPS_AUTHKEY_LEN[rip]
	mov	rdi, QWORD PTR 8[r15]
	mov	edx, DWORD PTR WPS_KEYWRAPKEY_LEN[rip]
	lea	rsi, [r12+rax*4]
	call	os_memcpy@PLT
	movsx	rdx, DWORD PTR WPS_KEYWRAPKEY_LEN[rip]
	movsx	rax, DWORD PTR WPS_AUTHKEY_LEN[rip]
	mov	rdi, QWORD PTR [r15]
	add	rax, rdx
	mov	edx, DWORD PTR WPS_EMSK_LEN[rip]
	lea	rsi, [r12+rax*4]
	call	os_memcpy@PLT
	mov	rdx, QWORD PTR 16[r15]
	mov	ecx, DWORD PTR WPS_AUTHKEY_LEN[rip]
	lea	rsi, .LC9[rip]
	mov	edi, DWORD PTR MSG_DEBUG[rip]
	call	wpa_hexdump_key@PLT
	mov	rdx, QWORD PTR 8[r15]
	mov	ecx, DWORD PTR WPS_KEYWRAPKEY_LEN[rip]
	lea	rsi, .LC10[rip]
	mov	edi, DWORD PTR MSG_DEBUG[rip]
	call	wpa_hexdump_key@PLT
	mov	ecx, DWORD PTR WPS_EMSK_LEN[rip]
	mov	rdx, QWORD PTR [r15]
	lea	rsi, .LC11[rip]
	mov	edi, DWORD PTR MSG_DEBUG[rip]
	call	wpa_hexdump_key@PLT
	xor	eax, eax
.L1:
	mov	rbx, QWORD PTR -56[rbp]
	xor	rbx, QWORD PTR fs:40
	jne	.L36
	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
	.p2align 4,,10
	.p2align 3
.L29:
	.cfi_restore_state
	or	QWORD PTR -8[rsp+rdx], 0
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L31:
	or	QWORD PTR -8[rsp+rdx], 0
	jmp	.L7
.L34:
	lea	rsi, .LC1[rip]
	call	wpa_printf@PLT
	mov	eax, -1
	jmp	.L1
.L35:
	mov	edi, DWORD PTR MSG_DEBUG[rip]
	lea	rsi, .LC4[rip]
	call	wpa_printf@PLT
	mov	eax, -1
	jmp	.L1
.L33:
	lea	rsi, .LC0[rip]
	call	wpa_printf@PLT
	mov	eax, -1
	jmp	.L1
.L36:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	wps_derive_keys, .-wps_derive_keys
	.comm	WPS_NONCE_LEN,8,8
	.comm	WPS_KEYWRAPKEY_LEN,4,4
	.comm	WPS_EMSK_LEN,4,4
	.comm	WPS_AUTHKEY_LEN,4,4
	.comm	SHA256_MAC_LEN,4,4
	.comm	MSG_DEBUG,4,4
	.comm	ETH_ALEN,8,8
	.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_wps_common.c_wps_derive_keys.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"WPS: Own DH private key not available\000"
	.align	2
.LC1:
	.ascii	"WPS: Peer DH public key not available\000"
	.align	2
.LC2:
	.ascii	"WPS: DH Private Key\000"
	.align	2
.LC3:
	.ascii	"WPS: DH peer Public Key\000"
	.align	2
.LC4:
	.ascii	"WPS: Failed to derive DH shared key\000"
	.align	2
.LC5:
	.ascii	"WPS: DH shared key\000"
	.align	2
.LC6:
	.ascii	"WPS: DHKey\000"
	.align	2
.LC7:
	.ascii	"WPS: KDK\000"
	.align	2
.LC8:
	.ascii	"Wi-Fi Easy and Secure Key Derivation\000"
	.align	2
.LC9:
	.ascii	"WPS: AuthKey\000"
	.align	2
.LC10:
	.ascii	"WPS: KeyWrapKey\000"
	.align	2
.LC11:
	.ascii	"WPS: EMSK\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC12:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	wps_derive_keys
	.syntax unified
	.arm
	.fpu softvfp
	.type	wps_derive_keys, %function
wps_derive_keys:
	@ args = 0, pretend = 0, frame = 56
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	add	fp, sp, #32
	sub	sp, sp, #68
	mov	r4, r0
	ldr	r3, .L14
	ldr	r8, .L14+4
	ldr	r10, .L14+8
	ldr	r2, .L14+12
	ldr	r0, [r3]
	ldr	r1, [r10]
	ldr	r3, [r8]
	ldr	r2, [r2]
	lsl	r9, r0, #2
	add	r3, r3, r1
	add	r3, r3, r2
	add	r1, r9, #7
	bic	r1, r1, #7
	lsl	r3, r3, #2
	sub	sp, sp, r1
	str	r3, [fp, #-80]
	add	r3, r3, #7
	add	r0, sp, #8
	bic	r3, r3, #7
	sub	sp, sp, r1
	add	r1, sp, #8
	ldr	r2, [r4, #24]
	sub	sp, sp, r3
	ldr	r3, .L14+16
	str	r0, [fp, #-72]
	ldr	r5, .L14+20
	str	r1, [fp, #-76]
	ldr	r3, [r3]
	str	r3, [fp, #-40]
	mov	r3,#0
	cmp	r2, #0
	add	r3, sp, #8
	ldr	r0, [r5]
	str	r3, [fp, #-84]
	beq	.L10
	ldr	r1, [r4, #40]
	ldr	r3, [r4, #32]
	cmp	r1, #0
	ldr	r6, [r4, #36]
	moveq	r6, r3
	cmp	r6, #0
	beq	.L11
	ldr	r1, .L14+24
	bl	wpa_hexdump_buf_key
	mov	r2, r6
	ldr	r1, .L14+28
	ldr	r0, [r5]
	bl	wpa_hexdump_buf
	mov	r1, r6
	ldr	r2, [r4, #24]
	ldr	r0, [r4, #28]
	bl	dh5_derive_shared
	mov	r6, #0
	mov	r7, r0
	ldr	r0, [r4, #28]
	bl	dh5_free
	mov	r0, r7
	mov	r1, #192
	str	r6, [r4, #28]
	bl	wpabuf_zeropad
	subs	r7, r0, #0
	beq	.L12
	ldr	r0, [r4, #24]
	bl	wpabuf_clear_free
	mov	r2, r7
	ldr	r1, .L14+32
	ldr	r0, [r5]
	str	r6, [r4, #24]
	bl	wpa_hexdump_buf_key
	mov	r0, r7
	bl	wpabuf_head
	mov	r3, r0
	mov	r0, r7
	str	r3, [fp, #-64]
	bl	wpabuf_len
	mov	ip, r0
	ldr	r3, [fp, #-72]
	sub	r2, fp, #52
	sub	r1, fp, #64
	mov	r0, #1
	str	ip, [fp, #-52]
	bl	sha256_vector
	mov	r3, r9
	ldr	r2, [fp, #-72]
	ldr	r1, .L14+36
	ldr	r0, [r5]
	bl	wpa_hexdump_key
	mov	r0, r7
	bl	wpabuf_clear_free
	ldr	r3, .L14+40
	ldr	r1, [r4, #12]
	ldr	r2, .L14+44
	ldr	lr, [r3]
	ldr	r3, [r4, #16]
	ldr	ip, [r2]
	str	r1, [fp, #-56]
	sub	r1, fp, #52
	ldr	r7, [r4, #20]
	str	r3, [fp, #-88]
	str	r1, [sp]
	ldr	r1, [fp, #-76]
	str	ip, [fp, #-52]
	str	ip, [fp, #-44]
	ldr	ip, [fp, #-88]
	mov	r2, #3
	sub	r3, fp, #64
	str	r1, [sp, #4]
	ldr	r0, [fp, #-72]
	mov	r1, r9
	str	lr, [fp, #-48]
	str	ip, [fp, #-60]
	str	r7, [fp, #-64]
	bl	hmac_sha256_vector
	mov	r3, r9
	ldr	r9, [fp, #-76]
	ldr	r1, .L14+48
	mov	r2, r9
	ldr	r0, [r5]
	bl	wpa_hexdump_key
	ldr	r7, [fp, #-84]
	ldr	r3, [fp, #-80]
	mov	r0, r9
	mov	r2, r6
	mov	r1, r6
	str	r3, [sp, #4]
	str	r7, [sp]
	ldr	r3, .L14+52
	bl	wps_kdf
	mov	r1, r7
	ldr	r2, [r8]
	ldr	r0, [r4, #8]
	bl	os_memcpy
	ldr	r1, [r8]
	ldr	r2, [r10]
	add	r1, r7, r1, lsl #2
	ldr	r0, [r4, #4]
	bl	os_memcpy
	ldr	r3, [r10]
	ldr	r1, [r8]
	ldr	r9, .L14+12
	add	r1, r1, r3
	ldr	r2, [r9]
	add	r1, r7, r1, lsl #2
	ldr	r0, [r4]
	bl	os_memcpy
	ldr	r3, [r8]
	ldr	r2, [r4, #8]
	ldr	r1, .L14+56
	ldr	r0, [r5]
	bl	wpa_hexdump_key
	ldr	r3, [r10]
	ldr	r2, [r4, #4]
	ldr	r1, .L14+60
	ldr	r0, [r5]
	bl	wpa_hexdump_key
	ldr	r3, [r9]
	ldr	r2, [r4]
	ldr	r0, [r5]
	ldr	r1, .L14+64
	bl	wpa_hexdump_key
	mov	r0, r6
.L1:
	ldr	r3, .L14+16
	ldr	r2, [r3]
	ldr	r3, [fp, #-40]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L13
	sub	sp, fp, #32
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L11:
	ldr	r1, .L14+68
	bl	wpa_printf
	mvn	r0, #0
	b	.L1
.L12:
	ldr	r0, [r5]
	ldr	r1, .L14+72
	bl	wpa_printf
	mvn	r0, #0
	b	.L1
.L10:
	ldr	r1, .L14+76
	bl	wpa_printf
	mvn	r0, #0
	b	.L1
.L13:
	bl	__stack_chk_fail
.L15:
	.align	2
.L14:
	.word	SHA256_MAC_LEN
	.word	WPS_AUTHKEY_LEN
	.word	WPS_KEYWRAPKEY_LEN
	.word	WPS_EMSK_LEN
	.word	.LC12
	.word	MSG_DEBUG
	.word	.LC2
	.word	.LC3
	.word	.LC5
	.word	.LC6
	.word	ETH_ALEN
	.word	WPS_NONCE_LEN
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.word	.LC10
	.word	.LC11
	.word	.LC1
	.word	.LC4
	.word	.LC0
	.size	wps_derive_keys, .-wps_derive_keys
	.comm	WPS_NONCE_LEN,4,4
	.comm	WPS_KEYWRAPKEY_LEN,4,4
	.comm	WPS_EMSK_LEN,4,4
	.comm	WPS_AUTHKEY_LEN,4,4
	.comm	SHA256_MAC_LEN,4,4
	.comm	MSG_DEBUG,4,4
	.comm	ETH_ALEN,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
