+/* We can only ever *unset* bits, so to must only have bits in from. */
+static bool can_derive(shachain_index_t from, shachain_index_t to)
+{
+ return (~from & to) == 0;
+}
+
+static void derive(shachain_index_t from, shachain_index_t to,
+ const struct sha256 *from_hash,
+ struct sha256 *hash)