Branch: Tag:

2016-03-14

2016-03-14 15:24:55 by Martin Nilsson <nilsson@fastmail.com>

Default to random_string as random function.

9:   #include "operators.h"   #include "interpret.h"   #include "module.h" + #include "mapping.h" + #include "constants.h"      #include "nettle_config.h"   
887:    (((const struct Nettle_ECC_Curve_struct *)parent_storage(1, Nettle_ECC_Curve_program))->curve);    if (!curve) Pike_error("No curve selected.\n");    ecc_scalar_init(&THIS->key, curve); -  push_constant_text("Crypto.Random.random_string"); -  APPLY_MASTER("resolv",1); -  assign_svalue(&THIS->random, Pike_sp-1); -  pop_stack(); +  +  struct svalue *random = +  simple_mapping_string_lookup(get_builtin_constants(), "random_string"); +  if(!random || (TYPEOF(*random) != T_FUNCTION)) +  Pike_error("Unable to resolve random function.\n"); +  assign_svalue(&THIS->random, random);    }       EXIT