Next: Multi-Precision-Integer Subsystem Architecture, Previous: Symmetric Encryption Subsystem Architecture, Up: Architecture
The interface to work with message digests and CRC algorithms is made
up of functions from the gcry_md_
name space. The
implementation follows the open-use-close paradigm and uses registered
algorithm modules for the actual work. Although CRC algorithms are
not considered cryptographic hash algorithms, they share enough
properties so that it makes sense to handle them in the same way.
It is possible to use several algorithms at once with one context and
thus compute them all on the same data.
The most important functions are:
gcry_md_open
gcry_md_enable
gcry_md_setkey
gcry_md_write
gcry_md_putc
gcry_md_write
implemented as a macro.
gcry_md_read
gcry_md_close
gcry_md_hash_buffer
There are also functions to query properties of algorithms or the instance, like enabled algorithms, digest length, map algorithm names. it is also possible to reset an instance or to copy the current state of an instance at any time. Debug functions to write the hashed data to files are available as well.