Lines Matching refs:key

42 soft_rsa_encrypt(soft_object_t *key, CK_BYTE_PTR in, uint32_t in_len,
57 rv = soft_get_public_value(key, CKA_PUBLIC_EXPONENT, expo,
63 rv = soft_get_private_value(key, CKA_PRIVATE_EXPONENT, expo,
70 rv = soft_get_public_value(key, CKA_MODULUS, modulus, &modulus_len);
92 soft_rsa_decrypt(soft_object_t *key, CK_BYTE_PTR in, uint32_t in_len,
114 rv = soft_get_private_value(key, CKA_MODULUS, modulus, &modulus_len);
119 rv = soft_get_private_value(key, CKA_PRIME_1, prime1, &prime1_len);
122 rv = soft_rsa_encrypt(key, in, in_len, out, 0);
129 rv = soft_get_private_value(key, CKA_PRIME_2, prime2, &prime2_len);
132 rv = soft_rsa_encrypt(key, in, in_len, out, 0);
139 rv = soft_get_private_value(key, CKA_EXPONENT_1, expo1, &expo1_len);
142 rv = soft_rsa_encrypt(key, in, in_len, out, 0);
149 rv = soft_get_private_value(key, CKA_EXPONENT_2, expo2, &expo2_len);
152 rv = soft_rsa_encrypt(key, in, in_len, out, 0);
159 rv = soft_get_private_value(key, CKA_COEFFICIENT, coef, &coef_len);
162 rv = soft_rsa_encrypt(key, in, in_len, out, 0);
212 * Make a copy of the encryption or decryption key, and save it
215 * on this original key while doing encryption/decryption.
230 rsa_ctx->key = tmp_key;
244 soft_object_t *key = rsa_ctx->key;
251 rv = soft_get_public_value(key, CKA_MODULUS, modulus, &modulus_len);
309 rv = soft_rsa_encrypt(key, plain_data, modulus_len, cipher_data, 1);
319 soft_cleanup_object(key);
320 free(key);
333 soft_object_t *key = rsa_ctx->key;
339 rv = soft_get_private_value(key, CKA_MODULUS, modulus, &modulus_len);
367 rv = soft_rsa_decrypt(key, pEncrypted, modulus_len, plain_data);
399 soft_cleanup_object(key);
400 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);
612 * Perform RSA encryption with the signer's RSA private key
615 rv = soft_rsa_decrypt(key, plain_data, modulus_len, signed_data);
632 soft_cleanup_object(key);
633 free(key);
648 soft_object_t *key = rsa_ctx->key;
653 rv = soft_get_public_value(key, CKA_MODULUS, modulus, &modulus_len);
669 * Perform RSA decryption with the signer's RSA public key
672 rv = soft_rsa_encrypt(key, pSignature, modulus_len, plain_data, 1);
744 soft_cleanup_object(key);
745 free(key);
750 soft_genRSAkey_set_attribute(soft_object_t *key, CK_ATTRIBUTE_TYPE type,
762 dst = OBJ_PUB_RSA_MOD(key);
764 dst = OBJ_PRI_RSA_MOD(key);
770 dst = OBJ_PUB_RSA_PUBEXPO(key);
772 dst = OBJ_PRI_RSA_PUBEXPO(key);
777 dst = OBJ_PRI_RSA_PRIEXPO(key);
782 dst = OBJ_PRI_RSA_PRIME1(key);
787 dst = OBJ_PRI_RSA_PRIME2(key);
792 dst = OBJ_PRI_RSA_EXPO1(key);
797 dst = OBJ_PRI_RSA_EXPO2(key);
802 dst = OBJ_PRI_RSA_COEF(key);
815 /* Copy the attribute in the key object. */
879 /* Inputs to RSA key pair generation */
888 /* Outputs from RSA key pair generation */
909 * Add modulus in public template, and add all eight key fields
986 soft_object_t *key = rsa_ctx->key;
992 rv = soft_get_private_value(key, CKA_MODULUS, modulus, &modulus_len);
999 soft_cleanup_object(key);
1000 free(key);
1026 /* free the signature key */
1027 soft_cleanup_object(key);
1028 free(key);
1079 * soft_rsa_sign_common() will free the signature key.
1107 soft_object_t *key = rsa_ctx->key;
1118 /* free the verification key */
1119 soft_cleanup_object(key);
1120 free(key);
1173 * soft_rsa_verify_common() will free the verification key.
1197 soft_object_t *key = rsa_ctx->key;
1202 rv = soft_get_public_value(key, CKA_MODULUS, modulus, &modulus_len);
1213 * Perform RSA decryption with the signer's RSA public key
1216 rv = soft_rsa_encrypt(key, pSignature, modulus_len, plain_data, 1);
1287 soft_cleanup_object(key);
1288 free(key);