/*
 * Public Key Encryption
 *
 * Copyright (c) 2015, Intel Corporation
 * Authors: Tadeusz Struk <tadeusz.struk@intel.com>
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the Free
 * Software Foundation; either version 2 of the License, or (at your option)
 * any later version.
 *
 */
#ifndef _CRYPTO_AKCIPHER_INT_H
#define _CRYPTO_AKCIPHER_INT_H
#include <crypto/akcipher.h>
#include <crypto/algapi.h>

struct akcipher_instance {
	void (*free)(struct akcipher_instance *inst);
	union {
		struct {
			char head[offsetof(struct akcipher_alg, base)];
			struct crypto_instance base;
		} s;
		struct akcipher_alg alg;
	};
};

struct crypto_akcipher_spawn {
	struct crypto_spawn base;
};

/*
 * Transform internal helpers.
 */
static inline void *akcipher_request_ctx(struct akcipher_request *req)
{
	return req->__ctx;
}

static inline void *akcipher_tfm_ctx(struct crypto_akcipher *tfm)
{
	return tfm->base.__crt_ctx;
}

static inline void akcipher_request_complete(struct akcipher_request *req,
					     int err)
{
	req->base.complete(&req->base, err);
}

static inline const char *akcipher_alg_name(struct crypto_akcipher *tfm)
{
	return crypto_akcipher_tfm(tfm)->__crt_alg->cra_name;
}

static inline struct crypto_instance *akcipher_crypto_instance(
		struct akcipher_instance *inst)
{
	return container_of(&inst->alg.base, struct crypto_instance, alg);
}

static inline struct akcipher_instance *akcipher_instance(
		struct crypto_instance *inst)
{
	return container_of(&inst->alg, struct akcipher_instance, alg.base);
}

static inline struct akcipher_instance *akcipher_alg_instance(
		struct crypto_akcipher *akcipher)
{
	return akcipher_instance(crypto_tfm_alg_instance(&akcipher->base));
}

static inline void *akcipher_instance_ctx(struct akcipher_instance *inst)
{
	return crypto_instance_ctx(akcipher_crypto_instance(inst));
}

static inline void crypto_set_akcipher_spawn(
		struct crypto_akcipher_spawn *spawn,
		struct crypto_instance *inst)
{
	crypto_set_spawn(&spawn->base, inst);
}

int crypto_grab_akcipher(struct crypto_akcipher_spawn *spawn, const char *name,
		u32 type, u32 mask);

static inline struct crypto_akcipher *crypto_spawn_akcipher(
		struct crypto_akcipher_spawn *spawn)
{
	return crypto_spawn_tfm2(&spawn->base);
}

static inline void crypto_drop_akcipher(struct crypto_akcipher_spawn *spawn)
{
	crypto_drop_spawn(&spawn->base);
}

static inline struct akcipher_alg *crypto_spawn_akcipher_alg(
		struct crypto_akcipher_spawn *spawn)
{
	return container_of(spawn->base.alg, struct akcipher_alg, base);
}

/**
 * crypto_register_akcipher() -- Register public key algorithm
 *
 * Function registers an implementation of a public key verify algorithm
 *
 * @alg:	algorithm definition
 *
 * Return: zero on success; error code in case of error
 */
int crypto_register_akcipher(struct akcipher_alg *alg);

/**
 * crypto_unregister_akcipher() -- Unregister public key algorithm
 *
 * Function unregisters an implementation of a public key verify algorithm
 *
 * @alg:	algorithm definition
 */
void crypto_unregister_akcipher(struct akcipher_alg *alg);

/**
 * akcipher_register_instance() -- Unregister public key template instance
 *
 * Function registers an implementation of an asymmetric key algorithm
 * created from a template
 *
 * @tmpl:	the template from which the algorithm was created
 * @inst:	the template instance
 */
int akcipher_register_instance(struct crypto_template *tmpl,
		struct akcipher_instance *inst);
#endif
option><option value='40'>40</option></select></td></tr><tr><td class='label'>space:</td><td class='ctrl'><select name='ignorews' onchange='this.form.submit();'><option value='0' selected='selected'>include</option><option value='1'>ignore</option></select></td></tr><tr><td class='label'>mode:</td><td class='ctrl'><select name='dt' onchange='this.form.submit();'><option value='0' selected='selected'>unified</option><option value='1'>ssdiff</option><option value='2'>stat only</option></select></td></tr><tr><td/><td class='ctrl'><noscript><input type='submit' value='reload'/></noscript></td></tr></table></form></div><table summary='commit info' class='commit-info'>
<tr><th>author</th><td>Tobias Klauser &lt;tklauser@distanz.ch&gt;</td><td class='right'>2016-10-20 15:44:19 +0200</td></tr>
<tr><th>committer</th><td>Tobias Klauser &lt;tklauser@distanz.ch&gt;</td><td class='right'>2017-02-15 10:34:18 +0100</td></tr>
<tr><th>commit</th><td colspan='2' class='oid'><a href='/cgit.cgi/linux/net-next.git/commit/arch/alpha/include?h=nds-private-remove&amp;id=5db4992d8f040b8d8db0b86d42806e0c417f7ccf'>5db4992d8f040b8d8db0b86d42806e0c417f7ccf</a> (<a href='/cgit.cgi/linux/net-next.git/patch/arch/alpha/include?id=5db4992d8f040b8d8db0b86d42806e0c417f7ccf'>patch</a>)</td></tr>
<tr><th>tree</th><td colspan='2' class='oid'><a href='/cgit.cgi/linux/net-next.git/tree/?h=nds-private-remove'>5b06e952af482d45f3ade64e77824662e34b7fa2</a> /<a href='/cgit.cgi/linux/net-next.git/tree/arch/alpha/include?h=nds-private-remove'>arch/alpha/include</a></td></tr>
<tr><th>parent</th><td colspan='2' class='oid'><a href='/cgit.cgi/linux/net-next.git/commit/arch/alpha/include?h=nds-private-remove&amp;id=370ebb0ef6255132373ed35d13e7b1d8d2eb7003'>370ebb0ef6255132373ed35d13e7b1d8d2eb7003</a> (<a href='/cgit.cgi/linux/net-next.git/diff/arch/alpha/include?h=nds-private-remove&amp;id2=370ebb0ef6255132373ed35d13e7b1d8d2eb7003'>diff</a>)</td></tr></table>
<div class='commit-subject'>usbnet: pegasus: Use net_device_stats from struct net_device<span class='decoration'><a class='branch-deco' href='/cgit.cgi/linux/net-next.git/log/arch/alpha/include?h=nds-private-remove'>nds-private-remove</a></span></div><div class='commit-msg'>Instead of using a private copy of struct net_device_stats in struct
pegasus, use stats from struct net_device. Also remove the now
unnecessary .ndo_get_stats function.

Cc: Petko Manolov &lt;petkan@nucleusys.com&gt;
Cc: linux-usb@vger.kernel.org
Signed-off-by: Tobias Klauser &lt;tklauser@distanz.ch&gt;
</div><div class='diffstat-header'><a href='/cgit.cgi/linux/net-next.git/diff/?h=nds-private-remove'>Diffstat</a> (limited to 'arch/alpha/include')</div><table summary='diffstat' class='diffstat'>