|
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 | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
|
3 | 3 | * All rights reserved.
|
4 | 4 | *
|
@@ -857,3 +857,56 @@ RSA_PKCS1_SSLeay(void)
|
857 | 857 | return RSA_PKCS1_OpenSSL();
|
858 | 858 | }
|
859 | 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); |
0 commit comments