pike.git
/
src
/
post_modules
/
Nettle
/
nettle.cmod
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/src/post_modules/Nettle/nettle.cmod:1:
/* nettle.cmod -*- c -*- */ #include "global.h"
-
RCSID("$Id: nettle.cmod,v 1.
27
2004/01/
22
23:
10
:
00
nilsson Exp $");
+
RCSID("$Id: nettle.cmod,v 1.
28
2004/01/
23
01
:
05
:
06
nilsson Exp $");
#include "interpret.h" #include "svalue.h" /* For this_object() */ #include "object.h" #include "operators.h" #include "module_support.h" #include "nettle_config.h" #ifdef HAVE_LIBNETTLE
pike.git/src/post_modules/Nettle/nettle.cmod:142:
*! *! @seealso *! @[create] */ PIKEFUN int(0..1) update(string data, int source, int entropy) { /* FIXME: Wide strings could actually be supported here */ NO_WIDE_STRING(data); if( !THIS->sources ) Pike_error("This random generator has no sources.\n");
-
if( source<0 || source>=THIS->ctx.nsources )
+
if( source<0 ||
(unsigned)
source>=THIS->ctx.nsources )
Pike_error("Invalid random source.\n"); if( entropy<0 ) Pike_error("Entropy must be positive.\n"); if( entropy>(data->len*8) ) Pike_error("Impossibly large entropy value.\n"); RETURN yarrow256_update(&THIS->ctx, source, entropy, data->len, data->str); } /*! @decl int(0..) needed_sources() *! The number of sources that must reach the threshold before a
pike.git/src/post_modules/Nettle/nettle.cmod:214:
static const char *crypto_functions[] = { "block_size", "key_size", "set_encrypt_key", "set_decrypt_key", "crypt", 0 };
-
static char * assert_is_crypto_object(struct program *p,
+
static
const
char * assert_is_crypto_object(struct program *p,
const char **required) { while (*required) { if (find_identifier( (char *) *required, p) < 0) return *required; required++; } return 0; } static struct object *make_cipher_object(INT32 args) { ptrdiff_t fun;
-
char *missing;
+
const
char *missing;
struct svalue *top = Pike_sp-args; struct object *obj; switch(top->type) { case T_PROGRAM: obj = clone_object(top->u.program, args-1); break; case T_FUNCTION: