diff options
Diffstat (limited to 'src/include/gnunet_crypto_lib.h')
-rw-r--r-- | src/include/gnunet_crypto_lib.h | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/src/include/gnunet_crypto_lib.h b/src/include/gnunet_crypto_lib.h index 289aa5649..2a975a440 100644 --- a/src/include/gnunet_crypto_lib.h +++ b/src/include/gnunet_crypto_lib.h | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of GNUnet. | 2 | This file is part of GNUnet. |
3 | Copyright (C) 2001-2013 GNUnet e.V. | 3 | Copyright (C) 2001-2023 GNUnet e.V. |
4 | 4 | ||
5 | GNUnet is free software: you can redistribute it and/or modify it | 5 | GNUnet is free software: you can redistribute it and/or modify it |
6 | under the terms of the GNU Affero General Public License as published | 6 | under the terms of the GNU Affero General Public License as published |
@@ -1645,6 +1645,39 @@ GNUNET_CRYPTO_get_peer_identity (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
1645 | 1645 | ||
1646 | 1646 | ||
1647 | /** | 1647 | /** |
1648 | * @ingroup crypto | ||
1649 | * Sign a given block with a specific purpose using the host's peer identity. | ||
1650 | * | ||
1651 | * @param cfg configuration to use | ||
1652 | * @param purpose what to sign (size, purpose) | ||
1653 | * @param sig where to write the signature | ||
1654 | * @return #GNUNET_OK on success, #GNUNET_SYSERR if the identity | ||
1655 | * could not be retrieved | ||
1656 | */ | ||
1657 | enum GNUNET_GenericReturnValue | ||
1658 | GNUNET_CRYPTO_sign_by_peer_identity (const struct GNUNET_CONFIGURATION_Handle *cfg, | ||
1659 | const struct GNUNET_CRYPTO_EccSignaturePurpose *purpose, | ||
1660 | struct GNUNET_CRYPTO_EddsaSignature *sig); | ||
1661 | |||
1662 | |||
1663 | /** | ||
1664 | * @ingroup crypto | ||
1665 | * Verify a given signature with a peer's identity. | ||
1666 | * | ||
1667 | * @param purpose what is the purpose that the signature should have? | ||
1668 | * @param validate block to validate (size, purpose, data) | ||
1669 | * @param sig signature that is being validated | ||
1670 | * @param identity the peer's identity to verify | ||
1671 | * @return #GNUNET_OK if ok, #GNUNET_SYSERR if invalid | ||
1672 | */ | ||
1673 | enum GNUNET_GenericReturnValue | ||
1674 | GNUNET_CRYPTO_verify_peer_identity (uint32_t purpose, | ||
1675 | const struct GNUNET_CRYPTO_EccSignaturePurpose * validate, | ||
1676 | const struct GNUNET_CRYPTO_EddsaSignature *sig, | ||
1677 | const struct GNUNET_PeerIdentity *identity); | ||
1678 | |||
1679 | |||
1680 | /** | ||
1648 | * Internal structure used to cache pre-calculated values for DLOG calculation. | 1681 | * Internal structure used to cache pre-calculated values for DLOG calculation. |
1649 | */ | 1682 | */ |
1650 | struct GNUNET_CRYPTO_EccDlogContext; | 1683 | struct GNUNET_CRYPTO_EccDlogContext; |