diff options
author | Patrick Steuer <patrick.steuer@de.ibm.com> | 2018-04-03 18:24:18 +0100 |
---|---|---|
committer | Andy Polyakov <appro@openssl.org> | 2018-08-06 12:04:52 +0200 |
commit | f38edcab594b4934bd9625ef889934b2dfb5d1f0 (patch) | |
tree | 19a9d9fa9a548eddad4bef3b27672a4ce720850f /crypto/s390xcpuid.pl | |
parent | 28c5b7d482dda8597bbf93890463d7eb0f9f2355 (diff) |
s390x assembly pack: add KIMD/KLMD code path for sha3/shake
Signed-off-by: Patrick Steuer <patrick.steuer@de.ibm.com>
Reviewed-by: Andy Polyakov <appro@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5935)
Diffstat (limited to 'crypto/s390xcpuid.pl')
-rwxr-xr-x | crypto/s390xcpuid.pl | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/crypto/s390xcpuid.pl b/crypto/s390xcpuid.pl index e7afb8dcf5..ec700a47d9 100755 --- a/crypto/s390xcpuid.pl +++ b/crypto/s390xcpuid.pl @@ -262,6 +262,48 @@ OPENSSL_vx_probe: .size OPENSSL_vx_probe,.-OPENSSL_vx_probe ___ +{ +################ +# void s390x_kimd(const unsigned char *in, size_t len, unsigned int fc, +# void *param) +my ($in,$len,$fc,$param) = map("%r$_",(2..5)); +$code.=<<___; +.globl s390x_kimd +.type s390x_kimd,\@function +.align 16 +s390x_kimd: + llgfr %r0,$fc + lgr %r1,$param + + .long 0xb93e0002 # kimd %r0,%r2 + brc 1,.-4 # pay attention to "partial completion" + + br $ra +.size s390x_kimd,.-s390x_kimd +___ +} + +{ +################ +# void s390x_klmd(const unsigned char *in, size_t inlen, unsigned char *out, +# size_t outlen, unsigned int fc, void *param) +my ($in,$inlen,$out,$outlen,$fc) = map("%r$_",(2..6)); +$code.=<<___; +.globl s390x_klmd +.type s390x_klmd,\@function +.align 32 +s390x_klmd: + llgfr %r0,$fc + l${g} %r1,$stdframe($sp) + + .long 0xb93f0042 # klmd %r4,%r2 + brc 1,.-4 # pay attention to "partial completion" + + br $ra +.size s390x_klmd,.-s390x_klmd +___ +} + ################ # void s390x_km(const unsigned char *in, size_t len, unsigned char *out, # unsigned int fc, void *param) |