aboutsummaryrefslogtreecommitdiffstats
path: root/common/util.h
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2019-01-29 17:19:05 +0000
committerWerner Koch <[email protected]>2019-01-29 19:17:29 +0000
commitdddbb26155f292fde2909ecc84b62b693b6dea49 (patch)
tree6af2d1051ea40a5ad8195a14987dceba81fbcc6d /common/util.h
parentdoc: Mark keyserver-options timeout and http-proxy as obsolete. (diff)
downloadgnupg-dddbb26155f292fde2909ecc84b62b693b6dea49.tar.gz
gnupg-dddbb26155f292fde2909ecc84b62b693b6dea49.zip
common: New helper functions for OpenPGP curve OIDs.
* common/openpgp-oid.c (openpgp_oidbuf_to_str): Factor most code out to ... (openpgp_oidbuf_to_str): new. (openpgp_oidbuf_is_ed25519): New. (openpgp_oidbuf_is_cv25519): New. -- At some places it is more convenient (and faster) to directly work on buffers and avoid the way via opaque MPIs. These 3 new functions allow for that. Signed-off-by: Werner Koch <[email protected]> (cherry picked from commit 4a1558d0c7190cf13d35385e47291a7aa121be3e)
Diffstat (limited to '')
-rw-r--r--common/util.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/common/util.h b/common/util.h
index c6d19c64b..36f1b93a4 100644
--- a/common/util.h
+++ b/common/util.h
@@ -219,8 +219,11 @@ size_t percent_unescape_inplace (char *string, int nulrepl);
/*-- openpgp-oid.c --*/
gpg_error_t openpgp_oid_from_str (const char *string, gcry_mpi_t *r_mpi);
+char *openpgp_oidbuf_to_str (const unsigned char *buf, size_t len);
char *openpgp_oid_to_str (gcry_mpi_t a);
+int openpgp_oidbuf_is_ed25519 (const void *buf, size_t len);
int openpgp_oid_is_ed25519 (gcry_mpi_t a);
+int openpgp_oidbuf_is_cv25519 (const void *buf, size_t len);
int openpgp_oid_is_cv25519 (gcry_mpi_t a);
const char *openpgp_curve_to_oid (const char *name, unsigned int *r_nbits);
const char *openpgp_oid_to_curve (const char *oid, int canon);