Home | History | Annotate | Download | only in rsa_extra

Lines Matching refs:rsa

56 #include <openssl/rsa.h>
67 #include "../fipsmodule/rsa/internal.h"
83 // An RSA object may be missing some components.
84 OPENSSL_PUT_ERROR(RSA, RSA_R_VALUE_MISSING);
90 RSA *RSA_parse_public_key(CBS *cbs) {
91 RSA *ret = RSA_new();
100 OPENSSL_PUT_ERROR(RSA, RSA_R_BAD_ENCODING);
107 OPENSSL_PUT_ERROR(RSA, RSA_R_BAD_RSA_PARAMETERS);
115 RSA *RSA_public_key_from_bytes(const uint8_t *in, size_t in_len) {
118 RSA *ret = RSA_parse_public_key(&cbs);
120 OPENSSL_PUT_ERROR(RSA, RSA_R_BAD_ENCODING);
127 int RSA_marshal_public_key(CBB *cbb, const RSA *rsa) {
130 !marshal_integer(&child, rsa->n) ||
131 !marshal_integer(&child, rsa->e) ||
133 OPENSSL_PUT_ERROR(RSA, RSA_R_ENCODE_ERROR);
140 const RSA *rsa) {
144 !RSA_marshal_public_key(&cbb, rsa) ||
146 OPENSSL_PUT_ERROR(RSA, RSA_R_ENCODE_ERROR);
157 RSA *RSA_parse_private_key(CBS *cbs) {
158 RSA *ret = RSA_new();
167 OPENSSL_PUT_ERROR(RSA, RSA_R_BAD_ENCODING);
172 OPENSSL_PUT_ERROR(RSA, RSA_R_BAD_VERSION);
188 OPENSSL_PUT_ERROR(RSA, RSA_R_BAD_ENCODING);
193 OPENSSL_PUT_ERROR(RSA, RSA_R_BAD_RSA_PARAMETERS);
204 RSA *RSA_private_key_from_bytes(const uint8_t *in, size_t in_len) {
207 RSA *ret = RSA_parse_private_key(&cbs);
209 OPENSSL_PUT_ERROR(RSA, RSA_R_BAD_ENCODING);
216 int RSA_marshal_private_key(CBB *cbb, const RSA *rsa) {
220 !marshal_integer(&child, rsa->n) ||
221 !marshal_integer(&child, rsa->e) ||
222 !marshal_integer(&child, rsa->d) ||
223 !marshal_integer(&child, rsa->p) ||
224 !marshal_integer(&child, rsa->q) ||
225 !marshal_integer(&child, rsa->dmp1) ||
226 !marshal_integer(&child, rsa->dmq1) ||
227 !marshal_integer(&child, rsa->iqmp) ||
229 OPENSSL_PUT_ERROR(RSA, RSA_R_ENCODE_ERROR);
236 const RSA *rsa) {
240 !RSA_marshal_private_key(&cbb, rsa) ||
242 OPENSSL_PUT_ERROR(RSA, RSA_R_ENCODE_ERROR);
249 RSA *d2i_RSAPublicKey(RSA **out, const uint8_t **inp, long len) {
255 RSA *ret = RSA_parse_public_key(&cbs);
267 int i2d_RSAPublicKey(const RSA *in, uint8_t **outp) {
277 RSA *d2i_RSAPrivateKey(RSA **out, const uint8_t **inp, long len) {
283 RSA *ret = RSA_parse_private_key(&cbs);
295 int i2d_RSAPrivateKey(const RSA *in, uint8_t **outp) {
305 RSA *RSAPublicKey_dup(const RSA *rsa) {
308 if (!RSA_public_key_to_bytes(&der, &der_len, rsa)) {
311 RSA *ret = RSA_public_key_from_bytes(der, der_len);
316 RSA *RSAPrivateKey_dup(const RSA *rsa) {
319 if (!RSA_private_key_to_bytes(&der, &der_len, rsa)) {
322 RSA *ret = RSA_private_key_from_bytes(der, der_len);