Path: blob/main/sys/crypto/openssl/aarch64/md5-aarch64.S
39507 views
/* Do not modify. This file is auto-generated from md5-aarch64.pl. */1#include "arm_arch.h"23.text4.globl ossl_md5_block_asm_data_order5.type ossl_md5_block_asm_data_order,@function6ossl_md5_block_asm_data_order:7AARCH64_VALID_CALL_TARGET8// Save all callee-saved registers9stp x19,x20,[sp,#-80]!10stp x21,x22,[sp,#16]11stp x23,x24,[sp,#32]12stp x25,x26,[sp,#48]13stp x27,x28,[sp,#64]1415ldp w10, w11, [x0, #0] // .Load MD5 state->A and state->B16ldp w12, w13, [x0, #8] // .Load MD5 state->C and state->D17.align 518ossl_md5_blocks_loop:19eor x17, x12, x13 // Begin aux function round 1 F(x,y,z)=(((y^z)&x)^z)20and x16, x17, x11 // Continue aux function round 1 F(x,y,z)=(((y^z)&x)^z)21ldp w15, w20, [x1] // .Load 2 words of input data0 M[0],M[1]22ldp w3, w21, [x1, #8] // .Load 2 words of input data0 M[2],M[3]23#ifdef __AARCH64EB__24rev w15, w1525rev w20, w2026rev w3, w327rev w21, w2128#endif29eor x14, x16, x13 // End aux function round 1 F(x,y,z)=(((y^z)&x)^z)30movz x9, #0xa478 // .Load lower half of constant 0xd76aa47831movk x9, #0xd76a, lsl #16 // .Load upper half of constant 0xd76aa47832add w8, w10, w15 // Add dest value33add w7, w8, w9 // Add constant 0xd76aa47834add w6, w7, w14 // Add aux function result35ror w6, w6, #25 // Rotate left s=7 bits36eor x5, x11, x12 // Begin aux function round 1 F(x,y,z)=(((y^z)&x)^z)37add w4, w11, w6 // Add X parameter round 1 A=FF(A, B, C, D, 0xd76aa478, s=7, M[0])38and x8, x5, x4 // Continue aux function round 1 F(x,y,z)=(((y^z)&x)^z)39eor x17, x8, x12 // End aux function round 1 F(x,y,z)=(((y^z)&x)^z)40movz x16, #0xb756 // .Load lower half of constant 0xe8c7b75641movk x16, #0xe8c7, lsl #16 // .Load upper half of constant 0xe8c7b75642add w9, w13, w20 // Add dest value43add w7, w9, w16 // Add constant 0xe8c7b75644add w14, w7, w17 // Add aux function result45ror w14, w14, #20 // Rotate left s=12 bits46eor x6, x4, x11 // Begin aux function round 1 F(x,y,z)=(((y^z)&x)^z)47add w5, w4, w14 // Add X parameter round 1 D=FF(D, A, B, C, 0xe8c7b756, s=12, M[1])48and x8, x6, x5 // Continue aux function round 1 F(x,y,z)=(((y^z)&x)^z)49eor x9, x8, x11 // End aux function round 1 F(x,y,z)=(((y^z)&x)^z)50movz x16, #0x70db // .Load lower half of constant 0x242070db51movk x16, #0x2420, lsl #16 // .Load upper half of constant 0x242070db52add w7, w12, w3 // Add dest value53add w17, w7, w16 // Add constant 0x242070db54add w14, w17, w9 // Add aux function result55ror w14, w14, #15 // Rotate left s=17 bits56eor x6, x5, x4 // Begin aux function round 1 F(x,y,z)=(((y^z)&x)^z)57add w8, w5, w14 // Add X parameter round 1 C=FF(C, D, A, B, 0x242070db, s=17, M[2])58and x7, x6, x8 // Continue aux function round 1 F(x,y,z)=(((y^z)&x)^z)59eor x16, x7, x4 // End aux function round 1 F(x,y,z)=(((y^z)&x)^z)60movz x9, #0xceee // .Load lower half of constant 0xc1bdceee61movk x9, #0xc1bd, lsl #16 // .Load upper half of constant 0xc1bdceee62add w14, w11, w21 // Add dest value63add w6, w14, w9 // Add constant 0xc1bdceee64add w7, w6, w16 // Add aux function result65ror w7, w7, #10 // Rotate left s=22 bits66eor x17, x8, x5 // Begin aux function round 1 F(x,y,z)=(((y^z)&x)^z)67add w9, w8, w7 // Add X parameter round 1 B=FF(B, C, D, A, 0xc1bdceee, s=22, M[3])68ldp w14, w22, [x1, #16] // .Load 2 words of input data0 M[4],M[5]69ldp w7, w23, [x1, #24] // .Load 2 words of input data0 M[6],M[7]70#ifdef __AARCH64EB__71rev w14, w1472rev w22, w2273rev w7, w774rev w23, w2375#endif76and x16, x17, x9 // Continue aux function round 1 F(x,y,z)=(((y^z)&x)^z)77eor x6, x16, x5 // End aux function round 1 F(x,y,z)=(((y^z)&x)^z)78movz x16, #0xfaf // .Load lower half of constant 0xf57c0faf79movk x16, #0xf57c, lsl #16 // .Load upper half of constant 0xf57c0faf80add w17, w4, w14 // Add dest value81add w16, w17, w16 // Add constant 0xf57c0faf82add w4, w16, w6 // Add aux function result83ror w4, w4, #25 // Rotate left s=7 bits84eor x16, x9, x8 // Begin aux function round 1 F(x,y,z)=(((y^z)&x)^z)85add w17, w9, w4 // Add X parameter round 1 A=FF(A, B, C, D, 0xf57c0faf, s=7, M[4])86and x16, x16, x17 // Continue aux function round 1 F(x,y,z)=(((y^z)&x)^z)87eor x6, x16, x8 // End aux function round 1 F(x,y,z)=(((y^z)&x)^z)88movz x4, #0xc62a // .Load lower half of constant 0x4787c62a89movk x4, #0x4787, lsl #16 // .Load upper half of constant 0x4787c62a90add w16, w5, w22 // Add dest value91add w16, w16, w4 // Add constant 0x4787c62a92add w5, w16, w6 // Add aux function result93ror w5, w5, #20 // Rotate left s=12 bits94eor x4, x17, x9 // Begin aux function round 1 F(x,y,z)=(((y^z)&x)^z)95add w19, w17, w5 // Add X parameter round 1 D=FF(D, A, B, C, 0x4787c62a, s=12, M[5])96and x6, x4, x19 // Continue aux function round 1 F(x,y,z)=(((y^z)&x)^z)97eor x5, x6, x9 // End aux function round 1 F(x,y,z)=(((y^z)&x)^z)98movz x4, #0x4613 // .Load lower half of constant 0xa830461399movk x4, #0xa830, lsl #16 // .Load upper half of constant 0xa8304613100add w6, w8, w7 // Add dest value101add w8, w6, w4 // Add constant 0xa8304613102add w4, w8, w5 // Add aux function result103ror w4, w4, #15 // Rotate left s=17 bits104eor x6, x19, x17 // Begin aux function round 1 F(x,y,z)=(((y^z)&x)^z)105add w8, w19, w4 // Add X parameter round 1 C=FF(C, D, A, B, 0xa8304613, s=17, M[6])106and x5, x6, x8 // Continue aux function round 1 F(x,y,z)=(((y^z)&x)^z)107eor x4, x5, x17 // End aux function round 1 F(x,y,z)=(((y^z)&x)^z)108movz x6, #0x9501 // .Load lower half of constant 0xfd469501109movk x6, #0xfd46, lsl #16 // .Load upper half of constant 0xfd469501110add w9, w9, w23 // Add dest value111add w5, w9, w6 // Add constant 0xfd469501112add w9, w5, w4 // Add aux function result113ror w9, w9, #10 // Rotate left s=22 bits114eor x6, x8, x19 // Begin aux function round 1 F(x,y,z)=(((y^z)&x)^z)115add w4, w8, w9 // Add X parameter round 1 B=FF(B, C, D, A, 0xfd469501, s=22, M[7])116ldp w5, w24, [x1, #32] // .Load 2 words of input data0 M[8],M[9]117ldp w16, w25, [x1, #40] // .Load 2 words of input data0 M[10],M[11]118#ifdef __AARCH64EB__119rev w5, w5120rev w24, w24121rev w16, w16122rev w25, w25123#endif124and x9, x6, x4 // Continue aux function round 1 F(x,y,z)=(((y^z)&x)^z)125eor x6, x9, x19 // End aux function round 1 F(x,y,z)=(((y^z)&x)^z)126movz x9, #0x98d8 // .Load lower half of constant 0x698098d8127movk x9, #0x6980, lsl #16 // .Load upper half of constant 0x698098d8128add w17, w17, w5 // Add dest value129add w9, w17, w9 // Add constant 0x698098d8130add w17, w9, w6 // Add aux function result131ror w17, w17, #25 // Rotate left s=7 bits132eor x9, x4, x8 // Begin aux function round 1 F(x,y,z)=(((y^z)&x)^z)133add w6, w4, w17 // Add X parameter round 1 A=FF(A, B, C, D, 0x698098d8, s=7, M[8])134and x17, x9, x6 // Continue aux function round 1 F(x,y,z)=(((y^z)&x)^z)135eor x9, x17, x8 // End aux function round 1 F(x,y,z)=(((y^z)&x)^z)136movz x17, #0xf7af // .Load lower half of constant 0x8b44f7af137movk x17, #0x8b44, lsl #16 // .Load upper half of constant 0x8b44f7af138add w19, w19, w24 // Add dest value139add w17, w19, w17 // Add constant 0x8b44f7af140add w19, w17, w9 // Add aux function result141ror w19, w19, #20 // Rotate left s=12 bits142eor x9, x6, x4 // Begin aux function round 1 F(x,y,z)=(((y^z)&x)^z)143add w17, w6, w19 // Add X parameter round 1 D=FF(D, A, B, C, 0x8b44f7af, s=12, M[9])144and x9, x9, x17 // Continue aux function round 1 F(x,y,z)=(((y^z)&x)^z)145eor x9, x9, x4 // End aux function round 1 F(x,y,z)=(((y^z)&x)^z)146movz x11, #0x5bb1 // .Load lower half of constant 0xffff5bb1147movk x11, #0xffff, lsl #16 // .Load upper half of constant 0xffff5bb1148add w8, w8, w16 // Add dest value149add w8, w8, w11 // Add constant 0xffff5bb1150add w8, w8, w9 // Add aux function result151ror w8, w8, #15 // Rotate left s=17 bits152eor x9, x17, x6 // Begin aux function round 1 F(x,y,z)=(((y^z)&x)^z)153add w8, w17, w8 // Add X parameter round 1 C=FF(C, D, A, B, 0xffff5bb1, s=17, M[10])154and x9, x9, x8 // Continue aux function round 1 F(x,y,z)=(((y^z)&x)^z)155eor x9, x9, x6 // End aux function round 1 F(x,y,z)=(((y^z)&x)^z)156movz x11, #0xd7be // .Load lower half of constant 0x895cd7be157movk x11, #0x895c, lsl #16 // .Load upper half of constant 0x895cd7be158add w4, w4, w25 // Add dest value159add w4, w4, w11 // Add constant 0x895cd7be160add w9, w4, w9 // Add aux function result161ror w9, w9, #10 // Rotate left s=22 bits162eor x4, x8, x17 // Begin aux function round 1 F(x,y,z)=(((y^z)&x)^z)163add w9, w8, w9 // Add X parameter round 1 B=FF(B, C, D, A, 0x895cd7be, s=22, M[11])164ldp w11, w26, [x1, #48] // .Load 2 words of input data0 M[12],M[13]165ldp w12, w27, [x1, #56] // .Load 2 words of input data0 M[14],M[15]166#ifdef __AARCH64EB__167rev w11, w11168rev w26, w26169rev w12, w12170rev w27, w27171#endif172and x4, x4, x9 // Continue aux function round 1 F(x,y,z)=(((y^z)&x)^z)173eor x4, x4, x17 // End aux function round 1 F(x,y,z)=(((y^z)&x)^z)174movz x19, #0x1122 // .Load lower half of constant 0x6b901122175movk x19, #0x6b90, lsl #16 // .Load upper half of constant 0x6b901122176add w6, w6, w11 // Add dest value177add w6, w6, w19 // Add constant 0x6b901122178add w4, w6, w4 // Add aux function result179ror w4, w4, #25 // Rotate left s=7 bits180eor x6, x9, x8 // Begin aux function round 1 F(x,y,z)=(((y^z)&x)^z)181add w4, w9, w4 // Add X parameter round 1 A=FF(A, B, C, D, 0x6b901122, s=7, M[12])182and x6, x6, x4 // Continue aux function round 1 F(x,y,z)=(((y^z)&x)^z)183eor x6, x6, x8 // End aux function round 1 F(x,y,z)=(((y^z)&x)^z)184movz x19, #0x7193 // .Load lower half of constant 0xfd987193185movk x19, #0xfd98, lsl #16 // .Load upper half of constant 0xfd987193186add w17, w17, w26 // Add dest value187add w17, w17, w19 // Add constant 0xfd987193188add w17, w17, w6 // Add aux function result189ror w17, w17, #20 // Rotate left s=12 bits190eor x6, x4, x9 // Begin aux function round 1 F(x,y,z)=(((y^z)&x)^z)191add w17, w4, w17 // Add X parameter round 1 D=FF(D, A, B, C, 0xfd987193, s=12, M[13])192and x6, x6, x17 // Continue aux function round 1 F(x,y,z)=(((y^z)&x)^z)193eor x6, x6, x9 // End aux function round 1 F(x,y,z)=(((y^z)&x)^z)194movz x13, #0x438e // .Load lower half of constant 0xa679438e195movk x13, #0xa679, lsl #16 // .Load upper half of constant 0xa679438e196add w8, w8, w12 // Add dest value197add w8, w8, w13 // Add constant 0xa679438e198add w8, w8, w6 // Add aux function result199ror w8, w8, #15 // Rotate left s=17 bits200eor x6, x17, x4 // Begin aux function round 1 F(x,y,z)=(((y^z)&x)^z)201add w8, w17, w8 // Add X parameter round 1 C=FF(C, D, A, B, 0xa679438e, s=17, M[14])202and x6, x6, x8 // Continue aux function round 1 F(x,y,z)=(((y^z)&x)^z)203eor x6, x6, x4 // End aux function round 1 F(x,y,z)=(((y^z)&x)^z)204movz x13, #0x821 // .Load lower half of constant 0x49b40821205movk x13, #0x49b4, lsl #16 // .Load upper half of constant 0x49b40821206add w9, w9, w27 // Add dest value207add w9, w9, w13 // Add constant 0x49b40821208add w9, w9, w6 // Add aux function result209ror w9, w9, #10 // Rotate left s=22 bits210bic x6, x8, x17 // Aux function round 2 (~z & y)211add w9, w8, w9 // Add X parameter round 1 B=FF(B, C, D, A, 0x49b40821, s=22, M[15])212movz x13, #0x2562 // .Load lower half of constant 0xf61e2562213movk x13, #0xf61e, lsl #16 // .Load upper half of constant 0xf61e2562214add w4, w4, w20 // Add dest value215add w4, w4, w13 // Add constant 0xf61e2562216and x13, x9, x17 // Aux function round 2 (x & z)217add w4, w4, w6 // Add (~z & y)218add w4, w4, w13 // Add (x & z)219ror w4, w4, #27 // Rotate left s=5 bits220bic x6, x9, x8 // Aux function round 2 (~z & y)221add w4, w9, w4 // Add X parameter round 2 A=GG(A, B, C, D, 0xf61e2562, s=5, M[1])222movz x13, #0xb340 // .Load lower half of constant 0xc040b340223movk x13, #0xc040, lsl #16 // .Load upper half of constant 0xc040b340224add w17, w17, w7 // Add dest value225add w17, w17, w13 // Add constant 0xc040b340226and x13, x4, x8 // Aux function round 2 (x & z)227add w17, w17, w6 // Add (~z & y)228add w17, w17, w13 // Add (x & z)229ror w17, w17, #23 // Rotate left s=9 bits230bic x6, x4, x9 // Aux function round 2 (~z & y)231add w17, w4, w17 // Add X parameter round 2 D=GG(D, A, B, C, 0xc040b340, s=9, M[6])232movz x13, #0x5a51 // .Load lower half of constant 0x265e5a51233movk x13, #0x265e, lsl #16 // .Load upper half of constant 0x265e5a51234add w8, w8, w25 // Add dest value235add w8, w8, w13 // Add constant 0x265e5a51236and x13, x17, x9 // Aux function round 2 (x & z)237add w8, w8, w6 // Add (~z & y)238add w8, w8, w13 // Add (x & z)239ror w8, w8, #18 // Rotate left s=14 bits240bic x6, x17, x4 // Aux function round 2 (~z & y)241add w8, w17, w8 // Add X parameter round 2 C=GG(C, D, A, B, 0x265e5a51, s=14, M[11])242movz x13, #0xc7aa // .Load lower half of constant 0xe9b6c7aa243movk x13, #0xe9b6, lsl #16 // .Load upper half of constant 0xe9b6c7aa244add w9, w9, w15 // Add dest value245add w9, w9, w13 // Add constant 0xe9b6c7aa246and x13, x8, x4 // Aux function round 2 (x & z)247add w9, w9, w6 // Add (~z & y)248add w9, w9, w13 // Add (x & z)249ror w9, w9, #12 // Rotate left s=20 bits250bic x6, x8, x17 // Aux function round 2 (~z & y)251add w9, w8, w9 // Add X parameter round 2 B=GG(B, C, D, A, 0xe9b6c7aa, s=20, M[0])252movz x13, #0x105d // .Load lower half of constant 0xd62f105d253movk x13, #0xd62f, lsl #16 // .Load upper half of constant 0xd62f105d254add w4, w4, w22 // Add dest value255add w4, w4, w13 // Add constant 0xd62f105d256and x13, x9, x17 // Aux function round 2 (x & z)257add w4, w4, w6 // Add (~z & y)258add w4, w4, w13 // Add (x & z)259ror w4, w4, #27 // Rotate left s=5 bits260bic x6, x9, x8 // Aux function round 2 (~z & y)261add w4, w9, w4 // Add X parameter round 2 A=GG(A, B, C, D, 0xd62f105d, s=5, M[5])262movz x13, #0x1453 // .Load lower half of constant 0x2441453263movk x13, #0x244, lsl #16 // .Load upper half of constant 0x2441453264add w17, w17, w16 // Add dest value265add w17, w17, w13 // Add constant 0x2441453266and x13, x4, x8 // Aux function round 2 (x & z)267add w17, w17, w6 // Add (~z & y)268add w17, w17, w13 // Add (x & z)269ror w17, w17, #23 // Rotate left s=9 bits270bic x6, x4, x9 // Aux function round 2 (~z & y)271add w17, w4, w17 // Add X parameter round 2 D=GG(D, A, B, C, 0x2441453, s=9, M[10])272movz x13, #0xe681 // .Load lower half of constant 0xd8a1e681273movk x13, #0xd8a1, lsl #16 // .Load upper half of constant 0xd8a1e681274add w8, w8, w27 // Add dest value275add w8, w8, w13 // Add constant 0xd8a1e681276and x13, x17, x9 // Aux function round 2 (x & z)277add w8, w8, w6 // Add (~z & y)278add w8, w8, w13 // Add (x & z)279ror w8, w8, #18 // Rotate left s=14 bits280bic x6, x17, x4 // Aux function round 2 (~z & y)281add w8, w17, w8 // Add X parameter round 2 C=GG(C, D, A, B, 0xd8a1e681, s=14, M[15])282movz x13, #0xfbc8 // .Load lower half of constant 0xe7d3fbc8283movk x13, #0xe7d3, lsl #16 // .Load upper half of constant 0xe7d3fbc8284add w9, w9, w14 // Add dest value285add w9, w9, w13 // Add constant 0xe7d3fbc8286and x13, x8, x4 // Aux function round 2 (x & z)287add w9, w9, w6 // Add (~z & y)288add w9, w9, w13 // Add (x & z)289ror w9, w9, #12 // Rotate left s=20 bits290bic x6, x8, x17 // Aux function round 2 (~z & y)291add w9, w8, w9 // Add X parameter round 2 B=GG(B, C, D, A, 0xe7d3fbc8, s=20, M[4])292movz x13, #0xcde6 // .Load lower half of constant 0x21e1cde6293movk x13, #0x21e1, lsl #16 // .Load upper half of constant 0x21e1cde6294add w4, w4, w24 // Add dest value295add w4, w4, w13 // Add constant 0x21e1cde6296and x13, x9, x17 // Aux function round 2 (x & z)297add w4, w4, w6 // Add (~z & y)298add w4, w4, w13 // Add (x & z)299ror w4, w4, #27 // Rotate left s=5 bits300bic x6, x9, x8 // Aux function round 2 (~z & y)301add w4, w9, w4 // Add X parameter round 2 A=GG(A, B, C, D, 0x21e1cde6, s=5, M[9])302movz x13, #0x7d6 // .Load lower half of constant 0xc33707d6303movk x13, #0xc337, lsl #16 // .Load upper half of constant 0xc33707d6304add w17, w17, w12 // Add dest value305add w17, w17, w13 // Add constant 0xc33707d6306and x13, x4, x8 // Aux function round 2 (x & z)307add w17, w17, w6 // Add (~z & y)308add w17, w17, w13 // Add (x & z)309ror w17, w17, #23 // Rotate left s=9 bits310bic x6, x4, x9 // Aux function round 2 (~z & y)311add w17, w4, w17 // Add X parameter round 2 D=GG(D, A, B, C, 0xc33707d6, s=9, M[14])312movz x13, #0xd87 // .Load lower half of constant 0xf4d50d87313movk x13, #0xf4d5, lsl #16 // .Load upper half of constant 0xf4d50d87314add w8, w8, w21 // Add dest value315add w8, w8, w13 // Add constant 0xf4d50d87316and x13, x17, x9 // Aux function round 2 (x & z)317add w8, w8, w6 // Add (~z & y)318add w8, w8, w13 // Add (x & z)319ror w8, w8, #18 // Rotate left s=14 bits320bic x6, x17, x4 // Aux function round 2 (~z & y)321add w8, w17, w8 // Add X parameter round 2 C=GG(C, D, A, B, 0xf4d50d87, s=14, M[3])322movz x13, #0x14ed // .Load lower half of constant 0x455a14ed323movk x13, #0x455a, lsl #16 // .Load upper half of constant 0x455a14ed324add w9, w9, w5 // Add dest value325add w9, w9, w13 // Add constant 0x455a14ed326and x13, x8, x4 // Aux function round 2 (x & z)327add w9, w9, w6 // Add (~z & y)328add w9, w9, w13 // Add (x & z)329ror w9, w9, #12 // Rotate left s=20 bits330bic x6, x8, x17 // Aux function round 2 (~z & y)331add w9, w8, w9 // Add X parameter round 2 B=GG(B, C, D, A, 0x455a14ed, s=20, M[8])332movz x13, #0xe905 // .Load lower half of constant 0xa9e3e905333movk x13, #0xa9e3, lsl #16 // .Load upper half of constant 0xa9e3e905334add w4, w4, w26 // Add dest value335add w4, w4, w13 // Add constant 0xa9e3e905336and x13, x9, x17 // Aux function round 2 (x & z)337add w4, w4, w6 // Add (~z & y)338add w4, w4, w13 // Add (x & z)339ror w4, w4, #27 // Rotate left s=5 bits340bic x6, x9, x8 // Aux function round 2 (~z & y)341add w4, w9, w4 // Add X parameter round 2 A=GG(A, B, C, D, 0xa9e3e905, s=5, M[13])342movz x13, #0xa3f8 // .Load lower half of constant 0xfcefa3f8343movk x13, #0xfcef, lsl #16 // .Load upper half of constant 0xfcefa3f8344add w17, w17, w3 // Add dest value345add w17, w17, w13 // Add constant 0xfcefa3f8346and x13, x4, x8 // Aux function round 2 (x & z)347add w17, w17, w6 // Add (~z & y)348add w17, w17, w13 // Add (x & z)349ror w17, w17, #23 // Rotate left s=9 bits350bic x6, x4, x9 // Aux function round 2 (~z & y)351add w17, w4, w17 // Add X parameter round 2 D=GG(D, A, B, C, 0xfcefa3f8, s=9, M[2])352movz x13, #0x2d9 // .Load lower half of constant 0x676f02d9353movk x13, #0x676f, lsl #16 // .Load upper half of constant 0x676f02d9354add w8, w8, w23 // Add dest value355add w8, w8, w13 // Add constant 0x676f02d9356and x13, x17, x9 // Aux function round 2 (x & z)357add w8, w8, w6 // Add (~z & y)358add w8, w8, w13 // Add (x & z)359ror w8, w8, #18 // Rotate left s=14 bits360bic x6, x17, x4 // Aux function round 2 (~z & y)361add w8, w17, w8 // Add X parameter round 2 C=GG(C, D, A, B, 0x676f02d9, s=14, M[7])362movz x13, #0x4c8a // .Load lower half of constant 0x8d2a4c8a363movk x13, #0x8d2a, lsl #16 // .Load upper half of constant 0x8d2a4c8a364add w9, w9, w11 // Add dest value365add w9, w9, w13 // Add constant 0x8d2a4c8a366and x13, x8, x4 // Aux function round 2 (x & z)367add w9, w9, w6 // Add (~z & y)368add w9, w9, w13 // Add (x & z)369eor x6, x8, x17 // Begin aux function round 3 H(x,y,z)=(x^y^z)370ror w9, w9, #12 // Rotate left s=20 bits371movz x10, #0x3942 // .Load lower half of constant 0xfffa3942372add w9, w8, w9 // Add X parameter round 2 B=GG(B, C, D, A, 0x8d2a4c8a, s=20, M[12])373movk x10, #0xfffa, lsl #16 // .Load upper half of constant 0xfffa3942374add w4, w4, w22 // Add dest value375eor x6, x6, x9 // End aux function round 3 H(x,y,z)=(x^y^z)376add w4, w4, w10 // Add constant 0xfffa3942377add w4, w4, w6 // Add aux function result378ror w4, w4, #28 // Rotate left s=4 bits379eor x6, x9, x8 // Begin aux function round 3 H(x,y,z)=(x^y^z)380movz x10, #0xf681 // .Load lower half of constant 0x8771f681381add w4, w9, w4 // Add X parameter round 3 A=HH(A, B, C, D, 0xfffa3942, s=4, M[5])382movk x10, #0x8771, lsl #16 // .Load upper half of constant 0x8771f681383add w17, w17, w5 // Add dest value384eor x6, x6, x4 // End aux function round 3 H(x,y,z)=(x^y^z)385add w17, w17, w10 // Add constant 0x8771f681386add w17, w17, w6 // Add aux function result387eor x6, x4, x9 // Begin aux function round 3 H(x,y,z)=(x^y^z)388ror w17, w17, #21 // Rotate left s=11 bits389movz x13, #0x6122 // .Load lower half of constant 0x6d9d6122390add w17, w4, w17 // Add X parameter round 3 D=HH(D, A, B, C, 0x8771f681, s=11, M[8])391movk x13, #0x6d9d, lsl #16 // .Load upper half of constant 0x6d9d6122392add w8, w8, w25 // Add dest value393eor x6, x6, x17 // End aux function round 3 H(x,y,z)=(x^y^z)394add w8, w8, w13 // Add constant 0x6d9d6122395add w8, w8, w6 // Add aux function result396ror w8, w8, #16 // Rotate left s=16 bits397eor x6, x17, x4 // Begin aux function round 3 H(x,y,z)=(x^y^z)398movz x13, #0x380c // .Load lower half of constant 0xfde5380c399add w8, w17, w8 // Add X parameter round 3 C=HH(C, D, A, B, 0x6d9d6122, s=16, M[11])400movk x13, #0xfde5, lsl #16 // .Load upper half of constant 0xfde5380c401add w9, w9, w12 // Add dest value402eor x6, x6, x8 // End aux function round 3 H(x,y,z)=(x^y^z)403add w9, w9, w13 // Add constant 0xfde5380c404add w9, w9, w6 // Add aux function result405eor x6, x8, x17 // Begin aux function round 3 H(x,y,z)=(x^y^z)406ror w9, w9, #9 // Rotate left s=23 bits407movz x10, #0xea44 // .Load lower half of constant 0xa4beea44408add w9, w8, w9 // Add X parameter round 3 B=HH(B, C, D, A, 0xfde5380c, s=23, M[14])409movk x10, #0xa4be, lsl #16 // .Load upper half of constant 0xa4beea44410add w4, w4, w20 // Add dest value411eor x6, x6, x9 // End aux function round 3 H(x,y,z)=(x^y^z)412add w4, w4, w10 // Add constant 0xa4beea44413add w4, w4, w6 // Add aux function result414ror w4, w4, #28 // Rotate left s=4 bits415eor x6, x9, x8 // Begin aux function round 3 H(x,y,z)=(x^y^z)416movz x10, #0xcfa9 // .Load lower half of constant 0x4bdecfa9417add w4, w9, w4 // Add X parameter round 3 A=HH(A, B, C, D, 0xa4beea44, s=4, M[1])418movk x10, #0x4bde, lsl #16 // .Load upper half of constant 0x4bdecfa9419add w17, w17, w14 // Add dest value420eor x6, x6, x4 // End aux function round 3 H(x,y,z)=(x^y^z)421add w17, w17, w10 // Add constant 0x4bdecfa9422add w17, w17, w6 // Add aux function result423eor x6, x4, x9 // Begin aux function round 3 H(x,y,z)=(x^y^z)424ror w17, w17, #21 // Rotate left s=11 bits425movz x13, #0x4b60 // .Load lower half of constant 0xf6bb4b60426add w17, w4, w17 // Add X parameter round 3 D=HH(D, A, B, C, 0x4bdecfa9, s=11, M[4])427movk x13, #0xf6bb, lsl #16 // .Load upper half of constant 0xf6bb4b60428add w8, w8, w23 // Add dest value429eor x6, x6, x17 // End aux function round 3 H(x,y,z)=(x^y^z)430add w8, w8, w13 // Add constant 0xf6bb4b60431add w8, w8, w6 // Add aux function result432ror w8, w8, #16 // Rotate left s=16 bits433eor x6, x17, x4 // Begin aux function round 3 H(x,y,z)=(x^y^z)434movz x13, #0xbc70 // .Load lower half of constant 0xbebfbc70435add w8, w17, w8 // Add X parameter round 3 C=HH(C, D, A, B, 0xf6bb4b60, s=16, M[7])436movk x13, #0xbebf, lsl #16 // .Load upper half of constant 0xbebfbc70437add w9, w9, w16 // Add dest value438eor x6, x6, x8 // End aux function round 3 H(x,y,z)=(x^y^z)439add w9, w9, w13 // Add constant 0xbebfbc70440add w9, w9, w6 // Add aux function result441eor x6, x8, x17 // Begin aux function round 3 H(x,y,z)=(x^y^z)442ror w9, w9, #9 // Rotate left s=23 bits443movz x10, #0x7ec6 // .Load lower half of constant 0x289b7ec6444add w9, w8, w9 // Add X parameter round 3 B=HH(B, C, D, A, 0xbebfbc70, s=23, M[10])445movk x10, #0x289b, lsl #16 // .Load upper half of constant 0x289b7ec6446add w4, w4, w26 // Add dest value447eor x6, x6, x9 // End aux function round 3 H(x,y,z)=(x^y^z)448add w4, w4, w10 // Add constant 0x289b7ec6449add w4, w4, w6 // Add aux function result450ror w4, w4, #28 // Rotate left s=4 bits451eor x6, x9, x8 // Begin aux function round 3 H(x,y,z)=(x^y^z)452movz x10, #0x27fa // .Load lower half of constant 0xeaa127fa453add w4, w9, w4 // Add X parameter round 3 A=HH(A, B, C, D, 0x289b7ec6, s=4, M[13])454movk x10, #0xeaa1, lsl #16 // .Load upper half of constant 0xeaa127fa455add w17, w17, w15 // Add dest value456eor x6, x6, x4 // End aux function round 3 H(x,y,z)=(x^y^z)457add w17, w17, w10 // Add constant 0xeaa127fa458add w17, w17, w6 // Add aux function result459eor x6, x4, x9 // Begin aux function round 3 H(x,y,z)=(x^y^z)460ror w17, w17, #21 // Rotate left s=11 bits461movz x13, #0x3085 // .Load lower half of constant 0xd4ef3085462add w17, w4, w17 // Add X parameter round 3 D=HH(D, A, B, C, 0xeaa127fa, s=11, M[0])463movk x13, #0xd4ef, lsl #16 // .Load upper half of constant 0xd4ef3085464add w8, w8, w21 // Add dest value465eor x6, x6, x17 // End aux function round 3 H(x,y,z)=(x^y^z)466add w8, w8, w13 // Add constant 0xd4ef3085467add w8, w8, w6 // Add aux function result468ror w8, w8, #16 // Rotate left s=16 bits469eor x6, x17, x4 // Begin aux function round 3 H(x,y,z)=(x^y^z)470movz x13, #0x1d05 // .Load lower half of constant 0x4881d05471add w8, w17, w8 // Add X parameter round 3 C=HH(C, D, A, B, 0xd4ef3085, s=16, M[3])472movk x13, #0x488, lsl #16 // .Load upper half of constant 0x4881d05473add w9, w9, w7 // Add dest value474eor x6, x6, x8 // End aux function round 3 H(x,y,z)=(x^y^z)475add w9, w9, w13 // Add constant 0x4881d05476add w9, w9, w6 // Add aux function result477eor x6, x8, x17 // Begin aux function round 3 H(x,y,z)=(x^y^z)478ror w9, w9, #9 // Rotate left s=23 bits479movz x10, #0xd039 // .Load lower half of constant 0xd9d4d039480add w9, w8, w9 // Add X parameter round 3 B=HH(B, C, D, A, 0x4881d05, s=23, M[6])481movk x10, #0xd9d4, lsl #16 // .Load upper half of constant 0xd9d4d039482add w4, w4, w24 // Add dest value483eor x6, x6, x9 // End aux function round 3 H(x,y,z)=(x^y^z)484add w4, w4, w10 // Add constant 0xd9d4d039485add w4, w4, w6 // Add aux function result486ror w4, w4, #28 // Rotate left s=4 bits487eor x6, x9, x8 // Begin aux function round 3 H(x,y,z)=(x^y^z)488movz x10, #0x99e5 // .Load lower half of constant 0xe6db99e5489add w4, w9, w4 // Add X parameter round 3 A=HH(A, B, C, D, 0xd9d4d039, s=4, M[9])490movk x10, #0xe6db, lsl #16 // .Load upper half of constant 0xe6db99e5491add w17, w17, w11 // Add dest value492eor x6, x6, x4 // End aux function round 3 H(x,y,z)=(x^y^z)493add w17, w17, w10 // Add constant 0xe6db99e5494add w17, w17, w6 // Add aux function result495eor x6, x4, x9 // Begin aux function round 3 H(x,y,z)=(x^y^z)496ror w17, w17, #21 // Rotate left s=11 bits497movz x13, #0x7cf8 // .Load lower half of constant 0x1fa27cf8498add w17, w4, w17 // Add X parameter round 3 D=HH(D, A, B, C, 0xe6db99e5, s=11, M[12])499movk x13, #0x1fa2, lsl #16 // .Load upper half of constant 0x1fa27cf8500add w8, w8, w27 // Add dest value501eor x6, x6, x17 // End aux function round 3 H(x,y,z)=(x^y^z)502add w8, w8, w13 // Add constant 0x1fa27cf8503add w8, w8, w6 // Add aux function result504ror w8, w8, #16 // Rotate left s=16 bits505eor x6, x17, x4 // Begin aux function round 3 H(x,y,z)=(x^y^z)506movz x13, #0x5665 // .Load lower half of constant 0xc4ac5665507add w8, w17, w8 // Add X parameter round 3 C=HH(C, D, A, B, 0x1fa27cf8, s=16, M[15])508movk x13, #0xc4ac, lsl #16 // .Load upper half of constant 0xc4ac5665509add w9, w9, w3 // Add dest value510eor x6, x6, x8 // End aux function round 3 H(x,y,z)=(x^y^z)511add w9, w9, w13 // Add constant 0xc4ac5665512add w9, w9, w6 // Add aux function result513ror w9, w9, #9 // Rotate left s=23 bits514movz x6, #0x2244 // .Load lower half of constant 0xf4292244515movk x6, #0xf429, lsl #16 // .Load upper half of constant 0xf4292244516add w9, w8, w9 // Add X parameter round 3 B=HH(B, C, D, A, 0xc4ac5665, s=23, M[2])517add w4, w4, w15 // Add dest value518orn x13, x9, x17 // Begin aux function round 4 I(x,y,z)=((~z|x)^y)519add w4, w4, w6 // Add constant 0xf4292244520eor x6, x8, x13 // End aux function round 4 I(x,y,z)=((~z|x)^y)521add w4, w4, w6 // Add aux function result522ror w4, w4, #26 // Rotate left s=6 bits523movz x6, #0xff97 // .Load lower half of constant 0x432aff97524movk x6, #0x432a, lsl #16 // .Load upper half of constant 0x432aff97525add w4, w9, w4 // Add X parameter round 4 A=II(A, B, C, D, 0xf4292244, s=6, M[0])526orn x10, x4, x8 // Begin aux function round 4 I(x,y,z)=((~z|x)^y)527add w17, w17, w23 // Add dest value528eor x10, x9, x10 // End aux function round 4 I(x,y,z)=((~z|x)^y)529add w17, w17, w6 // Add constant 0x432aff97530add w6, w17, w10 // Add aux function result531ror w6, w6, #22 // Rotate left s=10 bits532movz x17, #0x23a7 // .Load lower half of constant 0xab9423a7533movk x17, #0xab94, lsl #16 // .Load upper half of constant 0xab9423a7534add w6, w4, w6 // Add X parameter round 4 D=II(D, A, B, C, 0x432aff97, s=10, M[7])535add w8, w8, w12 // Add dest value536orn x10, x6, x9 // Begin aux function round 4 I(x,y,z)=((~z|x)^y)537add w8, w8, w17 // Add constant 0xab9423a7538eor x17, x4, x10 // End aux function round 4 I(x,y,z)=((~z|x)^y)539add w8, w8, w17 // Add aux function result540ror w8, w8, #17 // Rotate left s=15 bits541movz x17, #0xa039 // .Load lower half of constant 0xfc93a039542movk x17, #0xfc93, lsl #16 // .Load upper half of constant 0xfc93a039543add w8, w6, w8 // Add X parameter round 4 C=II(C, D, A, B, 0xab9423a7, s=15, M[14])544orn x13, x8, x4 // Begin aux function round 4 I(x,y,z)=((~z|x)^y)545add w9, w9, w22 // Add dest value546eor x13, x6, x13 // End aux function round 4 I(x,y,z)=((~z|x)^y)547add w9, w9, w17 // Add constant 0xfc93a039548add w17, w9, w13 // Add aux function result549ror w17, w17, #11 // Rotate left s=21 bits550movz x9, #0x59c3 // .Load lower half of constant 0x655b59c3551movk x9, #0x655b, lsl #16 // .Load upper half of constant 0x655b59c3552add w17, w8, w17 // Add X parameter round 4 B=II(B, C, D, A, 0xfc93a039, s=21, M[5])553add w4, w4, w11 // Add dest value554orn x13, x17, x6 // Begin aux function round 4 I(x,y,z)=((~z|x)^y)555add w9, w4, w9 // Add constant 0x655b59c3556eor x4, x8, x13 // End aux function round 4 I(x,y,z)=((~z|x)^y)557add w9, w9, w4 // Add aux function result558ror w9, w9, #26 // Rotate left s=6 bits559movz x4, #0xcc92 // .Load lower half of constant 0x8f0ccc92560movk x4, #0x8f0c, lsl #16 // .Load upper half of constant 0x8f0ccc92561add w9, w17, w9 // Add X parameter round 4 A=II(A, B, C, D, 0x655b59c3, s=6, M[12])562orn x10, x9, x8 // Begin aux function round 4 I(x,y,z)=((~z|x)^y)563add w6, w6, w21 // Add dest value564eor x10, x17, x10 // End aux function round 4 I(x,y,z)=((~z|x)^y)565add w4, w6, w4 // Add constant 0x8f0ccc92566add w6, w4, w10 // Add aux function result567ror w6, w6, #22 // Rotate left s=10 bits568movz x4, #0xf47d // .Load lower half of constant 0xffeff47d569movk x4, #0xffef, lsl #16 // .Load upper half of constant 0xffeff47d570add w6, w9, w6 // Add X parameter round 4 D=II(D, A, B, C, 0x8f0ccc92, s=10, M[3])571add w8, w8, w16 // Add dest value572orn x10, x6, x17 // Begin aux function round 4 I(x,y,z)=((~z|x)^y)573add w8, w8, w4 // Add constant 0xffeff47d574eor x4, x9, x10 // End aux function round 4 I(x,y,z)=((~z|x)^y)575add w8, w8, w4 // Add aux function result576ror w8, w8, #17 // Rotate left s=15 bits577movz x4, #0x5dd1 // .Load lower half of constant 0x85845dd1578movk x4, #0x8584, lsl #16 // .Load upper half of constant 0x85845dd1579add w8, w6, w8 // Add X parameter round 4 C=II(C, D, A, B, 0xffeff47d, s=15, M[10])580orn x10, x8, x9 // Begin aux function round 4 I(x,y,z)=((~z|x)^y)581add w15, w17, w20 // Add dest value582eor x17, x6, x10 // End aux function round 4 I(x,y,z)=((~z|x)^y)583add w15, w15, w4 // Add constant 0x85845dd1584add w4, w15, w17 // Add aux function result585ror w4, w4, #11 // Rotate left s=21 bits586movz x15, #0x7e4f // .Load lower half of constant 0x6fa87e4f587movk x15, #0x6fa8, lsl #16 // .Load upper half of constant 0x6fa87e4f588add w17, w8, w4 // Add X parameter round 4 B=II(B, C, D, A, 0x85845dd1, s=21, M[1])589add w4, w9, w5 // Add dest value590orn x9, x17, x6 // Begin aux function round 4 I(x,y,z)=((~z|x)^y)591add w15, w4, w15 // Add constant 0x6fa87e4f592eor x4, x8, x9 // End aux function round 4 I(x,y,z)=((~z|x)^y)593add w9, w15, w4 // Add aux function result594ror w9, w9, #26 // Rotate left s=6 bits595movz x15, #0xe6e0 // .Load lower half of constant 0xfe2ce6e0596movk x15, #0xfe2c, lsl #16 // .Load upper half of constant 0xfe2ce6e0597add w4, w17, w9 // Add X parameter round 4 A=II(A, B, C, D, 0x6fa87e4f, s=6, M[8])598orn x9, x4, x8 // Begin aux function round 4 I(x,y,z)=((~z|x)^y)599add w6, w6, w27 // Add dest value600eor x9, x17, x9 // End aux function round 4 I(x,y,z)=((~z|x)^y)601add w15, w6, w15 // Add constant 0xfe2ce6e0602add w6, w15, w9 // Add aux function result603ror w6, w6, #22 // Rotate left s=10 bits604movz x9, #0x4314 // .Load lower half of constant 0xa3014314605movk x9, #0xa301, lsl #16 // .Load upper half of constant 0xa3014314606add w15, w4, w6 // Add X parameter round 4 D=II(D, A, B, C, 0xfe2ce6e0, s=10, M[15])607add w6, w8, w7 // Add dest value608orn x7, x15, x17 // Begin aux function round 4 I(x,y,z)=((~z|x)^y)609add w8, w6, w9 // Add constant 0xa3014314610eor x9, x4, x7 // End aux function round 4 I(x,y,z)=((~z|x)^y)611add w6, w8, w9 // Add aux function result612ror w6, w6, #17 // Rotate left s=15 bits613movz x7, #0x11a1 // .Load lower half of constant 0x4e0811a1614movk x7, #0x4e08, lsl #16 // .Load upper half of constant 0x4e0811a1615add w8, w15, w6 // Add X parameter round 4 C=II(C, D, A, B, 0xa3014314, s=15, M[6])616orn x9, x8, x4 // Begin aux function round 4 I(x,y,z)=((~z|x)^y)617add w6, w17, w26 // Add dest value618eor x17, x15, x9 // End aux function round 4 I(x,y,z)=((~z|x)^y)619add w9, w6, w7 // Add constant 0x4e0811a1620add w7, w9, w17 // Add aux function result621ror w7, w7, #11 // Rotate left s=21 bits622movz x6, #0x7e82 // .Load lower half of constant 0xf7537e82623movk x6, #0xf753, lsl #16 // .Load upper half of constant 0xf7537e82624add w9, w8, w7 // Add X parameter round 4 B=II(B, C, D, A, 0x4e0811a1, s=21, M[13])625add w17, w4, w14 // Add dest value626orn x7, x9, x15 // Begin aux function round 4 I(x,y,z)=((~z|x)^y)627add w14, w17, w6 // Add constant 0xf7537e82628eor x4, x8, x7 // End aux function round 4 I(x,y,z)=((~z|x)^y)629add w17, w14, w4 // Add aux function result630ror w17, w17, #26 // Rotate left s=6 bits631movz x6, #0xf235 // .Load lower half of constant 0xbd3af235632movk x6, #0xbd3a, lsl #16 // .Load upper half of constant 0xbd3af235633add w7, w9, w17 // Add X parameter round 4 A=II(A, B, C, D, 0xf7537e82, s=6, M[4])634orn x14, x7, x8 // Begin aux function round 4 I(x,y,z)=((~z|x)^y)635add w4, w15, w25 // Add dest value636eor x17, x9, x14 // End aux function round 4 I(x,y,z)=((~z|x)^y)637add w15, w4, w6 // Add constant 0xbd3af235638add w16, w15, w17 // Add aux function result639ror w16, w16, #22 // Rotate left s=10 bits640movz x14, #0xd2bb // .Load lower half of constant 0x2ad7d2bb641movk x14, #0x2ad7, lsl #16 // .Load upper half of constant 0x2ad7d2bb642add w4, w7, w16 // Add X parameter round 4 D=II(D, A, B, C, 0xbd3af235, s=10, M[11])643add w6, w8, w3 // Add dest value644orn x15, x4, x9 // Begin aux function round 4 I(x,y,z)=((~z|x)^y)645add w17, w6, w14 // Add constant 0x2ad7d2bb646eor x16, x7, x15 // End aux function round 4 I(x,y,z)=((~z|x)^y)647add w8, w17, w16 // Add aux function result648ror w8, w8, #17 // Rotate left s=15 bits649movz x3, #0xd391 // .Load lower half of constant 0xeb86d391650movk x3, #0xeb86, lsl #16 // .Load upper half of constant 0xeb86d391651add w14, w4, w8 // Add X parameter round 4 C=II(C, D, A, B, 0x2ad7d2bb, s=15, M[2])652orn x6, x14, x7 // Begin aux function round 4 I(x,y,z)=((~z|x)^y)653add w15, w9, w24 // Add dest value654eor x17, x4, x6 // End aux function round 4 I(x,y,z)=((~z|x)^y)655add w16, w15, w3 // Add constant 0xeb86d391656add w8, w16, w17 // Add aux function result657ror w8, w8, #11 // Rotate left s=21 bits658ldp w6, w15, [x0] // Reload MD5 state->A and state->B659ldp w5, w9, [x0, #8] // Reload MD5 state->C and state->D660add w3, w14, w8 // Add X parameter round 4 B=II(B, C, D, A, 0xeb86d391, s=21, M[9])661add w13, w4, w9 // Add result of MD5 rounds to state->D662add w12, w14, w5 // Add result of MD5 rounds to state->C663add w10, w7, w6 // Add result of MD5 rounds to state->A664add w11, w3, w15 // Add result of MD5 rounds to state->B665stp w12, w13, [x0, #8] // Store MD5 states C,D666stp w10, w11, [x0] // Store MD5 states A,B667add x1, x1, #64 // Increment data pointer668subs w2, w2, #1 // Decrement block counter669b.ne ossl_md5_blocks_loop670671ldp x21,x22,[sp,#16]672ldp x23,x24,[sp,#32]673ldp x25,x26,[sp,#48]674ldp x27,x28,[sp,#64]675ldp x19,x20,[sp],#80676ret677678679680