Overview
In MUFL, cryptographic hash values use domain HASH_CODE.
_print (_typeof (_value_id 1)). // prints: "HASH_CODE"
All data and code in ADAPT is hash-addressed. All hashing is “deep”, that is, the hash accounts for all values in a data structure.
The exception to this rule is references whose hashes do not account for the data that they refer to.
The hash code of a data item is retrieved using the _value_id primitive function. The hash code of the currently-running application is determined with _get_code_id function.
The information about the hash is retrieved using _get_hash_code_metadata function:
_get_hash_code_metadata (_value_id 1). // returns ("hash_shape_version"->("maj"->1,"min"->0,),"hash_type"->"S256",)
As you can see, hash metadata consists of the type of hash and of the version of its “shape”. Shape refers to the process used to hash complex values and may change when ADAPT is upgraded. The hash_type field reports the algorithm: "S256" for SHA-256, "BL2B" for BLAKE2b.
The default canonical hash used by ADAPT is SHA-256. This is the hash that addresses all data and code, that
_value_id,_get_state_id, and_get_code_idreturn, and that underlies packet IDs and the blinded dictionary. The framework also supports BLAKE2b. It is possible to switch the hash used by ADAPT; contact the ADAPT Team for details of how to do this, if necessary.