162306a36Sopenharmony_ci/* 262306a36Sopenharmony_ci * ECDH helper functions - KPP wrappings 362306a36Sopenharmony_ci * 462306a36Sopenharmony_ci * Copyright (C) 2017 Intel Corporation 562306a36Sopenharmony_ci * 662306a36Sopenharmony_ci * This program is free software; you can redistribute it and/or modify 762306a36Sopenharmony_ci * it under the terms of the GNU General Public License version 2 as 862306a36Sopenharmony_ci * published by the Free Software Foundation; 962306a36Sopenharmony_ci * 1062306a36Sopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 1162306a36Sopenharmony_ci * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 1262306a36Sopenharmony_ci * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. 1362306a36Sopenharmony_ci * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY 1462306a36Sopenharmony_ci * CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES 1562306a36Sopenharmony_ci * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 1662306a36Sopenharmony_ci * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 1762306a36Sopenharmony_ci * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 1862306a36Sopenharmony_ci * 1962306a36Sopenharmony_ci * ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, 2062306a36Sopenharmony_ci * COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS 2162306a36Sopenharmony_ci * SOFTWARE IS DISCLAIMED. 2262306a36Sopenharmony_ci */ 2362306a36Sopenharmony_ci#include <crypto/kpp.h> 2462306a36Sopenharmony_ci#include <linux/types.h> 2562306a36Sopenharmony_ci 2662306a36Sopenharmony_ciint compute_ecdh_secret(struct crypto_kpp *tfm, const u8 pair_public_key[64], 2762306a36Sopenharmony_ci u8 secret[32]); 2862306a36Sopenharmony_ciint set_ecdh_privkey(struct crypto_kpp *tfm, const u8 private_key[32]); 2962306a36Sopenharmony_ciint generate_ecdh_public_key(struct crypto_kpp *tfm, u8 public_key[64]); 3062306a36Sopenharmony_ciint generate_ecdh_keys(struct crypto_kpp *tfm, u8 public_key[64]); 31