Lines Matching +full:key +full:- +full:code

1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 * Public Key Encryption
15 * struct akcipher_request - public key cipher request
40 * struct crypto_akcipher - user-instantiated objects which encapsulate
53 * struct akcipher_alg - generic public key cipher algorithm
55 * @encrypt: Function performs an encrypt operation as defined by public key
57 * the req->dst_len will be updated to the size required for the
59 * @decrypt: Function performs a decrypt operation as defined by public key
61 * the req->dst_len will be updated to the size required for the
63 * @set_pub_key: Function invokes the algorithm specific set public key
65 * the BER encoded public key and parameters
66 * @set_priv_key: Function invokes the algorithm specific set private key
68 * the BER encoded private key and parameters
69 * @max_size: Function returns dest buffer size required for a given key.
87 int (*set_pub_key)(struct crypto_akcipher *tfm, const void *key,
89 int (*set_priv_key)(struct crypto_akcipher *tfm, const void *key,
99 * DOC: Generic Public Key Cipher API
101 * The Public Key Cipher API is used with the algorithms of type
106 * crypto_alloc_akcipher() - allocate AKCIPHER tfm handle
108 * public key algorithm e.g. "rsa"
112 * Allocate a handle for public key algorithm. The returned struct
114 * API invocation for the public key operations.
117 * of an error, PTR_ERR() returns the error code.
125 return &tfm->base; in crypto_akcipher_tfm()
142 return __crypto_akcipher_alg(crypto_akcipher_tfm(tfm)->__crt_alg); in crypto_akcipher_alg()
147 return tfm->reqsize; in crypto_akcipher_reqsize()
153 req->base.tfm = crypto_akcipher_tfm(tfm); in akcipher_request_set_tfm()
159 return __crypto_akcipher_tfm(req->base.tfm); in crypto_akcipher_reqtfm()
163 * crypto_free_akcipher() - free AKCIPHER tfm handle
175 * akcipher_request_alloc() - allocates public key request
195 * akcipher_request_free() - zeroize and free public key request
205 * akcipher_request_set_callback() - Sets an asynchronous callback.
220 req->base.complete = cmpl; in akcipher_request_set_callback()
221 req->base.data = data; in akcipher_request_set_callback()
222 req->base.flags = flgs; in akcipher_request_set_callback()
226 * akcipher_request_set_crypt() - Sets request parameters
230 * @req: public key request
242 req->src = src; in akcipher_request_set_crypt()
243 req->dst = dst; in akcipher_request_set_crypt()
244 req->src_len = src_len; in akcipher_request_set_crypt()
245 req->dst_len = dst_len; in akcipher_request_set_crypt()
249 * crypto_akcipher_maxsize() - Get len for output buffer
251 * Function returns the dest buffer size required for a given key.
252 * Function assumes that the key is already set in the transformation. If this
262 return alg->max_size(tfm); in crypto_akcipher_maxsize()
266 * crypto_akcipher_encrypt() - Invoke public key encrypt operation
268 * Function invokes the specific public key encrypt operation for a given
269 * public key algorithm
271 * @req: asymmetric key request
273 * Return: zero on success; error code in case of error
279 return crypto_akcipher_alg(tfm)->encrypt(req); in crypto_akcipher_encrypt()
283 * crypto_akcipher_decrypt() - Invoke public key decrypt operation
285 * Function invokes the specific public key decrypt operation for a given
286 * public key algorithm
288 * @req: asymmetric key request
290 * Return: zero on success; error code in case of error
296 return crypto_akcipher_alg(tfm)->decrypt(req); in crypto_akcipher_decrypt()
300 * crypto_akcipher_sync_encrypt() - Invoke public key encrypt operation
302 * Function invokes the specific public key encrypt operation for a given
303 * public key algorithm
311 * Return: zero on success; error code in case of error
318 * crypto_akcipher_sync_decrypt() - Invoke public key decrypt operation
320 * Function invokes the specific public key decrypt operation for a given
321 * public key algorithm
329 * Return: Output length on success; error code in case of error
336 * crypto_akcipher_set_pub_key() - Invoke set public key operation
338 * Function invokes the algorithm specific set key function, which knows
339 * how to decode and interpret the encoded key and parameters
342 * @key: BER encoded public key, algo OID, paramlen, BER encoded
344 * @keylen: length of the key (not including other data)
346 * Return: zero on success; error code in case of error
349 const void *key, in crypto_akcipher_set_pub_key() argument
354 return alg->set_pub_key(tfm, key, keylen); in crypto_akcipher_set_pub_key()
358 * crypto_akcipher_set_priv_key() - Invoke set private key operation
360 * Function invokes the algorithm specific set key function, which knows
361 * how to decode and interpret the encoded key and parameters
364 * @key: BER encoded private key, algo OID, paramlen, BER encoded
366 * @keylen: length of the key (not including other data)
368 * Return: zero on success; error code in case of error
371 const void *key, in crypto_akcipher_set_priv_key() argument
376 return alg->set_priv_key(tfm, key, keylen); in crypto_akcipher_set_priv_key()