3 # ====================================================================
4 # Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
5 # project. The module is, however, dual licensed under OpenSSL and
6 # CRYPTOGAMS licenses depending on where you obtain it. For further
7 # details see http://www.openssl.org/~appro/cryptogams/.
8 # ====================================================================
10 # I let hardware handle unaligned input, except on page boundaries
11 # (see below for details). Otherwise straightforward implementation
12 # with X vector in register bank. The module is big-endian [which is
13 # not big deal as there're no little-endian targets left around].
16 # -m64 -m32 | -m64 -m32
17 # --------------------------------------+-----------------------
18 # PPC970,gcc-4.0.0 +50% +38% | +40% +410%(*)
19 # Power6,xlc-7 +150% +90% | +100% +430%(*)
21 # (*) 64-bit code in 32-bit application context, which actually is
22 # on TODO list. It should be noted that for safe deployment in
23 # 32-bit *mutli-threaded* context asyncronous signals should be
24 # blocked upon entry to SHA512 block routine. This is because
25 # 32-bit signaling procedure invalidates upper halves of GPRs.
26 # Context switch procedure preserves them, but not signaling:-(
28 # Second version is true multi-thread safe. Trouble with the original
29 # version was that it was using thread local storage pointer register.
30 # Well, it scrupulously preserved it, but the problem would arise the
31 # moment asynchronous signal was delivered and signal handler would
32 # dereference the TLS pointer. While it's never the case in openssl
33 # application or test suite, we have to respect this scenario and not
34 # use TLS pointer register. Alternative would be to require caller to
35 # block signals prior calling this routine. For the record, in 32-bit
36 # context R2 serves as TLS pointer, while in 64-bit context - R13.
41 if ($flavour =~ /64/) {
49 } elsif ($flavour =~ /32/) {
57 } else { die "nonsense $flavour"; }
60 if ($flavour =~ /le$/) {
61 die "little-endian is 64-bit only: $flavour" if ($SIZE_T==4);
65 $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
66 ( $xlate="${dir}ppc-xlate.pl" and -f $xlate ) or
67 ( $xlate="${dir}../../perlasm/ppc-xlate.pl" and -f $xlate) or
68 die "can't locate ppc-xlate.pl";
70 open STDOUT,"| $^X $xlate $flavour $output" || die "can't call $xlate: $!";
72 if ($output =~ /512/) {
73 $func="sha512_block_data_order";
85 $func="sha256_block_data_order";
98 $FRAME=32*$SIZE_T+16*$SZ;
103 $ctx="r3"; # zapped by $a0
104 $inp="r4"; # zapped by $a1
105 $num="r5"; # zapped by $t0
119 $F =$t1; $t1 = "r0"; # stay away from "r13";
123 @V=($A,$B,$C,$D,$E,$F,$G,$H);
124 @X=("r16","r17","r18","r19","r20","r21","r22","r23",
125 "r24","r25","r26","r27","r28","r29","r30","r31");
127 $inp="r31" if($SZ==4 || $SIZE_T==8); # reassigned $inp! aliases with @X[15]
130 my ($i,$a,$b,$c,$d,$e,$f,$g,$h)=@_;
132 $ROR $a0,$e,$Sigma1[0]
133 $ROR $a1,$e,$Sigma1[1]
138 $ROR $a1,$a1,`$Sigma1[2]-$Sigma1[1]`
139 or $t0,$t0,$t1 ; Ch(e,f,g)
141 xor $a0,$a0,$a1 ; Sigma1(e)
145 $ROR $a0,$a,$Sigma0[0]
146 $ROR $a1,$a,$Sigma0[1]
150 $ROR $a1,$a1,`$Sigma0[2]-$Sigma0[1]`
153 xor $a0,$a0,$a1 ; Sigma0(a)
155 xor $t0,$t0,$t1 ; Maj(a,b,c)
157 $code.=<<___ if ($i<15);
158 $LD $t1,`($i+1)*$SZ`($Tbl)
168 my ($i,$a,$b,$c,$d,$e,$f,$g,$h)=@_;
171 $ROR $a0,@X[($i+1)%16],$sigma0[0]
172 $ROR $a1,@X[($i+1)%16],$sigma0[1]
173 $ROR $t0,@X[($i+14)%16],$sigma1[0]
174 $ROR $t1,@X[($i+14)%16],$sigma1[1]
176 $SHR $a1,@X[($i+1)%16],$sigma0[2]
178 $SHR $t1,@X[($i+14)%16],$sigma1[2]
179 add @X[$i],@X[$i],@X[($i+9)%16]
180 xor $a0,$a0,$a1 ; sigma0(X[(i+1)&0x0f])
181 xor $t0,$t0,$t1 ; sigma1(X[(i+14)&0x0f])
182 $LD $t1,`$i*$SZ`($Tbl)
183 add @X[$i],@X[$i],$a0
184 add @X[$i],@X[$i],$t0
186 &ROUND_00_15($i+16,$a,$b,$c,$d,$e,$f,$g,$h);
196 $STU $sp,-$FRAME($sp)
198 $SHL $num,$num,`log(16*$SZ)/log(2)`
200 $PUSH $ctx,`$FRAME-$SIZE_T*22`($sp)
202 $PUSH r14,`$FRAME-$SIZE_T*18`($sp)
203 $PUSH r15,`$FRAME-$SIZE_T*17`($sp)
204 $PUSH r16,`$FRAME-$SIZE_T*16`($sp)
205 $PUSH r17,`$FRAME-$SIZE_T*15`($sp)
206 $PUSH r18,`$FRAME-$SIZE_T*14`($sp)
207 $PUSH r19,`$FRAME-$SIZE_T*13`($sp)
208 $PUSH r20,`$FRAME-$SIZE_T*12`($sp)
209 $PUSH r21,`$FRAME-$SIZE_T*11`($sp)
210 $PUSH r22,`$FRAME-$SIZE_T*10`($sp)
211 $PUSH r23,`$FRAME-$SIZE_T*9`($sp)
212 $PUSH r24,`$FRAME-$SIZE_T*8`($sp)
213 $PUSH r25,`$FRAME-$SIZE_T*7`($sp)
214 $PUSH r26,`$FRAME-$SIZE_T*6`($sp)
215 $PUSH r27,`$FRAME-$SIZE_T*5`($sp)
216 $PUSH r28,`$FRAME-$SIZE_T*4`($sp)
217 $PUSH r29,`$FRAME-$SIZE_T*3`($sp)
218 $PUSH r30,`$FRAME-$SIZE_T*2`($sp)
219 $PUSH r31,`$FRAME-$SIZE_T*1`($sp)
220 $PUSH r0,`$FRAME+$LRSAVE`($sp)
223 if ($SZ==4 || $SIZE_T==8) {
226 mr $inp,r4 ; incarnate $inp
236 for ($i=16;$i<32;$i++) {
238 lwz r$i,`4*($i-16)`($ctx)
250 $PUSH $num,`$FRAME-$SIZE_T*24`($sp) ; end pointer
251 $PUSH $inp,`$FRAME-$SIZE_T*23`($sp) ; inp pointer
252 bl Lsha2_block_private
255 ; PowerPC specification allows an implementation to be ill-behaved
256 ; upon unaligned access which crosses page boundary. "Better safe
257 ; than sorry" principle makes me treat it specially. But I don't
258 ; look for particular offending word, but rather for the input
259 ; block which crosses the boundary. Once found that block is aligned
260 ; and hashed separately...
264 andi. $t1,$t1,`4096-16*$SZ` ; distance to closest page boundary
267 ble- Laligned ; didn't cross the page boundary
270 $PUSH $num,`$FRAME-$SIZE_T*25`($sp) ; save real remaining num
271 $PUSH $t1,`$FRAME-$SIZE_T*24`($sp) ; intermediate end pointer
272 $PUSH $inp,`$FRAME-$SIZE_T*23`($sp) ; inp pointer
273 bl Lsha2_block_private
274 ; $inp equals to the intermediate end pointer here
275 $POP $num,`$FRAME-$SIZE_T*25`($sp) ; restore real remaining num
280 if ($SZ==4 || $SIZE_T==8) {
282 addi r20,$sp,$LOCALS ; aligned spot below the frame
298 addi r12,$sp,$LOCALS ; aligned spot below the frame
315 $PUSH $inp,`$FRAME-$SIZE_T*26`($sp) ; save real inp
316 addi $t1,$sp,`$LOCALS+16*$SZ` ; fictitious end pointer
317 addi $inp,$sp,$LOCALS ; fictitious inp pointer
318 $PUSH $num,`$FRAME-$SIZE_T*25`($sp) ; save real num
319 $PUSH $t1,`$FRAME-$SIZE_T*24`($sp) ; end pointer
320 $PUSH $inp,`$FRAME-$SIZE_T*23`($sp) ; inp pointer
321 bl Lsha2_block_private
322 $POP $inp,`$FRAME-$SIZE_T*26`($sp) ; restore real inp
323 $POP $num,`$FRAME-$SIZE_T*25`($sp) ; restore real num
324 addic. $num,$num,`-16*$SZ` ; num--
328 $POP r0,`$FRAME+$LRSAVE`($sp)
329 $POP r14,`$FRAME-$SIZE_T*18`($sp)
330 $POP r15,`$FRAME-$SIZE_T*17`($sp)
331 $POP r16,`$FRAME-$SIZE_T*16`($sp)
332 $POP r17,`$FRAME-$SIZE_T*15`($sp)
333 $POP r18,`$FRAME-$SIZE_T*14`($sp)
334 $POP r19,`$FRAME-$SIZE_T*13`($sp)
335 $POP r20,`$FRAME-$SIZE_T*12`($sp)
336 $POP r21,`$FRAME-$SIZE_T*11`($sp)
337 $POP r22,`$FRAME-$SIZE_T*10`($sp)
338 $POP r23,`$FRAME-$SIZE_T*9`($sp)
339 $POP r24,`$FRAME-$SIZE_T*8`($sp)
340 $POP r25,`$FRAME-$SIZE_T*7`($sp)
341 $POP r26,`$FRAME-$SIZE_T*6`($sp)
342 $POP r27,`$FRAME-$SIZE_T*5`($sp)
343 $POP r28,`$FRAME-$SIZE_T*4`($sp)
344 $POP r29,`$FRAME-$SIZE_T*3`($sp)
345 $POP r30,`$FRAME-$SIZE_T*2`($sp)
346 $POP r31,`$FRAME-$SIZE_T*1`($sp)
351 .byte 0,12,4,1,0x80,18,3,0
355 if ($SZ==4 || $SIZE_T==8) {
361 for($i=0;$i<16;$i++) {
362 $code.=<<___ if ($SZ==4 && !$LITTLE_ENDIAN);
363 lwz @X[$i],`$i*$SZ`($inp)
365 $code.=<<___ if ($SZ==4 && $LITTLE_ENDIAN);
366 lwz $a0,`$i*$SZ`($inp)
368 rlwimi @X[$i],$a0,24,0,7
369 rlwimi @X[$i],$a0,24,16,23
371 # 64-bit loads are split to 2x32-bit ones, as CPU can't handle
372 # unaligned 64-bit loads, only 32-bit ones...
373 $code.=<<___ if ($SZ==8 && !$LITTLE_ENDIAN);
374 lwz $t0,`$i*$SZ`($inp)
375 lwz @X[$i],`$i*$SZ+4`($inp)
376 insrdi @X[$i],$t0,32,0
378 $code.=<<___ if ($SZ==8 && $LITTLE_ENDIAN);
379 lwz $a0,`$i*$SZ`($inp)
380 lwz $a1,`$i*$SZ+4`($inp)
383 rlwimi $t0,$a0,24,0,7
384 rlwimi @X[$i],$a1,24,0,7
385 rlwimi $t0,$a0,24,16,23
386 rlwimi @X[$i],$a1,24,16,23
387 insrdi @X[$i],$t0,32,0
393 li $t0,`$rounds/16-1`
397 addi $Tbl,$Tbl,`16*$SZ`
406 $POP $ctx,`$FRAME-$SIZE_T*22`($sp)
407 $POP $inp,`$FRAME-$SIZE_T*23`($sp) ; inp pointer
408 $POP $num,`$FRAME-$SIZE_T*24`($sp) ; end pointer
409 subi $Tbl,$Tbl,`($rounds-16)*$SZ` ; rewind Tbl
411 $LD r16,`0*$SZ`($ctx)
412 $LD r17,`1*$SZ`($ctx)
413 $LD r18,`2*$SZ`($ctx)
414 $LD r19,`3*$SZ`($ctx)
415 $LD r20,`4*$SZ`($ctx)
416 $LD r21,`5*$SZ`($ctx)
417 $LD r22,`6*$SZ`($ctx)
418 addi $inp,$inp,`16*$SZ` ; advance inp
419 $LD r23,`7*$SZ`($ctx)
422 $PUSH $inp,`$FRAME-$SIZE_T*23`($sp)
438 bne Lsha2_block_private
441 .byte 0,12,0x14,0,0,0,0,0
445 ########################################################################
446 # SHA512 for PPC32, X vector is off-loaded to stack...
450 # ----------------------+-----------------------
451 # PPC74x0,gcc-4.0.1 | +48%
452 # POWER6,gcc-4.4.6 | +124%(*)
453 # POWER7,gcc-4.4.6 | +79%(*)
454 # e300,gcc-4.1.0 | +167%
456 # (*) ~1/3 of -m64 result [and ~20% better than -m32 code generated
461 my @V=map("r$_",(16..31)); # A..H
463 my ($s0,$s1,$t0,$t1,$t2,$t3,$a0,$a1,$a2,$a3)=map("r$_",(0,5,6,8..12,14,15));
464 my ($x0,$x1)=("r3","r4"); # zaps $ctx and $inp
466 sub ROUND_00_15_ppc32 {
467 my ($i, $ahi,$alo,$bhi,$blo,$chi,$clo,$dhi,$dlo,
468 $ehi,$elo,$fhi,$flo,$ghi,$glo,$hhi,$hlo)=@_;
471 lwz $t2,`$SZ*($i%16)+4`($Tbl)
473 lwz $t3,`$SZ*($i%16)+0`($Tbl)
475 addc $hlo,$hlo,$t0 ; h+=x[i]
476 stw $t0,`$XOFF+0+$SZ*($i%16)`($sp) ; save x[i]
478 srwi $s0,$elo,$Sigma1[0]
479 srwi $s1,$ehi,$Sigma1[0]
483 stw $t1,`$XOFF+4+$SZ*($i%16)`($sp)
484 srwi $t0,$elo,$Sigma1[1]
485 srwi $t1,$ehi,$Sigma1[1]
486 addc $hlo,$hlo,$t2 ; h+=K512[i]
487 insrwi $s0,$ehi,$Sigma1[0],0
488 insrwi $s1,$elo,$Sigma1[0],0
489 xor $a0,$a0,$glo ; Ch(e,f,g)
492 insrwi $t0,$ehi,$Sigma1[1],0
493 insrwi $t1,$elo,$Sigma1[1],0
494 addc $hlo,$hlo,$a0 ; h+=Ch(e,f,g)
495 srwi $t2,$ehi,$Sigma1[2]-32
496 srwi $t3,$elo,$Sigma1[2]-32
499 insrwi $t2,$elo,$Sigma1[2]-32,0
500 insrwi $t3,$ehi,$Sigma1[2]-32,0
501 xor $a0,$alo,$blo ; a^b, b^c in next round
504 xor $s0,$s0,$t2 ; Sigma1(e)
507 srwi $t0,$alo,$Sigma0[0]
509 addc $hlo,$hlo,$s0 ; h+=Sigma1(e)
511 srwi $t1,$ahi,$Sigma0[0]
512 srwi $s0,$ahi,$Sigma0[1]-32
514 srwi $s1,$alo,$Sigma0[1]-32
515 insrwi $t0,$ahi,$Sigma0[0],0
516 insrwi $t1,$alo,$Sigma0[0],0
517 xor $a2,$a2,$blo ; Maj(a,b,c)
518 addc $dlo,$dlo,$hlo ; d+=h
520 insrwi $s0,$alo,$Sigma0[1]-32,0
521 insrwi $s1,$ahi,$Sigma0[1]-32,0
523 srwi $t2,$ahi,$Sigma0[2]-32
524 srwi $t3,$alo,$Sigma0[2]-32
526 addc $hlo,$hlo,$a2 ; h+=Maj(a,b,c)
528 insrwi $t2,$alo,$Sigma0[2]-32,0
529 insrwi $t3,$ahi,$Sigma0[2]-32,0
532 $code.=<<___ if ($i>=15);
533 lwz $t0,`$XOFF+0+$SZ*(($i+2)%16)`($sp)
534 lwz $t1,`$XOFF+4+$SZ*(($i+2)%16)`($sp)
536 $code.=<<___ if ($i<15);
537 lwz $t1,`$SZ*($i+1)+0`($inp)
538 lwz $t0,`$SZ*($i+1)+4`($inp)
541 xor $s0,$s0,$t2 ; Sigma0(a)
543 addc $hlo,$hlo,$s0 ; h+=Sigma0(a)
546 $code.=<<___ if ($i==15);
547 lwz $x0,`$XOFF+0+$SZ*(($i+1)%16)`($sp)
548 lwz $x1,`$XOFF+4+$SZ*(($i+1)%16)`($sp)
551 sub ROUND_16_xx_ppc32 {
552 my ($i, $ahi,$alo,$bhi,$blo,$chi,$clo,$dhi,$dlo,
553 $ehi,$elo,$fhi,$flo,$ghi,$glo,$hhi,$hlo)=@_;
556 srwi $s0,$t0,$sigma0[0]
557 srwi $s1,$t1,$sigma0[0]
558 srwi $t2,$t0,$sigma0[1]
559 srwi $t3,$t1,$sigma0[1]
560 insrwi $s0,$t1,$sigma0[0],0
561 insrwi $s1,$t0,$sigma0[0],0
562 srwi $a0,$t0,$sigma0[2]
563 insrwi $t2,$t1,$sigma0[1],0
564 insrwi $t3,$t0,$sigma0[1],0
565 insrwi $a0,$t1,$sigma0[2],0
567 lwz $t2,`$XOFF+0+$SZ*(($i+14)%16)`($sp)
568 srwi $a1,$t1,$sigma0[2]
570 lwz $t3,`$XOFF+4+$SZ*(($i+14)%16)`($sp)
572 srwi $s0,$t2,$sigma1[0]
574 srwi $s1,$t3,$sigma1[0]
575 addc $x0,$x0,$a0 ; x[i]+=sigma0(x[i+1])
576 srwi $a0,$t3,$sigma1[1]-32
577 insrwi $s0,$t3,$sigma1[0],0
578 insrwi $s1,$t2,$sigma1[0],0
580 srwi $a1,$t2,$sigma1[1]-32
582 insrwi $a0,$t2,$sigma1[1]-32,0
583 srwi $t2,$t2,$sigma1[2]
584 insrwi $a1,$t3,$sigma1[1]-32,0
585 insrwi $t2,$t3,$sigma1[2],0
587 lwz $a0,`$XOFF+0+$SZ*(($i+9)%16)`($sp)
588 srwi $t3,$t3,$sigma1[2]
590 lwz $a1,`$XOFF+4+$SZ*(($i+9)%16)`($sp)
592 addc $x0,$x0,$a0 ; x[i]+=x[i+9]
595 addc $x0,$x0,$s0 ; x[i]+=sigma1(x[i+14])
598 ($t0,$t1,$x0,$x1) = ($x0,$x1,$t0,$t1);
599 &ROUND_00_15_ppc32(@_);
606 xor $a2,@V[3],@V[5] ; B^C, magic seed
610 for($i=0;$i<16;$i++) {
611 &ROUND_00_15_ppc32($i,@V);
612 unshift(@V,pop(@V)); unshift(@V,pop(@V));
613 ($a0,$a1,$a2,$a3) = ($a2,$a3,$a0,$a1);
616 li $a0,`$rounds/16-1`
620 addi $Tbl,$Tbl,`16*$SZ`
623 &ROUND_16_xx_ppc32($i,@V);
624 unshift(@V,pop(@V)); unshift(@V,pop(@V));
625 ($a0,$a1,$a2,$a3) = ($a2,$a3,$a0,$a1);
630 $POP $ctx,`$FRAME-$SIZE_T*22`($sp)
631 $POP $inp,`$FRAME-$SIZE_T*23`($sp) ; inp pointer
632 $POP $num,`$FRAME-$SIZE_T*24`($sp) ; end pointer
633 subi $Tbl,$Tbl,`($rounds-16)*$SZ` ; rewind Tbl
663 addc @V[11],@V[11],$t3
666 adde @V[10],@V[10],$t2
669 addc @V[13],@V[13],$a1
672 adde @V[12],@V[12],$a0
675 addc @V[15],@V[15],$a3
678 adde @V[14],@V[14],$a2
684 addi $inp,$inp,`16*$SZ` ; advance inp
685 $PUSH $inp,`$FRAME-$SIZE_T*23`($sp)
687 bne Lsha2_block_private
690 .byte 0,12,0x14,0,0,0,0,0
695 # Ugly hack here, because PPC assembler syntax seem to vary too
696 # much from platforms to platform...
702 mflr $Tbl ; vvvvvv "distance" between . and 1st data entry
703 addi $Tbl,$Tbl,`64-8`
707 .byte 0,12,0x14,0,0,0,0,0
710 $code.=<<___ if ($SZ==8);
711 .quad 0x428a2f98d728ae22,0x7137449123ef65cd
712 .quad 0xb5c0fbcfec4d3b2f,0xe9b5dba58189dbbc
713 .quad 0x3956c25bf348b538,0x59f111f1b605d019
714 .quad 0x923f82a4af194f9b,0xab1c5ed5da6d8118
715 .quad 0xd807aa98a3030242,0x12835b0145706fbe
716 .quad 0x243185be4ee4b28c,0x550c7dc3d5ffb4e2
717 .quad 0x72be5d74f27b896f,0x80deb1fe3b1696b1
718 .quad 0x9bdc06a725c71235,0xc19bf174cf692694
719 .quad 0xe49b69c19ef14ad2,0xefbe4786384f25e3
720 .quad 0x0fc19dc68b8cd5b5,0x240ca1cc77ac9c65
721 .quad 0x2de92c6f592b0275,0x4a7484aa6ea6e483
722 .quad 0x5cb0a9dcbd41fbd4,0x76f988da831153b5
723 .quad 0x983e5152ee66dfab,0xa831c66d2db43210
724 .quad 0xb00327c898fb213f,0xbf597fc7beef0ee4
725 .quad 0xc6e00bf33da88fc2,0xd5a79147930aa725
726 .quad 0x06ca6351e003826f,0x142929670a0e6e70
727 .quad 0x27b70a8546d22ffc,0x2e1b21385c26c926
728 .quad 0x4d2c6dfc5ac42aed,0x53380d139d95b3df
729 .quad 0x650a73548baf63de,0x766a0abb3c77b2a8
730 .quad 0x81c2c92e47edaee6,0x92722c851482353b
731 .quad 0xa2bfe8a14cf10364,0xa81a664bbc423001
732 .quad 0xc24b8b70d0f89791,0xc76c51a30654be30
733 .quad 0xd192e819d6ef5218,0xd69906245565a910
734 .quad 0xf40e35855771202a,0x106aa07032bbd1b8
735 .quad 0x19a4c116b8d2d0c8,0x1e376c085141ab53
736 .quad 0x2748774cdf8eeb99,0x34b0bcb5e19b48a8
737 .quad 0x391c0cb3c5c95a63,0x4ed8aa4ae3418acb
738 .quad 0x5b9cca4f7763e373,0x682e6ff3d6b2b8a3
739 .quad 0x748f82ee5defb2fc,0x78a5636f43172f60
740 .quad 0x84c87814a1f0ab72,0x8cc702081a6439ec
741 .quad 0x90befffa23631e28,0xa4506cebde82bde9
742 .quad 0xbef9a3f7b2c67915,0xc67178f2e372532b
743 .quad 0xca273eceea26619c,0xd186b8c721c0c207
744 .quad 0xeada7dd6cde0eb1e,0xf57d4f7fee6ed178
745 .quad 0x06f067aa72176fba,0x0a637dc5a2c898a6
746 .quad 0x113f9804bef90dae,0x1b710b35131c471b
747 .quad 0x28db77f523047d84,0x32caab7b40c72493
748 .quad 0x3c9ebe0a15c9bebc,0x431d67c49c100d4c
749 .quad 0x4cc5d4becb3e42b6,0x597f299cfc657e2a
750 .quad 0x5fcb6fab3ad6faec,0x6c44198c4a475817
752 $code.=<<___ if ($SZ==4);
753 .long 0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5
754 .long 0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5
755 .long 0xd807aa98,0x12835b01,0x243185be,0x550c7dc3
756 .long 0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174
757 .long 0xe49b69c1,0xefbe4786,0x0fc19dc6,0x240ca1cc
758 .long 0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da
759 .long 0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7
760 .long 0xc6e00bf3,0xd5a79147,0x06ca6351,0x14292967
761 .long 0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13
762 .long 0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85
763 .long 0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3
764 .long 0xd192e819,0xd6990624,0xf40e3585,0x106aa070
765 .long 0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5
766 .long 0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3
767 .long 0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208
768 .long 0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2
771 $code =~ s/\`([^\`]*)\`/eval $1/gem;