+static void subkeypath(char *buffer, size_t length, uint64_t subkey,
+ uint64_t keyid)
+{
+ snprintf(buffer, length, "%s/subkeys/%02X/%02X/%08X/%016" PRIX64,
+ config.db_dir,
+ (uint8_t) ((subkey >> 24) & 0xFF),
+ (uint8_t) ((subkey >> 16) & 0xFF),
+ (uint32_t) (subkey & 0xFFFFFFFF),
+ keyid);
+}
+
+static void skshashpath(char *buffer, size_t length,
+ const struct skshash *hash)
+{
+ snprintf(buffer, length, "%s/skshash/%02X/%02X/%02X%02X%02X%02X/"
+ "%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X",
+ config.db_dir,
+ hash->hash[0], hash->hash[1],
+ hash->hash[0], hash->hash[1], hash->hash[2], hash->hash[3],
+ hash->hash[4], hash->hash[5], hash->hash[6], hash->hash[7],
+ hash->hash[8], hash->hash[9], hash->hash[10], hash->hash[11],
+ hash->hash[12], hash->hash[13], hash->hash[14],
+ hash->hash[15]);
+}
+static void subkeydir(char *buffer, size_t length, uint64_t subkey)
+{
+ snprintf(buffer, length, "%s/subkeys/%02X/%02X/%08X",
+ config.db_dir,
+ (uint8_t) ((subkey >> 24) & 0xFF),
+ (uint8_t) ((subkey >> 16) & 0xFF),
+ (uint32_t) (subkey & 0xFFFFFFFF));
+}
+