Merge tag 'armsoc-cleanup' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
[linux-2.6-block.git] / include / crypto / ecdh.h
CommitLineData
3c4b2390
SB
1/*
2 * ECDH params to be used with kpp API
3 *
4 * Copyright (c) 2016, Intel Corporation
5 * Authors: Salvatore Benedetto <salvatore.benedetto@intel.com>
6 *
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.
11 *
12 */
13#ifndef _CRYPTO_ECDH_
14#define _CRYPTO_ECDH_
15
16/* Curves IDs */
17#define ECC_CURVE_NIST_P192 0x0001
18#define ECC_CURVE_NIST_P256 0x0002
19
20struct ecdh {
21 unsigned short curve_id;
22 char *key;
23 unsigned short key_size;
24};
25
26int crypto_ecdh_key_len(const struct ecdh *params);
27int crypto_ecdh_encode_key(char *buf, unsigned int len, const struct ecdh *p);
28int crypto_ecdh_decode_key(const char *buf, unsigned int len, struct ecdh *p);
29
30#endif