Lines Matching refs:key

42 soft_rsa_encrypt(soft_object_t *key, CK_BYTE_PTR in, uint32_t in_len,
55 rv = soft_get_public_value(key, CKA_PUBLIC_EXPONENT, expo,
61 rv = soft_get_private_value(key, CKA_PRIVATE_EXPONENT, expo,
68 rv = soft_get_public_value(key, CKA_MODULUS, modulus, &modulus_len);
88 soft_rsa_decrypt(soft_object_t *key, CK_BYTE_PTR in, uint32_t in_len,
108 rv = soft_get_private_value(key, CKA_MODULUS, modulus, &modulus_len);
113 rv = soft_get_private_value(key, CKA_PRIME_1, prime1, &prime1_len);
116 rv = soft_rsa_encrypt(key, in, in_len, out, 0);
123 rv = soft_get_private_value(key, CKA_PRIME_2, prime2, &prime2_len);
126 rv = soft_rsa_encrypt(key, in, in_len, out, 0);
133 rv = soft_get_private_value(key, CKA_EXPONENT_1, expo1, &expo1_len);
136 rv = soft_rsa_encrypt(key, in, in_len, out, 0);
143 rv = soft_get_private_value(key, CKA_EXPONENT_2, expo2, &expo2_len);
146 rv = soft_rsa_encrypt(key, in, in_len, out, 0);
153 rv = soft_get_private_value(key, CKA_COEFFICIENT, coef, &coef_len);
156 rv = soft_rsa_encrypt(key, in, in_len, out, 0);
204 * Make a copy of the encryption or decryption key, and save it
207 * on this original key while doing encryption/decryption.
222 rsa_ctx->key = tmp_key;
246 soft_object_t *key = rsa_ctx->key;
253 rv = soft_get_public_value(key, CKA_MODULUS, modulus, &modulus_len);
311 rv = soft_rsa_encrypt(key, plain_data, modulus_len, cipher_data, 1);
322 soft_cleanup_object(key);
323 free(key);
336 soft_object_t *key = rsa_ctx->key;
342 rv = soft_get_private_value(key, CKA_MODULUS, modulus, &modulus_len);
370 rv = soft_rsa_decrypt(key, pEncrypted, modulus_len, plain_data);
403 soft_cleanup_object(key);
404 free(key);
493 rsa_ctx->key = tmp_key;
530 soft_object_t *key = rsa_ctx->key;
536 rv = soft_get_private_value(key, CKA_MODULUS, modulus, &modulus_len);
611 * Perform RSA encryption with the signer's RSA private key
614 rv = soft_rsa_decrypt(key, plain_data, modulus_len, signed_data);
631 soft_cleanup_object(key);
632 free(key);
647 soft_object_t *key = rsa_ctx->key;
652 rv = soft_get_public_value(key, CKA_MODULUS, modulus, &modulus_len);
668 * Perform RSA decryption with the signer's RSA public key
671 rv = soft_rsa_encrypt(key, pSignature, modulus_len, plain_data, 1);
741 soft_cleanup_object(key);
742 free(key);
747 soft_genRSAkey_set_attribute(soft_object_t *key, CK_ATTRIBUTE_TYPE type,
759 dst = OBJ_PUB_RSA_MOD(key);
761 dst = OBJ_PRI_RSA_MOD(key);
767 dst = OBJ_PUB_RSA_PUBEXPO(key);
769 dst = OBJ_PRI_RSA_PUBEXPO(key);
774 dst = OBJ_PRI_RSA_PRIEXPO(key);
779 dst = OBJ_PRI_RSA_PRIME1(key);
784 dst = OBJ_PRI_RSA_PRIME2(key);
789 dst = OBJ_PRI_RSA_EXPO1(key);
794 dst = OBJ_PRI_RSA_EXPO2(key);
799 dst = OBJ_PRI_RSA_COEF(key);
812 /* Copy the attribute in the key object. */
876 /* Inputs to RSA key pair generation */
885 /* Outputs from RSA key pair generation */
906 * Add modulus in public template, and add all eight key fields
983 soft_object_t *key = rsa_ctx->key;
989 rv = soft_get_private_value(key, CKA_MODULUS, modulus, &modulus_len);
996 soft_cleanup_object(key);
997 free(key);
1023 /* free the signature key */
1024 soft_cleanup_object(key);
1025 free(key);
1070 * soft_rsa_sign_common() will free the signature key.
1098 soft_object_t *key = rsa_ctx->key;
1109 /* free the verification key */
1110 soft_cleanup_object(key);
1111 free(key);
1158 * soft_rsa_verify_common() will free the verification key.
1182 soft_object_t *key = rsa_ctx->key;
1187 rv = soft_get_public_value(key, CKA_MODULUS, modulus, &modulus_len);
1198 * Perform RSA decryption with the signer's RSA public key
1201 rv = soft_rsa_encrypt(key, pSignature, modulus_len, plain_data, 1);
1272 soft_cleanup_object(key);
1273 free(key);