helper function for easy EdDSA key setup More...
Go to the source code of this file.
Macros | |
| #define | LOG(kind, ...) GNUNET_log_from (kind, "util-crypto-ecc", __VA_ARGS__) |
| #define | LOG_STRERROR(kind, syscall) GNUNET_log_from_strerror (kind, "util-crypto-ecc", syscall) |
| #define | LOG_STRERROR_FILE(kind, syscall, filename) |
| #define | LOG_GCRY(level, cmd, rc) |
| Log an error message at log-level 'level' that indicates a failure of the command 'cmd' with the message given by gcry_strerror(rc). | |
Functions | |
| static enum GNUNET_GenericReturnValue | read_from_file (const char *filename, void *buf, size_t buf_size) |
| Read file to buf. | |
| enum GNUNET_GenericReturnValue | GNUNET_CRYPTO_eddsa_key_from_file (const char *filename, int do_create, struct GNUNET_CRYPTO_EddsaPrivateKey *pkey) |
| Create a new private key by reading it from a file. | |
| enum GNUNET_GenericReturnValue | GNUNET_CRYPTO_ecdsa_key_from_file (const char *filename, int do_create, struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey) |
| Create a new private key by reading it from a file. | |
| struct GNUNET_CRYPTO_EddsaPrivateKey * | GNUNET_CRYPTO_eddsa_key_create_from_configuration (const struct GNUNET_CONFIGURATION_Handle *cfg) |
| Create a new private key by reading our peer's key from the file specified in the configuration. | |
| enum GNUNET_GenericReturnValue | GNUNET_CRYPTO_get_peer_identity (const struct GNUNET_CONFIGURATION_Handle *cfg, struct GNUNET_PeerIdentity *dst) |
| Retrieve the identity of the host's peer. | |
| enum GNUNET_GenericReturnValue | GNUNET_CRYPTO_blinded_key_sign_by_peer_identity (const struct GNUNET_CONFIGURATION_Handle *cfg, const struct GNUNET_CRYPTO_SignaturePurpose *purpose, struct GNUNET_CRYPTO_EddsaSignature *sig) |
| Sign a given block with a specific purpose using the host's peer identity. | |
| enum GNUNET_GenericReturnValue | GNUNET_CRYPTO_verify_peer_identity (uint32_t purpose, const struct GNUNET_CRYPTO_SignaturePurpose *validate, const struct GNUNET_CRYPTO_EddsaSignature *sig, const struct GNUNET_PeerIdentity *identity) |
| Verify a given signature with a peer's identity. | |
helper function for easy EdDSA key setup
Definition in file crypto_ecc_setup.c.
| #define LOG | ( | kind, | |
| ... | |||
| ) | GNUNET_log_from (kind, "util-crypto-ecc", __VA_ARGS__) |
Definition at line 31 of file crypto_ecc_setup.c.
| #define LOG_STRERROR | ( | kind, | |
| syscall | |||
| ) | GNUNET_log_from_strerror (kind, "util-crypto-ecc", syscall) |
Definition at line 33 of file crypto_ecc_setup.c.
| #define LOG_STRERROR_FILE | ( | kind, | |
| syscall, | |||
| filename | |||
| ) |
Definition at line 36 of file crypto_ecc_setup.c.
| #define LOG_GCRY | ( | level, | |
| cmd, | |||
| rc | |||
| ) |
Log an error message at log-level 'level' that indicates a failure of the command 'cmd' with the message given by gcry_strerror(rc).
Definition at line 45 of file crypto_ecc_setup.c.
|
static |
Read file to buf.
Fails if the file does not exist or does not have precisely buf_size bytes.
| filename | file to read | |
| [out] | buf | where to write the file contents |
| buf_size | number of bytes in buf |
Definition at line 67 of file crypto_ecc_setup.c.
References filename, GNUNET_assert, GNUNET_ERROR_TYPE_WARNING, GNUNET_log, GNUNET_log_strerror_file, GNUNET_OK, and GNUNET_SYSERR.
Referenced by GNUNET_CRYPTO_ecdsa_key_from_file(), and GNUNET_CRYPTO_eddsa_key_from_file().