Skip to content
Snippets Groups Projects
Select Git revision
  • 56d0bc72cdefaa06deec1030f039f43f967cf603
  • master default protected
  • siv-mode
  • delete-des-compat
  • delete-rsa_blind
  • aes-struct-layout
  • master-updates
  • release-3.4-fixes
  • struct-layout
  • attribute-deprecated
  • rename-data-symbols
  • x86_64-sha_ni-sha256
  • ecc-params-tweak
  • delete-old-aes
  • cmac-support
  • x86_64-sha_ni-sha1
  • gcm-ctr-opt
  • ctr-opt
  • skein
  • api-opaque-fix
  • curve448
  • nettle_3.4.1_release_20181204
  • nettle_3.4.1rc1
  • nettle_3.4_release_20171119
  • nettle_3.4rc2
  • nettle_3.4rc1
  • nettle_3.3_release_20161001
  • nettle_3.2_release_20160128
  • nettle_3.1.1_release_20150424
  • nettle_3.1_release_20150407
  • nettle_3.1rc3
  • nettle_3.1rc2
  • nettle_3.1rc1
  • nettle_3.0_release_20140607
  • nettle_2.7.1_release_20130528
  • nettle_2.7_release_20130424
  • nettle_2.6_release_20130116
  • nettle_2.5_release_20120707
  • converted-master-branch-to-git
  • nettle_2.4_release_20110903
  • nettle_2.3_release_20110902
41 results

aes-decrypt-internal.c

Blame
  • Forked from Nettle / nettle
    Source project has a limited visibility.
    • Niels Möller's avatar
      7dcba661
      Reviewed FIXME-comments. · 7dcba661
      Niels Möller authored
      Rev: nettle/aes-decrypt-internal.c:1.2
      Rev: nettle/aes-encrypt-internal.c:1.2
      Rev: nettle/aes-internal.h:1.2
      Rev: nettle/arctwo.h:1.2
      Rev: nettle/base16-decode.c:1.2
      Rev: nettle/base16-encode.c:1.2
      Rev: nettle/base16.h:1.2
      Rev: nettle/base64.h:1.2
      Rev: nettle/bignum-random.c:1.2
      Rev: nettle/bignum.c:1.2
      Rev: nettle/bignum.h:1.3
      Rev: nettle/rsa-sign.c:1.3
      Rev: nettle/rsa-verify.c:1.3
      Rev: nettle/rsa.c:1.3
      Rev: nettle/rsa.h:1.2
      Rev: nettle/sexp-transport-format.c:1.2
      Rev: nettle/sexp.c:1.2
      Rev: nettle/sexp.h:1.2
      7dcba661
      History
      Reviewed FIXME-comments.
      Niels Möller authored
      Rev: nettle/aes-decrypt-internal.c:1.2
      Rev: nettle/aes-encrypt-internal.c:1.2
      Rev: nettle/aes-internal.h:1.2
      Rev: nettle/arctwo.h:1.2
      Rev: nettle/base16-decode.c:1.2
      Rev: nettle/base16-encode.c:1.2
      Rev: nettle/base16.h:1.2
      Rev: nettle/base64.h:1.2
      Rev: nettle/bignum-random.c:1.2
      Rev: nettle/bignum.c:1.2
      Rev: nettle/bignum.h:1.3
      Rev: nettle/rsa-sign.c:1.3
      Rev: nettle/rsa-verify.c:1.3
      Rev: nettle/rsa.c:1.3
      Rev: nettle/rsa.h:1.2
      Rev: nettle/sexp-transport-format.c:1.2
      Rev: nettle/sexp.c:1.2
      Rev: nettle/sexp.h:1.2
    constants.c 2.52 KiB
    /*\
    ||| This file a part of Pike, and is copyright by Fredrik Hubinette
    ||| Pike is distributed as GPL (General Public License)
    ||| See the files COPYING and DISCLAIMER for more information.
    \*/
    #include "global.h"
    #include "constants.h"
    #include "macros.h"
    #include "program.h"
    #include "pike_types.h"
    #include "stralloc.h"
    #include "memory.h"
    #include "interpret.h"
    #include "mapping.h"
    
    static INT32 num_callable=0;
    static struct mapping *builtin_constants = 0;
    
    struct mapping *get_builtin_constants()
    {
      if(!builtin_constants)
        builtin_constants=allocate_mapping(20);
    
      return builtin_constants;
    }
    
    void low_add_efun(struct pike_string *name, struct svalue *fun)
    {
      struct svalue s;
    
      if(!builtin_constants)
        builtin_constants=allocate_mapping(20);
    
      s.type=T_STRING;
      s.subtype=0;
      s.u.string=name;
    
      if(fun)
      {
        mapping_insert(builtin_constants, &s, fun);
      }else{
        map_delete(builtin_constants, &s);
      }
    }
    
    void low_add_constant(char *name, struct svalue *fun)
    {
      struct pike_string *p;
      p=make_shared_string(name);
      low_add_efun(p, fun);
      free_string(p);
    }
    
    void add_global_program(char *name, struct program *p)
    {
      struct svalue s;
      s.type=T_PROGRAM;
      s.subtype=0;
      s.u.program=p;
      low_add_constant(name, &s);
    }
    
    struct callable *make_callable(c_fun fun,
    			       char *name,
    			       char *type,
    			       INT16 flags,
    			       optimize_fun optimize,
    			       docode_fun docode)
    {
      struct callable *f;
      f=ALLOC_STRUCT(callable);
      num_callable++;
      f->refs=1;
      f->function=fun;
      f->name=make_shared_string(name);
      f->type=parse_type(type);
      f->flags=flags;
      f->docode=docode;
      f->optimize=optimize;
      return f;
    }
    
    void really_free_callable(struct callable *fun)
    {
      free_string(fun->type);
      free_string(fun->name);
      free((char *)fun);
      num_callable--;
    }
    
    void add_efun2(char *name,
    	       c_fun fun,
    	       char *type,
    	       INT16 flags,
    	       optimize_fun optimize,
    	       docode_fun docode)
    {
      struct svalue s;
      struct pike_string *n;
    
      n=make_shared_string(name);
      s.type=T_FUNCTION;
      s.subtype=FUNCTION_BUILTIN;
      s.u.efun=make_callable(fun, name, type, flags, optimize, docode);
      low_add_efun(n, &s);
      free_svalue(&s);
      free_string(n);
    }
    
    void add_efun(char *name, c_fun fun, char *type, INT16 flags)
    {
      add_efun2(name,fun,type,flags,0,0);
    }
    
    void cleanup_added_efuns()
    {
      if(builtin_constants)
      {
        free_mapping(builtin_constants);
        builtin_constants=0;
      }
    }
    void count_memory_in_callables(INT32 *num_, INT32 *size_)
    {
      *num_=num_callable;
      *size_=num_callable*sizeof(struct callable);
    }