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

version» Context lines:

pike.git/src/post_modules/Nettle/nettle.cmod:1:   /* nettle.cmod -*- c -*- */      #include "global.h" - RCSID("$Id: nettle.cmod,v 1.32 2004/02/13 23:27:29 nilsson Exp $"); + RCSID("$Id: nettle.cmod,v 1.33 2004/02/14 07:33:57 nilsson Exp $");   #include "interpret.h"   #include "svalue.h"   /* For this_object() */   #include "object.h"   #include "operators.h"   #include "module_support.h"   #include "threads.h"      #include "nettle_config.h"   
pike.git/src/post_modules/Nettle/nettle.cmod:175:    optflags OPT_EXTERNAL_DEPEND;    {    RETURN yarrow256_needed_sources(&THIS->ctx);    }       /*! @decl string random_string(int length)    *! Returns a pseudo-random string of the requested @[length].    */    PIKEFUN string random_string(int length)    optflags OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT; -  /* We could however set this to not have side effect to allow -  unused values from not getting generated. */ +     {    struct pike_string *rnd;    if(length < 0)    Pike_error("Invalid length, must be positive.\n");    if( !yarrow256_is_seeded(&THIS->ctx) )    Pike_error("Random generator not seeded.\n");    rnd = begin_shared_string(length);    yarrow256_random(&THIS->ctx, length, rnd->str);    RETURN end_shared_string(rnd);    }