* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA
+ */
+
+/*
+ * See "Practical Secure Logging: Seekable Sequential Key Generators"
+ * by G. A. Marson, B. Poettering for details:
*
+ * http://eprint.iacr.org/2013/397
*/
#include <gcrypt.h>
((uint8_t*) buf)[7] = (x >> 0) & 0xff;
}
-static uint64_t uint64_import(const void *buf, size_t buflen) {
+_pure_ static uint64_t uint64_import(const void *buf, size_t buflen) {
assert(buflen == 8);
return
(uint64_t)(((uint8_t*) buf)[0]) << 56 |
gcry_mpi_sub_ui(phi, p, 1);
/* count number of used bits in m */
- for (n = 0; ((uint64_t)1 << n) <= m; n++)
+ for (n = 0; (1ULL << n) <= m; n++)
;
r = gcry_mpi_new(0);