From 926b1f1f1e3e382f08cc57fc86d5892649514007 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Fri, 14 Mar 2025 13:03:46 +0100 Subject: Add API gpgme_op_random_value. * src/genrandom.c (getrandom_size_t): New. (gpgme_op_random_value): New. * src/gpgme.def: Add new function. * src/libgpgme.vers: Ditto. * src/gpgme.h.in: Add prototype. * tests/run-genrandom.c: Add an option to use the new function. -- The implementation is not optimized but sufficient for our use case. Possible improvements for this and gpgme_op_random_bytes are a cache for random bytes in the context so that we do not need to get out to gpgme for just a few random bytes. GnuPG-bug-id: 6694 --- NEWS | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'NEWS') diff --git a/NEWS b/NEWS index 481da3a0..7544d42c 100644 --- a/NEWS +++ b/NEWS @@ -1,8 +1,11 @@ Noteworthy changes in version 2.0.0 (unreleased) ------------------------------------------------ - * New function gpgme_op_random_bytes to get cryptographically strng - random bytes from gpg. + * New function gpgme_op_random_bytes to get cryptographically + strong random bytes from gpg. [T6694] + + * New function gpgme_op_random_value to get a cryptographically + strong unsigned integer random value. [T6694] * Removed the gpgme_attr_t enums and their functions which were deprecated since 2003. [rMd54d6eaa64] @@ -16,6 +19,7 @@ Noteworthy changes in version 2.0.0 (unreleased) * Interface changes relative to the 1.24 branch: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ gpgme_op_random_bytes NEW. + gpgme_op_random_value NEW. GPGME_RANDOM_MODE_NORMAL NEW. GPGME_RANDOM_MODE_ZBASE32 NEW. gpgme_attr_t REMOVED. -- cgit v1.2.3