diff options
| author | miod <> | 2023-02-01 20:45:04 +0000 |
|---|---|---|
| committer | miod <> | 2023-02-01 20:45:04 +0000 |
| commit | 5957c398bf683b5334ed18dd0f830b1cfffbf027 (patch) | |
| tree | 58219f5c6538172b9d00f33bf48c9a61419ec7a0 /src/lib/libcrypto/rc4 | |
| parent | 093a7a1758207b4e7e2b0d17ec6e5e7ec72e3a44 (diff) | |
| download | openbsd-5957c398bf683b5334ed18dd0f830b1cfffbf027.tar.gz openbsd-5957c398bf683b5334ed18dd0f830b1cfffbf027.tar.bz2 openbsd-5957c398bf683b5334ed18dd0f830b1cfffbf027.zip | |
Move all data blocks from .text to .rodata and cleanup up and homogeneize code
responsible from getting the proper address of those blocks.
ok tb@ jsing@
Diffstat (limited to 'src/lib/libcrypto/rc4')
| -rw-r--r-- | src/lib/libcrypto/rc4/asm/rc4-586.pl | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/src/lib/libcrypto/rc4/asm/rc4-586.pl b/src/lib/libcrypto/rc4/asm/rc4-586.pl index f3c3e117bc..4991c37c2c 100644 --- a/src/lib/libcrypto/rc4/asm/rc4-586.pl +++ b/src/lib/libcrypto/rc4/asm/rc4-586.pl | |||
| @@ -188,7 +188,8 @@ if ($alt=0) { | |||
| 188 | &mov (&wparam(3),$out); # $out as accumulator in these loops | 188 | &mov (&wparam(3),$out); # $out as accumulator in these loops |
| 189 | &jz (&label("go4loop4")); | 189 | &jz (&label("go4loop4")); |
| 190 | 190 | ||
| 191 | &picmeup($out,"OPENSSL_ia32cap_P"); | 191 | &picsetup($out); |
| 192 | &picsymbol($out, "OPENSSL_ia32cap_P", $out); | ||
| 192 | # check SSE2 bit [could have been MMX] | 193 | # check SSE2 bit [could have been MMX] |
| 193 | &bt (&DWP(0,$out),"\$IA32CAP_BIT0_SSE2"); | 194 | &bt (&DWP(0,$out),"\$IA32CAP_BIT0_SSE2"); |
| 194 | &jnc (&label("go4loop4")); | 195 | &jnc (&label("go4loop4")); |
| @@ -305,7 +306,9 @@ $idx="edx"; | |||
| 305 | &mov ($out,&wparam(0)); # load key | 306 | &mov ($out,&wparam(0)); # load key |
| 306 | &mov ($idi,&wparam(1)); # load len | 307 | &mov ($idi,&wparam(1)); # load len |
| 307 | &mov ($inp,&wparam(2)); # load data | 308 | &mov ($inp,&wparam(2)); # load data |
| 308 | &picmeup($idx,"OPENSSL_ia32cap_P"); | 309 | |
| 310 | &picsetup($idx); | ||
| 311 | &picsymbol($idx, "OPENSSL_ia32cap_P", $idx); | ||
| 309 | 312 | ||
| 310 | &lea ($out,&DWP(2*4,$out)); # &key->data | 313 | &lea ($out,&DWP(2*4,$out)); # &key->data |
| 311 | &lea ($inp,&DWP(0,$inp,$idi)); # $inp to point at the end | 314 | &lea ($inp,&DWP(0,$inp,$idi)); # $inp to point at the end |
| @@ -382,12 +385,12 @@ $idx="edx"; | |||
| 382 | &function_end("RC4_set_key"); | 385 | &function_end("RC4_set_key"); |
| 383 | 386 | ||
| 384 | # const char *RC4_options(void); | 387 | # const char *RC4_options(void); |
| 388 | &static_label("opts"); | ||
| 385 | &function_begin_B("RC4_options"); | 389 | &function_begin_B("RC4_options"); |
| 386 | &call (&label("pic_point")); | 390 | &picsetup("edx"); |
| 387 | &set_label("pic_point"); | 391 | &picsymbol("eax", &label("opts"), "edx"); |
| 388 | &blindpop("eax"); | 392 | &picsymbol("edx", "OPENSSL_ia32cap_P", "edx");; |
| 389 | &lea ("eax",&DWP(&label("opts")."-".&label("pic_point"),"eax")); | 393 | |
| 390 | &picmeup("edx","OPENSSL_ia32cap_P"); | ||
| 391 | &mov ("edx",&DWP(0,"edx")); | 394 | &mov ("edx",&DWP(0,"edx")); |
| 392 | &bt ("edx","\$IA32CAP_BIT0_INTELP4"); | 395 | &bt ("edx","\$IA32CAP_BIT0_INTELP4"); |
| 393 | &jc (&label("1xchar")); | 396 | &jc (&label("1xchar")); |
| @@ -399,13 +402,14 @@ $idx="edx"; | |||
| 399 | &add ("eax",12); | 402 | &add ("eax",12); |
| 400 | &set_label("ret"); | 403 | &set_label("ret"); |
| 401 | &ret (); | 404 | &ret (); |
| 402 | &set_label("opts",64); | 405 | &function_end_B("RC4_options"); |
| 406 | |||
| 407 | &rodataseg(); | ||
| 408 | &set_label("opts"); | ||
| 403 | &asciz ("rc4(4x,int)"); | 409 | &asciz ("rc4(4x,int)"); |
| 404 | &asciz ("rc4(1x,char)"); | 410 | &asciz ("rc4(1x,char)"); |
| 405 | &asciz ("rc4(8x,mmx)"); | 411 | &asciz ("rc4(8x,mmx)"); |
| 406 | &asciz ("RC4 for x86, CRYPTOGAMS by <appro\@openssl.org>"); | 412 | &previous(); |
| 407 | &align (64); | ||
| 408 | &function_end_B("RC4_options"); | ||
| 409 | 413 | ||
| 410 | &asm_finish(); | 414 | &asm_finish(); |
| 411 | 415 | ||
