18c2ecf20Sopenharmony_ci/*
28c2ecf20Sopenharmony_ci * ECDH helper functions - KPP wrappings
38c2ecf20Sopenharmony_ci *
48c2ecf20Sopenharmony_ci * Copyright (C) 2017 Intel Corporation
58c2ecf20Sopenharmony_ci *
68c2ecf20Sopenharmony_ci * This program is free software; you can redistribute it and/or modify
78c2ecf20Sopenharmony_ci * it under the terms of the GNU General Public License version 2 as
88c2ecf20Sopenharmony_ci * published by the Free Software Foundation;
98c2ecf20Sopenharmony_ci *
108c2ecf20Sopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
118c2ecf20Sopenharmony_ci * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
128c2ecf20Sopenharmony_ci * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.
138c2ecf20Sopenharmony_ci * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY
148c2ecf20Sopenharmony_ci * CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES
158c2ecf20Sopenharmony_ci * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
168c2ecf20Sopenharmony_ci * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
178c2ecf20Sopenharmony_ci * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
188c2ecf20Sopenharmony_ci *
198c2ecf20Sopenharmony_ci * ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS,
208c2ecf20Sopenharmony_ci * COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS
218c2ecf20Sopenharmony_ci * SOFTWARE IS DISCLAIMED.
228c2ecf20Sopenharmony_ci */
238c2ecf20Sopenharmony_ci#include <crypto/kpp.h>
248c2ecf20Sopenharmony_ci#include <linux/types.h>
258c2ecf20Sopenharmony_ci
268c2ecf20Sopenharmony_ciint compute_ecdh_secret(struct crypto_kpp *tfm, const u8 pair_public_key[64],
278c2ecf20Sopenharmony_ci			u8 secret[32]);
288c2ecf20Sopenharmony_ciint set_ecdh_privkey(struct crypto_kpp *tfm, const u8 private_key[32]);
298c2ecf20Sopenharmony_ciint generate_ecdh_public_key(struct crypto_kpp *tfm, u8 public_key[64]);
308c2ecf20Sopenharmony_ciint generate_ecdh_keys(struct crypto_kpp *tfm, u8 public_key[64]);
31