blob: a6f8d03d4aaf65514da3462eda3594c4795362f5 [file] [log] [blame]
Salvatore Benedetto58771c1c2017-04-24 13:13:20 +01001/*
2 * ECDH helper functions - KPP wrappings
3 *
4 * Copyright (C) 2017 Intel Corporation
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation;
9 *
10 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
11 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
12 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.
13 * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY
14 * CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES
15 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18 *
19 * ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS,
20 * COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS
21 * SOFTWARE IS DISCLAIMED.
22 */
Tudor Ambarus47eb2ac2017-09-28 17:14:51 +030023#include <crypto/kpp.h>
Salvatore Benedetto58771c1c2017-04-24 13:13:20 +010024#include <linux/types.h>
25
Tudor Ambarusc0153b02017-09-28 17:14:55 +030026int compute_ecdh_secret(struct crypto_kpp *tfm, const u8 pair_public_key[64],
27 u8 secret[32]);
28int set_ecdh_privkey(struct crypto_kpp *tfm, const u8 *private_key);
29int generate_ecdh_public_key(struct crypto_kpp *tfm, u8 public_key[64]);
30int generate_ecdh_keys(struct crypto_kpp *tfm, u8 public_key[64]);