of: MSI: Simplify irqdomain lookup
[linux/fpc-iii.git] / include / crypto / internal / akcipher.h
blob9a2bda15e45451244e983c8fb64929c5651d5e58
1 /*
2 * Public Key Encryption
4 * Copyright (c) 2015, Intel Corporation
5 * Authors: Tadeusz Struk <tadeusz.struk@intel.com>
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the Free
9 * Software Foundation; either version 2 of the License, or (at your option)
10 * any later version.
13 #ifndef _CRYPTO_AKCIPHER_INT_H
14 #define _CRYPTO_AKCIPHER_INT_H
15 #include <crypto/akcipher.h>
18 * Transform internal helpers.
20 static inline void *akcipher_request_ctx(struct akcipher_request *req)
22 return req->__ctx;
25 static inline void *akcipher_tfm_ctx(struct crypto_akcipher *tfm)
27 return tfm->base.__crt_ctx;
30 static inline void akcipher_request_complete(struct akcipher_request *req,
31 int err)
33 req->base.complete(&req->base, err);
36 static inline const char *akcipher_alg_name(struct crypto_akcipher *tfm)
38 return crypto_akcipher_tfm(tfm)->__crt_alg->cra_name;
41 /**
42 * crypto_register_akcipher() -- Register public key algorithm
44 * Function registers an implementation of a public key verify algorithm
46 * @alg: algorithm definition
48 * Return: zero on success; error code in case of error
50 int crypto_register_akcipher(struct akcipher_alg *alg);
52 /**
53 * crypto_unregister_akcipher() -- Unregister public key algorithm
55 * Function unregisters an implementation of a public key verify algorithm
57 * @alg: algorithm definition
59 void crypto_unregister_akcipher(struct akcipher_alg *alg);
60 #endif