Lines Matching +full:mac +full:- +full:s
2 # SPDX-License-Identifier: GPL-1.0+ OR BSD-3-Clause
5 # Written by Andy Polyakov, @dot-asm, initially for use with OpenSSL.
8 # Poly1305 hash for RISC-V.
12 # In the essence it's pretty straightforward transliteration of MIPS
13 # module [without big-endian option].
15 # 1.8 cycles per byte on U74, >100% faster than compiler-generated
34 for (@ARGV) { $output=$_ if (/\w[\w\-]*\.\w+$/); }
51 # 64-bit code path...
86 andi $inp,$inp,-8 # align $inp
107 addi $tmp0,$tmp0,-63 # 0x00000000ffffffc1
109 addi $tmp0,$tmp0,-1 # 0x0ffffffc0fffffff
112 addi $tmp0,$tmp0,-3 # 0x0ffffffc0ffffffc
124 .size poly1305_init,.-poly1305_init
138 andi $len,$len,-16 # complete blocks only
141 caddi $sp,$sp,-4*__SIZEOF_POINTER__
149 andi $inp,$inp,-8 # align $inp
182 andi $tmp0,$h2,-4 # modulo-scheduled reduction
246 .size poly1305_blocks,.-poly1305_blocks
250 my ($ctx,$mac,$nonce) = ($a0,$a1,$a2);
263 andi $in0,$tmp2,-4 # final reduction
304 sd $in0,0($mac) # write mac value
305 sd $in1,8($mac)
307 srli $tmp0,$in0,8 # write mac value
310 sb $in0,0($mac)
312 sb $tmp0,1($mac)
314 sb $tmp1,2($mac)
316 sb $tmp2,3($mac)
318 sb $tmp3,4($mac)
320 sb $tmp0,5($mac)
322 sb $tmp1,6($mac)
324 sb $tmp2,7($mac)
326 sb $in1,8($mac)
328 sb $tmp3,9($mac)
330 sb $tmp0,10($mac)
332 sb $tmp1,11($mac)
334 sb $tmp2,12($mac)
335 sb $tmp3,13($mac)
336 sb $tmp0,14($mac)
337 sb $tmp1,15($mac)
341 .size poly1305_emit,.-poly1305_emit
342 .string "Poly1305 for RISC-V, CRYPTOGAMS by \@dot-asm"
347 # 32-bit code path
430 addi $tmp0,$tmp0,-1 # 0x0fffffff
432 addi $tmp0,$tmp0,-3 # 0x0ffffffc
454 .size poly1305_init,.-poly1305_init
470 andi $len,$len,-16 # complete blocks only
474 cm.push {ra,s0-s8}, -48
476 caddi $sp,$sp,-__SIZEOF_POINTER__*12
491 andi $inp,$inp,-4 # align $inp
536 srliw $t3,$h4,2 # modulo-scheduled reduction
537 andi $t4,$h4,-4
692 cm.popret {ra,s0-s8}, 48
708 .size poly1305_blocks,.-poly1305_blocks
712 my ($ctx,$mac,$nonce,$tmp4) = ($a0,$a1,$a2,$a3);
728 andi $in0,$tmp4,-4
791 sw $in0,0($mac) # write mac value
792 sw $in1,4($mac)
793 sw $in2,8($mac)
794 sw $in3,12($mac)
796 srl $tmp0,$in0,8 # write mac value
799 sb $in0, 0($mac)
800 sb $tmp0,1($mac)
802 sb $tmp1,2($mac)
804 sb $tmp2,3($mac)
806 sb $in1, 4($mac)
807 sb $tmp0,5($mac)
809 sb $tmp1,6($mac)
811 sb $tmp2,7($mac)
813 sb $in2, 8($mac)
814 sb $tmp0,9($mac)
816 sb $tmp1,10($mac)
818 sb $tmp2,11($mac)
820 sb $in3, 12($mac)
821 sb $tmp0,13($mac)
822 sb $tmp1,14($mac)
823 sb $tmp2,15($mac)
827 .size poly1305_emit,.-poly1305_emit
828 .string "Poly1305 for RISC-V, CRYPTOGAMS by \@dot-asm"
835 s/\(x([0-9]+)\)/(c$1)/ and s/\b([ls][bhwd]u?)\b/c$1/;
836 s/\b(PUSH|POP)(\s+)x([0-9]+)/$1$2c$3/ or
837 s/\b(ret|jal)\b/c$1/;
838 s/\bcaddi?\b/cincoffset/ and s/\bx([0-9]+,)/c$1/g or
839 m/\bcmove\b/ and s/\bx([0-9]+)/c$1/g;
841 s/\bcaddi?\b/add/ or
842 s/\bcmove\b/mv/;