diff options
Diffstat (limited to 'src/lib/libcrypto/rsa/rsa_eay.c')
| -rw-r--r-- | src/lib/libcrypto/rsa/rsa_eay.c | 55 |
1 files changed, 54 insertions, 1 deletions
diff --git a/src/lib/libcrypto/rsa/rsa_eay.c b/src/lib/libcrypto/rsa/rsa_eay.c index cd0ff9730c..35b32f6d02 100644 --- a/src/lib/libcrypto/rsa/rsa_eay.c +++ b/src/lib/libcrypto/rsa/rsa_eay.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: rsa_eay.c,v 1.63 2023/08/02 08:44:38 tb Exp $ */ | 1 | /* $OpenBSD: rsa_eay.c,v 1.64 2023/08/09 09:32:23 tb Exp $ */ |
| 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
| 3 | * All rights reserved. | 3 | * All rights reserved. |
| 4 | * | 4 | * |
| @@ -857,3 +857,56 @@ RSA_PKCS1_SSLeay(void) | |||
| 857 | return RSA_PKCS1_OpenSSL(); | 857 | return RSA_PKCS1_OpenSSL(); |
| 858 | } | 858 | } |
| 859 | LCRYPTO_ALIAS(RSA_PKCS1_SSLeay); | 859 | LCRYPTO_ALIAS(RSA_PKCS1_SSLeay); |
| 860 | |||
| 861 | int | ||
| 862 | RSA_bits(const RSA *r) | ||
| 863 | { | ||
| 864 | return BN_num_bits(r->n); | ||
| 865 | } | ||
| 866 | LCRYPTO_ALIAS(RSA_bits); | ||
| 867 | |||
| 868 | int | ||
| 869 | RSA_size(const RSA *r) | ||
| 870 | { | ||
| 871 | return BN_num_bytes(r->n); | ||
| 872 | } | ||
| 873 | LCRYPTO_ALIAS(RSA_size); | ||
| 874 | |||
| 875 | int | ||
| 876 | RSA_public_encrypt(int flen, const unsigned char *from, unsigned char *to, | ||
| 877 | RSA *rsa, int padding) | ||
| 878 | { | ||
| 879 | return rsa->meth->rsa_pub_enc(flen, from, to, rsa, padding); | ||
| 880 | } | ||
| 881 | LCRYPTO_ALIAS(RSA_public_encrypt); | ||
| 882 | |||
| 883 | int | ||
| 884 | RSA_private_encrypt(int flen, const unsigned char *from, unsigned char *to, | ||
| 885 | RSA *rsa, int padding) | ||
| 886 | { | ||
| 887 | return rsa->meth->rsa_priv_enc(flen, from, to, rsa, padding); | ||
| 888 | } | ||
| 889 | LCRYPTO_ALIAS(RSA_private_encrypt); | ||
| 890 | |||
| 891 | int | ||
| 892 | RSA_private_decrypt(int flen, const unsigned char *from, unsigned char *to, | ||
| 893 | RSA *rsa, int padding) | ||
| 894 | { | ||
| 895 | return rsa->meth->rsa_priv_dec(flen, from, to, rsa, padding); | ||
| 896 | } | ||
| 897 | LCRYPTO_ALIAS(RSA_private_decrypt); | ||
| 898 | |||
| 899 | int | ||
| 900 | RSA_public_decrypt(int flen, const unsigned char *from, unsigned char *to, | ||
| 901 | RSA *rsa, int padding) | ||
| 902 | { | ||
| 903 | return rsa->meth->rsa_pub_dec(flen, from, to, rsa, padding); | ||
| 904 | } | ||
| 905 | LCRYPTO_ALIAS(RSA_public_decrypt); | ||
| 906 | |||
| 907 | int | ||
| 908 | RSA_flags(const RSA *r) | ||
| 909 | { | ||
| 910 | return r == NULL ? 0 : r->meth->flags; | ||
| 911 | } | ||
| 912 | LCRYPTO_ALIAS(RSA_flags); | ||
