pike.git / src / post_modules / Nettle / hash.cmod

version» Context lines:

pike.git/src/post_modules/Nettle/hash.cmod:1:   /* hash.cmod -*- c -*- */      #include "global.h" - RCSID("$Id: hash.cmod,v 1.3 2003/03/18 15:29:56 nisse Exp $"); + RCSID("$Id: hash.cmod,v 1.4 2003/03/18 15:41:57 nilsson Exp $");   #include "interpret.h"   #include "svalue.h"      /* For this_object() */   #include "object.h"   #include "module_support.h"      #include "nettle_config.h"      #ifdef HAVE_LIBNETTLE
pike.git/src/post_modules/Nettle/hash.cmod:103:    *! Base class for hashing contexts.    */   PIKECLASS HashState   {    INHERIT HashInfo;    CVAR void *ctx;       /* FIXME: Create should copy state from the other object, if    * provided. */    -  /*! @decl object update(string data) +  /*! @decl HashState update(string data)    *!    *! Hashes more data. -  *! @returns this_object(). +     */    PIKEFUN object update(string data)    {    const struct nettle_hash *meta = GET_META(this_object());       if (!THIS->ctx || !meta)    Pike_error("hash_state not properly initialized.");       NO_WIDE_STRING(data);    meta->update(THIS->ctx, data->len, data->str);
pike.git/src/post_modules/Nettle/hash.cmod:129:    }       /*! @decl string digest(int|void length)    *!    *! Generates a digests, and resets the hashing contents.    *!    *! @param length    *! If the length argument is provided, the digest is truncated    *! to the given length.    *! -  *! @returns the digest. +  *! @returns +  *! The digest.    */    PIKEFUN string digest(int|void arg)    {    const struct nettle_hash *meta;    struct pike_string *digest;    unsigned length;       if (! THIS->ctx)    Pike_error("hash_state not properly initialized.");