frost_verify.h (1789B)
1 /* 2 This file is part of Frosix 3 Copyright (C) 2022, 2023 Joel Urech 4 5 Frosix is free software; you can redistribute it and/or modify it under the 6 terms of the GNU Affero General Public License as published by the Free Software 7 Foundation; either version 3, or (at your option) any later version. 8 9 Frosix is distributed in the hope that it will be useful, but WITHOUT ANY 10 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 11 A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. 12 13 You should have received a copy of the GNU Affero General Public License along with 14 Frosix; see the file COPYING. If not, see <http://www.gnu.org/licenses/> 15 */ 16 /** 17 * @file include/frost_verify.h 18 * @brief frosix api to verify a signature 19 * @author Joel Urech 20 */ 21 #ifndef FROST_VERIFY_H 22 #define FROST_VERIFY_H 23 24 #include "frost_high.h" 25 26 /** 27 * Verifies the validity of a given signature and hash of a message against a public key. 28 * Since we create signatures which are compatible with the widespread EdDSA signature scheme, 29 * this verification function does the same as every implementation of a EdDSA compatible verificiation function: 30 * \f$sig = (r, z)\f$ 31 * \f$c = H(r || pk || m)\f$ 32 * \f$r = g^z - pk^c\f$ ? 33 * 34 * @param[in] public_key The corresponding public key 35 * @param[in] signature The signature to verify 36 * @param[in] message_hash Hash of the message, which has been signed, as an element on the elliptic curve 37 * @return GNUNET_OK if signature is valid, otherwise GNUNET_NO 38 */ 39 enum GNUNET_GenericReturnValue 40 FROST_verify_signature (const struct FROST_PublicKey *public_key, 41 const struct FROST_Signature *signature, 42 const struct FROST_MessageHash *message_hash); 43 44 #endif