DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH
 

(gcrypt.info.gz) Hash algorithm modules

Info Catalog (gcrypt.info.gz) Available hash algorithms (gcrypt.info.gz) Hashing (gcrypt.info.gz) Working with hash algorithms
 
 6.2 Hash algorithm modules
 ==========================
 
 Libgcrypt makes it possible to load additional `message digest
 modules'; these cipher can be used just like the message digest
 algorithms that are built into the library directly.  For an
 introduction into extension modules, see  Modules.
 
  -- Data type: gcry_md_spec_t
      This is the `module specification structure' needed for registering
      message digest modules, which has to be filled in by the user
      before it can be used to register a module.  It contains the
      following members:
 
     `const char *name'
           The primary name of this algorithm.
 
     `unsigned char *asnoid'
           Array of bytes that form the ASN OID.
 
     `int asnlen'
           Length of bytes in `asnoid'.
 
     `gcry_md_oid_spec_t *oids'
           A list of OIDs that are to be associated with the algorithm.
           The list's last element must have it's `oid' member set to
           NULL.  See below for an explanation of this type.  See below
           for an explanation of this type.
 
     `int mdlen'
           Length of the message digest algorithm.  See below for an
           explanation of this type.
 
     `gcry_md_init_t init'
           The function responsible for initializing a handle.  See
           below for an explanation of this type.
 
     `gcry_md_write_t write'
           The function responsible for writing data into a message
           digest context.  See below for an explanation of this type.
 
     `gcry_md_final_t final'
           The function responsible for `finalizing' a message digest
           context.  See below for an explanation of this type.
 
     `gcry_md_read_t read'
           The function responsible for reading out a message digest
           result.  See below for an explanation of this type.
 
     `size_t contextsize'
           The size of the algorithm-specific `context', that should be
           allocated for each handle.
 
  -- Data type: gcry_md_oid_spec_t
      This type is used for associating a user-provided algorithm
      implementation with certain OIDs.  It contains the following
      members:
 
     `const char *oidstring'
           Textual representation of the OID.
 
  -- Data type: gcry_md_init_t
      Type for the `init' function, defined as: void (*gcry_md_init_t)
      (void *c)
 
  -- Data type: gcry_md_write_t
      Type for the `write' function, defined as: void (*gcry_md_write_t)
      (void *c, unsigned char *buf, size_t nbytes)
 
  -- Data type: gcry_md_final_t
      Type for the `final' function, defined as: void (*gcry_md_final_t)
      (void *c)
 
  -- Data type: gcry_md_read_t
      Type for the `read' function, defined as: unsigned char
      *(*gcry_md_read_t) (void *c)
 
  -- Function: gcry_error_t gcry_md_register (gcry_md_spec_t *DIGEST,
           unsigned int *algorithm_id, gcry_module_t *MODULE)
      Register a new digest module whose specification can be found in
      DIGEST.  On success, a new algorithm ID is stored in ALGORITHM_ID
      and a pointer representing this module is stored in MODULE.
 
  -- Function: void gcry_md_unregister (gcry_module_t MODULE)
      Unregister the digest identified by MODULE, which must have been
      registered with gcry_md_register.
 
  -- Function: gcry_error_t gcry_md_list (int *LIST, int *LIST_LENGTH)
      Get a list consisting of the IDs of the loaded message digest
      modules.  If LIST is zero, write the number of loaded message
      digest modules to LIST_LENGTH and return.  If LIST is non-zero,
      the first *LIST_LENGTH algorithm IDs are stored in LIST, which
      must be of according size.  In case there are less message digests
      modules than *LIST_LENGTH, *LIST_LENGTH is updated to the correct
      number.
 
Info Catalog (gcrypt.info.gz) Available hash algorithms (gcrypt.info.gz) Hashing (gcrypt.info.gz) Working with hash algorithms
automatically generated byinfo2html