linux/drivers/crypto/atmel-ecc.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Microchip / Atmel ECC (I2C) driver.
 *
 * Copyright (c) 2017, Microchip Technology Inc.
 * Author: Tudor Ambarus
 */

#include <linux/delay.h>
#include <linux/device.h>
#include <linux/err.h>
#include <linux/errno.h>
#include <linux/i2c.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/scatterlist.h>
#include <linux/slab.h>
#include <linux/workqueue.h>
#include <crypto/internal/kpp.h>
#include <crypto/ecdh.h>
#include <crypto/kpp.h>
#include "atmel-i2c.h"

static struct atmel_ecc_driver_data driver_data;

/**
 * struct atmel_ecdh_ctx - transformation context
 * @client     : pointer to i2c client device
 * @fallback   : used for unsupported curves or when user wants to use its own
 *               private key.
 * @public_key : generated when calling set_secret(). It's the responsibility
 *               of the user to not call set_secret() while
 *               generate_public_key() or compute_shared_secret() are in flight.
 * @curve_id   : elliptic curve id
 * @do_fallback: true when the device doesn't support the curve or when the user
 *               wants to use its own private key.
 */
struct atmel_ecdh_ctx {};

static void atmel_ecdh_done(struct atmel_i2c_work_data *work_data, void *areq,
			    int status)
{}

/*
 * A random private key is generated and stored in the device. The device
 * returns the pair public key.
 */
static int atmel_ecdh_set_secret(struct crypto_kpp *tfm, const void *buf,
				 unsigned int len)
{}

static int atmel_ecdh_generate_public_key(struct kpp_request *req)
{}

static int atmel_ecdh_compute_shared_secret(struct kpp_request *req)
{}

static struct i2c_client *atmel_ecc_i2c_client_alloc(void)
{}

static void atmel_ecc_i2c_client_free(struct i2c_client *client)
{}

static int atmel_ecdh_init_tfm(struct crypto_kpp *tfm)
{}

static void atmel_ecdh_exit_tfm(struct crypto_kpp *tfm)
{}

static unsigned int atmel_ecdh_max_size(struct crypto_kpp *tfm)
{}

static struct kpp_alg atmel_ecdh_nist_p256 =;

static int atmel_ecc_probe(struct i2c_client *client)
{}

static void atmel_ecc_remove(struct i2c_client *client)
{}

#ifdef CONFIG_OF
static const struct of_device_id atmel_ecc_dt_ids[] =;
MODULE_DEVICE_TABLE(of, atmel_ecc_dt_ids);
#endif

static const struct i2c_device_id atmel_ecc_id[] =;
MODULE_DEVICE_TABLE(i2c, atmel_ecc_id);

static struct i2c_driver atmel_ecc_driver =;

static int __init atmel_ecc_init(void)
{}

static void __exit atmel_ecc_exit(void)
{}

module_init();
module_exit(atmel_ecc_exit);

MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();