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

version» Context lines:

pike.git/src/post_modules/Nettle/hash.cmod:1:   /* -*- c -*-   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: hash.cmod,v 1.32 2009/02/24 22:52:48 grubba Exp $ + || $Id: hash.cmod,v 1.33 2010/06/18 15:51:14 mast Exp $   */      #include "global.h"   #include "interpret.h"   #include "svalue.h"   #include "threads.h"      /* For this_object() */   #include "object.h"   #include "module_support.h"
pike.git/src/post_modules/Nettle/hash.cmod:120:    const struct nettle_hash *meta = THIS->meta;       if (!meta)    Pike_error("HashInfo not properly initialized.\n");    NO_WIDE_STRING(in);       ctx = (void *)alloca(meta->context_size);    if(!ctx)    SIMPLE_OUT_OF_MEMORY_ERROR("hash", meta->context_size);    -  THREADS_ALLOW(); +  /* THREADS_ALLOW(); */    meta->init(ctx);    meta->update(ctx, in->len, (const uint8_t *)in->str);       digest_length = meta->digest_size;    out = begin_shared_string(digest_length);    meta->digest(ctx, digest_length, (uint8_t *)out->str); -  THREADS_DISALLOW(); +  /* THREADS_DISALLOW(); */       pop_n_elems(args);    push_string(end_shared_string(out));    }       /*! @decl string hash(Stdio.File file, void|int bytes)    *!    *! Works as a (faster) shortcut for    *! @expr{obj->update(Stdio.read_file(file))->digest()@}.    *!