/* Generated from "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod" by precompile.pike running Pike v8.0 release 1017
 *
 * Do NOT edit this file.
 */

#undef PRECOMPILE_API_VERSION
#define PRECOMPILE_API_VERSION 6

#undef PRECOMPILE_SUB_PIKEVARS
#define PRECOMPILE_SUB_PIKEVARS 1

#undef PRECOMPILE_DYNAMIC_TYPES
#define PRECOMPILE_DYNAMIC_TYPES 1



#undef cmod___CMOD__
#define cmod___CMOD__ 1
#line 1 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
#line 1 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
#line 1 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
#line 3003 "/Users/hww3/devel/pike/lib/modules/Tools.pmod/Standalone.pmod/precompile.pike"







#line 3010 "/Users/hww3/devel/pike/lib/modules/Tools.pmod/Standalone.pmod/precompile.pike"
#line 1 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
#line 1 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
/* -*- 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.
*/

#include "global.h"
#include "interpret.h"
#include "svalue.h"
#include "threads.h"

/* For this_object() */
#include "object.h"
#include "module_support.h"
#include "pike_memory.h"

#include "nettle_config.h"

#ifdef HAVE_LIBNETTLE



#ifndef PIKE_UNUSED_ATTRIBUTE
#define PIKE_UNUSED_ATTRIBUTE
#endif
#define CMOD_MAP_PROGRAM_IDS_DEFINED 1
static int ___cmod_map_program_ids(int id) PIKE_UNUSED_ATTRIBUTE;
#ifndef TYPEOF
/* Compat with older Pikes. */
#define TYPEOF(SVAL)	((SVAL).type)
#define SUBTYPEOF(SVAL)	((SVAL).subtype)
#define SET_SVAL_TYPE(SVAL, TYPE)	(TYPEOF(SVAL) = TYPE)
#define SET_SVAL_SUBTYPE(SVAL, TYPE)	(SUBTYPEOF(SVAL) = TYPE)
#define SET_SVAL(SVAL, TYPE, SUBTYPE, FIELD, EXPR) do {	\
    /* Set the type afterwards to avoid a clobbered	\
     * svalue in case EXPR throws. */			\
    (SVAL).u.FIELD = (EXPR);				\
    SET_SVAL_TYPE((SVAL), (TYPE));			\
    SET_SVAL_SUBTYPE((SVAL), (SUBTYPE));		\
  } while(0)
#endif /* !TYPEOF */
#ifndef PIKE_UNUSED
/* Compat with Pike 7.8 and earlier. */
/* NB: Not strictly correct; PIKE_UNUSED was added the
 *     day after set_program_id_to_id(), but good enough.
 */
#ifndef UNUSED
#define UNUSED(X)	X
#endif
#ifndef set_program_id_to_id
/* NB: Recent Pike 7.8 has a #define that conflicts with
 *     the following declaration.
 */
static void set_program_id_to_id(void*UNUSED(id)){}
#endif
#else /* */
PMOD_EXPORT void set_program_id_to_id( int (*to)(int) );
#endif /* !PIKE_UNUSED */


#ifndef DEFAULT_CMOD_STORAGE
#define CMOD_COND_USED
#define DEFAULT_CMOD_STORAGE static
#endif
#define module_strings_declared
static struct pike_string *module_strings[2] = {
  NULL,
  NULL,
};
#ifndef CMOD_COND_USED
# define f_Nettle_MAC_name_fun_num_used 1
#else
#undef f_Nettle_MAC_name_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Nettle_MAC_block_size_fun_num_used 1
#else
#undef f_Nettle_MAC_block_size_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Nettle_MAC_key_size_fun_num_used 1
#else
#undef f_Nettle_MAC_key_size_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Nettle_MAC_iv_size_fun_num_used 1
#else
#undef f_Nettle_MAC_iv_size_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define Nettle_MAC_program_fun_num_used 1
#else
#undef Nettle_MAC_program_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define Nettle_UMAC32_AES_program_fun_num_used 1
#else
#undef Nettle_UMAC32_AES_program_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define Nettle_POLY1305_AES_program_fun_num_used 1
#else
#undef Nettle_POLY1305_AES_program_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define Nettle_POLY1305_AES_State_program_fun_num_used 1
#else
#undef Nettle_POLY1305_AES_State_program_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Nettle_MAC_State_create_fun_num_used 1
#else
#undef f_Nettle_MAC_State_create_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define Nettle_MAC_State_program_fun_num_used 1
#else
#undef Nettle_MAC_State_program_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Nettle_MAC_digest_size_fun_num_used 1
#else
#undef f_Nettle_MAC_digest_size_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Nettle_MAC_State_set_iv_fun_num_used 1
#else
#undef f_Nettle_MAC_State_set_iv_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Nettle_MAC_State_digest_fun_num_used 1
#else
#undef f_Nettle_MAC_State_digest_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Nettle_MAC_State_update_fun_num_used 1
#else
#undef f_Nettle_MAC_State_update_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define Nettle_UMAC32_AES_State_program_fun_num_used 1
#else
#undef Nettle_UMAC32_AES_State_program_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define f_Nettle_MAC_State_cq__backtick_28_29_fun_num_used 1
#else
#undef f_Nettle_MAC_State_cq__backtick_28_29_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define Nettle_UMAC64_AES_program_fun_num_used 1
#else
#undef Nettle_UMAC64_AES_program_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define Nettle_UMAC64_AES_State_program_fun_num_used 1
#else
#undef Nettle_UMAC64_AES_State_program_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define Nettle_UMAC96_AES_program_fun_num_used 1
#else
#undef Nettle_UMAC96_AES_program_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define Nettle_UMAC128_AES_State_program_fun_num_used 1
#else
#undef Nettle_UMAC128_AES_State_program_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define Nettle_UMAC128_AES_program_fun_num_used 1
#else
#undef Nettle_UMAC128_AES_program_fun_num_used
#endif
#ifndef CMOD_COND_USED
# define Nettle_UMAC96_AES_State_program_fun_num_used 1
#else
#undef Nettle_UMAC96_AES_State_program_fun_num_used
#endif
#line 23 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
#include "nettle.h"

#ifdef HAVE_NETTLE_POLY1305_H
#include <nettle/poly1305.h>
#endif
#ifdef HAVE_NETTLE_UMAC_H
#include <nettle/umac.h>
#endif
#include <nettle/nettle-meta.h>

#include <stdio.h>
#include <stdarg.h>
#include "fdlib.h"

/*! @module Nettle */

struct pike_mac
{
const char *name;

unsigned context_size;

unsigned digest_size;

unsigned block_size;

/* Suggested key size; other sizes are sometimes possible. */
unsigned key_size;

unsigned iv_size;

/* NB: Use nettle_hash_update_func here to get both a length field,
   *     and a const uint8_t source.
   */
pike_nettle_hash_update_func set_key;
pike_nettle_hash_update_func set_iv;

pike_nettle_hash_update_func update;
pike_nettle_hash_digest_func digest;
};

#define _PIKE_MAC(name, NAME) {					\
    #name,							\
    sizeof(struct name##_ctx),					\
    NAME##_DIGEST_SIZE,						\
    NAME##_BLOCK_SIZE,						\
    NAME##_KEY_SIZE,						\
    NAME##_IV_SIZE,						\
    (pike_nettle_hash_update_func)pike_##name##_set_key,	\
    (pike_nettle_hash_update_func)pike_##name##_set_iv,		\
    (pike_nettle_hash_update_func)name##_update,		\
    (pike_nettle_hash_digest_func)name##_digest,		\
  }

/*! @class MAC
 *!
 *! Represents information about a MAC algorithm, such as
 *! name, key size, digest size, and internal block size.
 */

#undef class_Nettle_MAC_defined
#define class_Nettle_MAC_defined
DEFAULT_CMOD_STORAGE struct program *Nettle_MAC_program=NULL;

#ifdef Nettle_MAC_program_fun_num_used
DEFAULT_CMOD_STORAGE int Nettle_MAC_program_fun_num=-1;
#endif /* Nettle_MAC_program_fun_num_used */
/*! @decl inherit __builtin.Nettle.MAC
   */

#undef inherit_cq__22__builtin_2ENettle_2EMAC_22_Nettle_MAC_defined
#define inherit_cq__22__builtin_2ENettle_2EMAC_22_Nettle_MAC_defined
#line 86 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
static int Nettle_MAC_cq__22__builtin_2ENettle_2EMAC_22_inh_num = -1;
#line 86 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
static int Nettle_MAC_cq__22__builtin_2ENettle_2EMAC_22_inh_offset = -1;

#undef var_meta_Nettle_MAC_defined
#define var_meta_Nettle_MAC_defined

#undef THIS
#define THIS ((struct Nettle_MAC_struct *)(Pike_interpreter.frame_pointer->current_storage))

#undef THIS_NETTLE_MAC
#define THIS_NETTLE_MAC ((struct Nettle_MAC_struct *)(Pike_interpreter.frame_pointer->current_storage))

#undef OBJ2_NETTLE_MAC
#define OBJ2_NETTLE_MAC(o) ((struct Nettle_MAC_struct *)(o->storage+Nettle_MAC_storage_offset))

#undef GET_NETTLE_MAC_STORAGE
#define GET_NETTLE_MAC_STORAGE(o) ((struct Nettle_MAC_struct *)(o->storage+Nettle_MAC_storage_offset)
static ptrdiff_t Nettle_MAC_storage_offset;
struct Nettle_MAC_struct {

#ifdef var_meta_Nettle_MAC_defined
#line 88 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
const struct pike_mac *meta;
#endif /* var_meta_Nettle_MAC_defined */
};
#ifdef PIKE_DEBUG
/* Ensure the struct is used in a variable declaration, or else gdb might not see it. */
static struct Nettle_MAC_struct *Nettle_MAC_gdb_dummy_ptr;
#endif
/*! @decl string(0..255) name(void)
   *!
   *! Returns a human readable name for the algorithm.
   */
#define f_Nettle_MAC_name_defined

#ifdef f_Nettle_MAC_name_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Nettle_MAC_name_fun_num = 0;

#endif /* f_Nettle_MAC_name_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Nettle_MAC_name(INT32 args) {
#line 94 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
if(args != 0) wrong_number_of_args_error("name",args,0);
#line 96 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
{
if (!THIS->meta)
Pike_error("MAC not properly initialized.\n");

push_text(THIS->meta->name);
}

}
/*! @decl int(0..) digest_size(void)
   *!
   *! Returns the size of a MAC digest.
   */
#define f_Nettle_MAC_digest_size_defined

#ifdef f_Nettle_MAC_digest_size_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Nettle_MAC_digest_size_fun_num = 0;

#endif /* f_Nettle_MAC_digest_size_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Nettle_MAC_digest_size(INT32 args) {
#line 107 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
if(args != 0) wrong_number_of_args_error("digest_size",args,0);
#line 109 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
{
if (!THIS->meta)
Pike_error("MAC not properly initialized.\n");

push_int(THIS->meta->digest_size);
}

}
/*! @decl int(0..) block_size(void)
   *!
   *! Returns the internal block size of the MAC algorithm.
   */
#define f_Nettle_MAC_block_size_defined

#ifdef f_Nettle_MAC_block_size_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Nettle_MAC_block_size_fun_num = 0;

#endif /* f_Nettle_MAC_block_size_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Nettle_MAC_block_size(INT32 args) {
#line 120 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
if(args != 0) wrong_number_of_args_error("block_size",args,0);
#line 122 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
{
if (!THIS->meta)
Pike_error("MAC not properly initialized.\n");

push_int(THIS->meta->block_size);
}

}
/*! @decl int(0..) key_size(void)
   *!
   *! Returns the recommended size for the secret key for the MAC algorithm.
   */
#define f_Nettle_MAC_key_size_defined

#ifdef f_Nettle_MAC_key_size_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Nettle_MAC_key_size_fun_num = 0;

#endif /* f_Nettle_MAC_key_size_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Nettle_MAC_key_size(INT32 args) {
#line 133 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
if(args != 0) wrong_number_of_args_error("key_size",args,0);
#line 135 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
{
if (!THIS->meta)
Pike_error("MAC not properly initialized.\n");

push_int(THIS->meta->key_size);
}

}
/*! @decl int(0..) iv_size(void)
   *!
   *! Returns the size of the iv/nonce of the MAC algorithm (if any).
   *!
   *! Returns @expr{0@} (zero) if there is no configurable iv/nonce.
   */
#define f_Nettle_MAC_iv_size_defined

#ifdef f_Nettle_MAC_iv_size_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Nettle_MAC_iv_size_fun_num = 0;

#endif /* f_Nettle_MAC_iv_size_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Nettle_MAC_iv_size(INT32 args) {
#line 148 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
if(args != 0) wrong_number_of_args_error("iv_size",args,0);
#line 150 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
{
if (!THIS->meta)
Pike_error("MAC not properly initialized.\n");

push_int(THIS->meta->iv_size);
}

}

#undef internal_init_Nettle_MAC_defined
#define internal_init_Nettle_MAC_defined

#undef Nettle_MAC_event_handler_defined
#define Nettle_MAC_event_handler_defined
static void init_Nettle_MAC_struct(void)
#line 158 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
{
THIS->meta = NULL;
}

/*! @class State
   *!
   *! Base class for MAC contexts.
   */

#undef class_Nettle_MAC_State_defined
#define class_Nettle_MAC_State_defined
DEFAULT_CMOD_STORAGE struct program *Nettle_MAC_State_program=NULL;

#ifdef Nettle_MAC_State_program_fun_num_used
DEFAULT_CMOD_STORAGE int Nettle_MAC_State_program_fun_num=-1;
#endif /* Nettle_MAC_State_program_fun_num_used */
/*! @decl inherit MAC::State
*/


#undef extra_Nettle_MAC_State_defined
#define extra_Nettle_MAC_State_defined
#line 197 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
#define GET_META(o)						\
    ( ((struct Nettle_MAC_struct *)parent_storage(1, Nettle_MAC_program))->meta )


#undef var_ctx_Nettle_MAC_State_defined
#define var_ctx_Nettle_MAC_State_defined

#undef THIS
#define THIS ((struct Nettle_MAC_State_struct *)(Pike_interpreter.frame_pointer->current_storage))

#undef THIS_NETTLE_MAC_STATE
#define THIS_NETTLE_MAC_STATE ((struct Nettle_MAC_State_struct *)(Pike_interpreter.frame_pointer->current_storage))

#undef OBJ2_NETTLE_MAC_STATE
#define OBJ2_NETTLE_MAC_STATE(o) ((struct Nettle_MAC_State_struct *)(o->storage+Nettle_MAC_State_storage_offset))

#undef GET_NETTLE_MAC_STATE_STORAGE
#define GET_NETTLE_MAC_STATE_STORAGE(o) ((struct Nettle_MAC_State_struct *)(o->storage+Nettle_MAC_State_storage_offset)
static ptrdiff_t Nettle_MAC_State_storage_offset;
struct Nettle_MAC_State_struct {

#ifdef var_ctx_Nettle_MAC_State_defined
#line 200 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
void *ctx;
#endif /* var_ctx_Nettle_MAC_State_defined */
};
#ifdef PIKE_DEBUG
/* Ensure the struct is used in a variable declaration, or else gdb might not see it. */
static struct Nettle_MAC_State_struct *Nettle_MAC_State_gdb_dummy_ptr;
#endif
/*! @decl void create(string(8bit) key)
     *!
     *! Initialize the MAC with a password.
     *!
     *! It also resets any iv/nonce to it's default.
     */
#define f_Nettle_MAC_State_create_defined

#ifdef f_Nettle_MAC_State_create_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Nettle_MAC_State_create_fun_num = 0;

#endif /* f_Nettle_MAC_State_create_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Nettle_MAC_State_create(INT32 args) {
#line 208 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
struct pike_string * key;
#line 208 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
if(args != 1) wrong_number_of_args_error("create",args,1);
#line 208 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
if(TYPEOF(Pike_sp[0-1]) != PIKE_T_STRING) SIMPLE_ARG_TYPE_ERROR("create",1,"string(0..255)");
#line 208 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
debug_malloc_pass(key=Pike_sp[0-1].u.string);
#line 210 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
{
void *ctx = THIS->ctx;
const struct pike_mac *meta =
GET_META(Pike_fp->current_object);

key->flags |= STRING_CLEAR_ON_EXIT;
NO_WIDE_STRING(key);

if (!meta)
Pike_error("MAC not properly initialized.\n");

meta->set_key(ctx, key->len, STR0(key));

pop_n_elems(args);
}

}
/*! @decl State set_iv(string(0..255) iv)
     *!
     *! Set the iv/nonce (if supported) for the MAC.
     *!
     *! @returns
     *!   Returns @expr{this@} in order to simplify chaining
     *!   of function calls.
     */
#define f_Nettle_MAC_State_set_iv_defined

#ifdef f_Nettle_MAC_State_set_iv_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Nettle_MAC_State_set_iv_fun_num = 0;

#endif /* f_Nettle_MAC_State_set_iv_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Nettle_MAC_State_set_iv(INT32 args) {
#line 234 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
struct pike_string * iv;
#line 234 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
if(args != 1) wrong_number_of_args_error("set_iv",args,1);
#line 234 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
if(TYPEOF(Pike_sp[0-1]) != PIKE_T_STRING) SIMPLE_ARG_TYPE_ERROR("set_iv",1,"string(0..255)");
#line 234 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
debug_malloc_pass(iv=Pike_sp[0-1].u.string);
#line 237 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
{
void *ctx = THIS->ctx;
const struct pike_mac *meta =
GET_META(Pike_fp->current_object);

if (!ctx || !meta)
Pike_error("State not properly initialized.\n");

iv->flags |= STRING_CLEAR_ON_EXIT;
NO_WIDE_STRING(iv);

/* NB: Check iv length here so that we can use the
       *     Nettle implementation straight in meta->set_iv.
       */
if (((unsigned)iv->len > meta->iv_size) || !meta->iv_size) {
Pike_error("Invalid iv/nonce.\n");
}

meta->set_iv(ctx, iv->len, STR0(iv));

push_object(this_object());
}

}
/*! @decl State update(string(0..255) data)
     *!
     *! Hashes more data.
     *!
     *! @returns
     *!   Returns @expr{this@} in order to simplify chaining
     *!   of function calls.
     */
#define f_Nettle_MAC_State_update_defined

#ifdef f_Nettle_MAC_State_update_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Nettle_MAC_State_update_fun_num = 0;

#endif /* f_Nettle_MAC_State_update_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Nettle_MAC_State_update(INT32 args) {
#line 268 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
struct pike_string * data;
#line 268 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
if(args != 1) wrong_number_of_args_error("update",args,1);
#line 268 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
if(TYPEOF(Pike_sp[0-1]) != PIKE_T_STRING) SIMPLE_ARG_TYPE_ERROR("update",1,"string(0..255)");
#line 268 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
debug_malloc_pass(data=Pike_sp[0-1].u.string);
#line 271 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
{
void *ctx = THIS->ctx;
const struct pike_mac *meta =
GET_META(Pike_fp->current_object);

if (!ctx || !meta)
Pike_error("State not properly initialized.\n");

NO_WIDE_STRING(data);

/* Only thread this block for significant data size */
if (data->len > HASH_THREADS_ALLOW_THRESHOLD) {
THREADS_ALLOW();
meta->update(ctx, data->len, (const uint8_t *)data->str);
THREADS_DISALLOW();
} else {
meta->update(ctx, data->len, (const uint8_t *)data->str);
}

push_object(this_object());
}

}
/*! @decl string(0..255) digest(int|void length)
     *!
     *! Generates a digest, and resets the MAC contents.
     *!
     *! Also updates the iv/nonce (if any).
     *!
     *! @param length
     *!   If the length argument is provided, the digest is truncated
     *!   to the given length.
     *!
     *! @returns
     *!   The digest.
     */
#define f_Nettle_MAC_State_digest_defined

#ifdef f_Nettle_MAC_State_digest_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Nettle_MAC_State_digest_fun_num = 0;

#endif /* f_Nettle_MAC_State_digest_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Nettle_MAC_State_digest(INT32 args) {
#line 306 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
struct svalue * arg;
#line 306 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
if(args > 1) wrong_number_of_args_error("digest",args,1);
#line 306 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
if ((args > 0) &&
    ((TYPEOF(Pike_sp[0-args]) != PIKE_T_INT) ||
     (SUBTYPEOF(Pike_sp[0-args]) != NUMBER_UNDEFINED))) {
#line 306 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
if(TYPEOF(Pike_sp[0-args]) != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("digest",1,"int|void");
#line 306 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
arg=Pike_sp+0-args; dmalloc_touch_svalue(Pike_sp+0-args);
#line 306 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
} else arg = NULL;
{
const struct pike_mac *meta;
struct pike_string *digest;
unsigned length;

meta = GET_META(Pike_fp->current_object);

if (!THIS->ctx || !meta)
Pike_error("State not properly initialized.\n");

if (!arg)
length = meta->digest_size;
else
{
if (TYPEOF(*arg) != PIKE_T_INT)
Pike_error("Bad argument type.\n");
if (arg->u.integer < 0)
Pike_error("Invalid length, must be positive.\n");
if ((unsigned)arg->u.integer > meta->digest_size)
Pike_error("Unsupported digest length.\n");

length = arg->u.integer;
}

digest = begin_shared_string(length);
meta->digest(THIS->ctx, length, (uint8_t *)digest->str);
push_string(end_shared_string(digest));
}

}
/*! @decl string(8bit) `()(string(8bit) data)
     *! Acts as the combination of @[update()] followed by @[digest()].
     *!
     *! @note
     *!   Also updates the iv/nonce (if any).
     */
#define f_Nettle_MAC_State_cq__backtick_28_29_defined

#ifdef f_Nettle_MAC_State_cq__backtick_28_29_fun_num_used
DEFAULT_CMOD_STORAGE ptrdiff_t f_Nettle_MAC_State_cq__backtick_28_29_fun_num = 0;

#endif /* f_Nettle_MAC_State_cq__backtick_28_29_fun_num_used */
DEFAULT_CMOD_STORAGE void f_Nettle_MAC_State_cq__backtick_28_29(INT32 args) {
#line 342 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
struct pike_string * data;
#line 342 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
if(args != 1) wrong_number_of_args_error("`()",args,1);
#line 342 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
if(TYPEOF(Pike_sp[0-1]) != PIKE_T_STRING) SIMPLE_ARG_TYPE_ERROR("`()",1,"string(0..255)");
#line 342 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
debug_malloc_pass(data=Pike_sp[0-1].u.string);
{
const struct pike_mac *meta;
struct pike_string *digest;

meta = GET_META(Pike_fp->current_object);

if (!THIS->ctx || !meta)
Pike_error("State not properly initialized.\n");

NO_WIDE_STRING(data);

meta->update(&THIS->ctx, data->len, STR0(data));

digest = begin_shared_string(meta->digest_size);
meta->digest(&THIS->ctx, meta->digest_size, STR0(digest));

push_string(end_shared_string(digest));
}

}

#undef internal_init_Nettle_MAC_State_defined
#define internal_init_Nettle_MAC_State_defined

#undef Nettle_MAC_State_event_handler_defined
#define Nettle_MAC_State_event_handler_defined
static void init_Nettle_MAC_State_struct(void)
#line 363 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
{
THIS->ctx = NULL;
}


#undef Nettle_MAC_State_gc_live_obj
#define Nettle_MAC_State_gc_live_obj

#undef internal_exit_Nettle_MAC_State_defined
#define internal_exit_Nettle_MAC_State_defined

#undef Nettle_MAC_State_event_handler_defined
#define Nettle_MAC_State_event_handler_defined
static void exit_Nettle_MAC_State_struct(void)
#line 368 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
{
if (THIS->ctx)
{
const struct pike_mac *meta =
GET_META(Pike_fp->current_object);
if (meta) {
memset(THIS->ctx, 0, meta->context_size);
}
}
}

#ifdef Nettle_MAC_State_event_handler_defined
static void Nettle_MAC_State_event_handler(int ev) {
  switch(ev) {

#ifdef internal_init_Nettle_MAC_State_defined
  case PROG_EVENT_INIT: init_Nettle_MAC_State_struct(); break;

#endif /* internal_init_Nettle_MAC_State_defined */

#ifdef internal_exit_Nettle_MAC_State_defined
  case PROG_EVENT_EXIT: exit_Nettle_MAC_State_struct(); break;

#endif /* internal_exit_Nettle_MAC_State_defined */
  default: break; 
  }
}

#endif /* Nettle_MAC_State_event_handler_defined */
/*! @endclass State */

#ifdef Nettle_MAC_event_handler_defined
static void Nettle_MAC_event_handler(int ev) {
  switch(ev) {

#ifdef internal_init_Nettle_MAC_defined
  case PROG_EVENT_INIT: init_Nettle_MAC_struct(); break;

#endif /* internal_init_Nettle_MAC_defined */
  default: break; 
  }
}

#endif /* Nettle_MAC_event_handler_defined */
/*! @endclass MAC */

#line 385 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
/* The algorithm objects can be overloaded in pike. */



#ifdef HAVE_NETTLE_POLY1305_H

#define poly1305_aes_set_iv	poly1305_aes_set_nonce
#define POLY1305_AES_BLOCK_SIZE	POLY1305_BLOCK_SIZE
#define POLY1305_AES_IV_SIZE	POLY1305_AES_NONCE_SIZE

static void pike_poly1305_aes_set_key(void *ctx, pike_nettle_size_t len,
const uint8_t *key)
{
if (len != POLY1305_AES_KEY_SIZE) {
Pike_error("Invalid key length.\n");
}
poly1305_aes_set_key(ctx, key);
}

static void pike_poly1305_aes_set_iv(void *ctx, pike_nettle_size_t len,
const uint8_t *key)
{
if (len != POLY1305_AES_IV_SIZE) {
Pike_error("Invalid iv length.\n");
}
poly1305_aes_set_nonce(ctx, key);
}



#line 1 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
#line 1 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
/* -*- C -*-
 *
 * Cmod header-file acting as a template for the MAC classes.
 */

/*! @class POLY1305_AES
*!
*! Implementation of the POLY1305_AES MAC algorithm.
*!
*/

#undef class_Nettle_POLY1305_AES_defined
#define class_Nettle_POLY1305_AES_defined
DEFAULT_CMOD_STORAGE struct program *Nettle_POLY1305_AES_program=NULL;

#ifdef Nettle_POLY1305_AES_program_fun_num_used
DEFAULT_CMOD_STORAGE int Nettle_POLY1305_AES_program_fun_num=-1;
#endif /* Nettle_POLY1305_AES_program_fun_num_used */
/*! @decl inherit MAC
*/

#undef inherit_Nettle_MAC_Nettle_POLY1305_AES_defined
#define inherit_Nettle_MAC_Nettle_POLY1305_AES_defined
#line 15 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
static int Nettle_POLY1305_AES_Nettle_MAC_inh_num = -1;
#line 15 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
static int Nettle_POLY1305_AES_Nettle_MAC_inh_offset = -1;
#line 17 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
static const struct pike_mac pike_poly1305_aes =
_PIKE_MAC(poly1305_aes, POLY1305_AES);


#undef internal_init_Nettle_POLY1305_AES_defined
#define internal_init_Nettle_POLY1305_AES_defined

#undef Nettle_POLY1305_AES_event_handler_defined
#define Nettle_POLY1305_AES_event_handler_defined
static void init_Nettle_POLY1305_AES_struct(void)
#line 21 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
{
struct Nettle_MAC_struct *mac;
ASSIGN_CURRENT_STORAGE(mac, struct Nettle_MAC_struct, 1,
Nettle_MAC_program);
mac->meta = &pike_poly1305_aes;
}

/*! @class State
*!
*! State for POLY1305_AES macing.
*!
*/

#undef class_Nettle_POLY1305_AES_State_defined
#define class_Nettle_POLY1305_AES_State_defined
DEFAULT_CMOD_STORAGE struct program *Nettle_POLY1305_AES_State_program=NULL;

#ifdef Nettle_POLY1305_AES_State_program_fun_num_used
DEFAULT_CMOD_STORAGE int Nettle_POLY1305_AES_State_program_fun_num=-1;
#endif /* Nettle_POLY1305_AES_State_program_fun_num_used */
/*! @decl inherit MAC::State
*/


#undef extra_Nettle_POLY1305_AES_State_defined
#define extra_Nettle_POLY1305_AES_State_defined

#undef var_poly1305_aes_Nettle_POLY1305_AES_State_defined
#define var_poly1305_aes_Nettle_POLY1305_AES_State_defined

#undef THIS
#define THIS ((struct Nettle_POLY1305_AES_State_struct *)(Pike_interpreter.frame_pointer->current_storage))

#undef THIS_NETTLE_POLY1305_AES_STATE
#define THIS_NETTLE_POLY1305_AES_STATE ((struct Nettle_POLY1305_AES_State_struct *)(Pike_interpreter.frame_pointer->current_storage))

#undef OBJ2_NETTLE_POLY1305_AES_STATE
#define OBJ2_NETTLE_POLY1305_AES_STATE(o) ((struct Nettle_POLY1305_AES_State_struct *)(o->storage+Nettle_POLY1305_AES_State_storage_offset))

#undef GET_NETTLE_POLY1305_AES_STATE_STORAGE
#define GET_NETTLE_POLY1305_AES_STATE_STORAGE(o) ((struct Nettle_POLY1305_AES_State_struct *)(o->storage+Nettle_POLY1305_AES_State_storage_offset)
static ptrdiff_t Nettle_POLY1305_AES_State_storage_offset;
struct Nettle_POLY1305_AES_State_struct {

#ifdef var_poly1305_aes_Nettle_POLY1305_AES_State_defined
#line 64 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
struct poly1305_aes_ctx poly1305_aes;
#endif /* var_poly1305_aes_Nettle_POLY1305_AES_State_defined */
};
#ifdef PIKE_DEBUG
/* Ensure the struct is used in a variable declaration, or else gdb might not see it. */
static struct Nettle_POLY1305_AES_State_struct *Nettle_POLY1305_AES_State_gdb_dummy_ptr;
#endif

#undef internal_init_Nettle_POLY1305_AES_State_defined
#define internal_init_Nettle_POLY1305_AES_State_defined

#undef Nettle_POLY1305_AES_State_event_handler_defined
#define Nettle_POLY1305_AES_State_event_handler_defined
static void init_Nettle_POLY1305_AES_State_struct(void)
#line 67 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
{
struct Nettle_MAC_State_struct *instance;
ASSIGN_CURRENT_STORAGE(instance, struct Nettle_MAC_State_struct, 1,
Nettle_MAC_State_program);
instance->ctx = &THIS->poly1305_aes;
}

#ifdef Nettle_POLY1305_AES_State_event_handler_defined
static void Nettle_POLY1305_AES_State_event_handler(int ev) {
  switch(ev) {

#ifdef internal_init_Nettle_POLY1305_AES_State_defined
  case PROG_EVENT_INIT: init_Nettle_POLY1305_AES_State_struct(); break;

#endif /* internal_init_Nettle_POLY1305_AES_State_defined */
  default: break; 
  }
}

#endif /* Nettle_POLY1305_AES_State_event_handler_defined */
/*! @endclass State
*/


#ifdef Nettle_POLY1305_AES_event_handler_defined
static void Nettle_POLY1305_AES_event_handler(int ev) {
  switch(ev) {

#ifdef internal_init_Nettle_POLY1305_AES_defined
  case PROG_EVENT_INIT: init_Nettle_POLY1305_AES_struct(); break;

#endif /* internal_init_Nettle_POLY1305_AES_defined */
  default: break; 
  }
}

#endif /* Nettle_POLY1305_AES_event_handler_defined */
/*! @endclass POLY1305_AES
*/


#line 82 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
#line 415 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"




#line 419 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
#endif

#ifdef HAVE_NETTLE_UMAC_H

/* These really ought to be in the <nettle/umac.h> header file, but...
 *
 * They are now in the upcoming Nettle 3.0.
 */
#ifndef UMAC_BLOCK_SIZE
#define UMAC_BLOCK_SIZE		UMAC_DATA_SIZE
#endif
#ifndef UMAC_MAX_NONCE_SIZE
#define UMAC_MAX_NONCE_SIZE	16
#endif
#ifndef UMAC_NONCE_SIZE
#define UMAC_NONCE_SIZE		UMAC_MAX_NONCE_SIZE
#endif

#define UMAC32_AES_BLOCK_SIZE	UMAC_BLOCK_SIZE
#define UMAC32_AES_KEY_SIZE	UMAC_KEY_SIZE
#define UMAC32_AES_IV_SIZE	UMAC_NONCE_SIZE
#define UMAC32_AES_DIGEST_SIZE	UMAC32_DIGEST_SIZE
#define pike_umac32_set_iv	umac32_set_nonce

static void pike_umac32_set_key(void *ctx, pike_nettle_size_t len,
const uint8_t *key)
{
if (len != UMAC_KEY_SIZE) {
Pike_error("Invalid key length.\n");
}
umac32_set_key(ctx, key);
}



#line 1 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
#line 1 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
/* -*- C -*-
 *
 * Cmod header-file acting as a template for the MAC classes.
 */

/*! @class UMAC32_AES
*!
*! Implementation of the UMAC32_AES MAC algorithm.
*!
*/

#undef class_Nettle_UMAC32_AES_defined
#define class_Nettle_UMAC32_AES_defined
DEFAULT_CMOD_STORAGE struct program *Nettle_UMAC32_AES_program=NULL;

#ifdef Nettle_UMAC32_AES_program_fun_num_used
DEFAULT_CMOD_STORAGE int Nettle_UMAC32_AES_program_fun_num=-1;
#endif /* Nettle_UMAC32_AES_program_fun_num_used */
/*! @decl inherit MAC
*/

#undef inherit_Nettle_MAC_Nettle_UMAC32_AES_defined
#define inherit_Nettle_MAC_Nettle_UMAC32_AES_defined
#line 15 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
static int Nettle_UMAC32_AES_Nettle_MAC_inh_num = -1;
#line 15 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
static int Nettle_UMAC32_AES_Nettle_MAC_inh_offset = -1;
#line 17 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
static const struct pike_mac pike_umac32 =
_PIKE_MAC(umac32, UMAC32_AES);


#undef internal_init_Nettle_UMAC32_AES_defined
#define internal_init_Nettle_UMAC32_AES_defined

#undef Nettle_UMAC32_AES_event_handler_defined
#define Nettle_UMAC32_AES_event_handler_defined
static void init_Nettle_UMAC32_AES_struct(void)
#line 21 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
{
struct Nettle_MAC_struct *mac;
ASSIGN_CURRENT_STORAGE(mac, struct Nettle_MAC_struct, 1,
Nettle_MAC_program);
mac->meta = &pike_umac32;
}

/*! @class State
*!
*! State for UMAC32_AES macing.
*!
*/

#undef class_Nettle_UMAC32_AES_State_defined
#define class_Nettle_UMAC32_AES_State_defined
DEFAULT_CMOD_STORAGE struct program *Nettle_UMAC32_AES_State_program=NULL;

#ifdef Nettle_UMAC32_AES_State_program_fun_num_used
DEFAULT_CMOD_STORAGE int Nettle_UMAC32_AES_State_program_fun_num=-1;
#endif /* Nettle_UMAC32_AES_State_program_fun_num_used */
/*! @decl inherit MAC::State
*/


#undef extra_Nettle_UMAC32_AES_State_defined
#define extra_Nettle_UMAC32_AES_State_defined

#undef var_umac32_Nettle_UMAC32_AES_State_defined
#define var_umac32_Nettle_UMAC32_AES_State_defined

#undef THIS
#define THIS ((struct Nettle_UMAC32_AES_State_struct *)(Pike_interpreter.frame_pointer->current_storage))

#undef THIS_NETTLE_UMAC32_AES_STATE
#define THIS_NETTLE_UMAC32_AES_STATE ((struct Nettle_UMAC32_AES_State_struct *)(Pike_interpreter.frame_pointer->current_storage))

#undef OBJ2_NETTLE_UMAC32_AES_STATE
#define OBJ2_NETTLE_UMAC32_AES_STATE(o) ((struct Nettle_UMAC32_AES_State_struct *)(o->storage+Nettle_UMAC32_AES_State_storage_offset))

#undef GET_NETTLE_UMAC32_AES_STATE_STORAGE
#define GET_NETTLE_UMAC32_AES_STATE_STORAGE(o) ((struct Nettle_UMAC32_AES_State_struct *)(o->storage+Nettle_UMAC32_AES_State_storage_offset)
static ptrdiff_t Nettle_UMAC32_AES_State_storage_offset;
struct Nettle_UMAC32_AES_State_struct {

#ifdef var_umac32_Nettle_UMAC32_AES_State_defined
#line 64 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
struct umac32_ctx umac32;
#endif /* var_umac32_Nettle_UMAC32_AES_State_defined */
};
#ifdef PIKE_DEBUG
/* Ensure the struct is used in a variable declaration, or else gdb might not see it. */
static struct Nettle_UMAC32_AES_State_struct *Nettle_UMAC32_AES_State_gdb_dummy_ptr;
#endif

#undef internal_init_Nettle_UMAC32_AES_State_defined
#define internal_init_Nettle_UMAC32_AES_State_defined

#undef Nettle_UMAC32_AES_State_event_handler_defined
#define Nettle_UMAC32_AES_State_event_handler_defined
static void init_Nettle_UMAC32_AES_State_struct(void)
#line 67 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
{
struct Nettle_MAC_State_struct *instance;
ASSIGN_CURRENT_STORAGE(instance, struct Nettle_MAC_State_struct, 1,
Nettle_MAC_State_program);
instance->ctx = &THIS->umac32;
}

#ifdef Nettle_UMAC32_AES_State_event_handler_defined
static void Nettle_UMAC32_AES_State_event_handler(int ev) {
  switch(ev) {

#ifdef internal_init_Nettle_UMAC32_AES_State_defined
  case PROG_EVENT_INIT: init_Nettle_UMAC32_AES_State_struct(); break;

#endif /* internal_init_Nettle_UMAC32_AES_State_defined */
  default: break; 
  }
}

#endif /* Nettle_UMAC32_AES_State_event_handler_defined */
/*! @endclass State
*/


#ifdef Nettle_UMAC32_AES_event_handler_defined
static void Nettle_UMAC32_AES_event_handler(int ev) {
  switch(ev) {

#ifdef internal_init_Nettle_UMAC32_AES_defined
  case PROG_EVENT_INIT: init_Nettle_UMAC32_AES_struct(); break;

#endif /* internal_init_Nettle_UMAC32_AES_defined */
  default: break; 
  }
}

#endif /* Nettle_UMAC32_AES_event_handler_defined */
/*! @endclass UMAC32_AES
*/


#line 82 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
#line 454 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"




#line 458 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
#define UMAC64_AES_BLOCK_SIZE	UMAC_BLOCK_SIZE
#define UMAC64_AES_KEY_SIZE	UMAC_KEY_SIZE
#define UMAC64_AES_IV_SIZE	UMAC_NONCE_SIZE
#define UMAC64_AES_DIGEST_SIZE	UMAC64_DIGEST_SIZE
#define pike_umac64_set_iv	umac64_set_nonce

static void pike_umac64_set_key(void *ctx, pike_nettle_size_t len,
const uint8_t *key)
{
if (len != UMAC_KEY_SIZE) {
Pike_error("Invalid key length.\n");
}
umac64_set_key(ctx, key);
}



#line 1 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
#line 1 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
/* -*- C -*-
 *
 * Cmod header-file acting as a template for the MAC classes.
 */

/*! @class UMAC64_AES
*!
*! Implementation of the UMAC64_AES MAC algorithm.
*!
*/

#undef class_Nettle_UMAC64_AES_defined
#define class_Nettle_UMAC64_AES_defined
DEFAULT_CMOD_STORAGE struct program *Nettle_UMAC64_AES_program=NULL;

#ifdef Nettle_UMAC64_AES_program_fun_num_used
DEFAULT_CMOD_STORAGE int Nettle_UMAC64_AES_program_fun_num=-1;
#endif /* Nettle_UMAC64_AES_program_fun_num_used */
/*! @decl inherit MAC
*/

#undef inherit_Nettle_MAC_Nettle_UMAC64_AES_defined
#define inherit_Nettle_MAC_Nettle_UMAC64_AES_defined
#line 15 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
static int Nettle_UMAC64_AES_Nettle_MAC_inh_num = -1;
#line 15 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
static int Nettle_UMAC64_AES_Nettle_MAC_inh_offset = -1;
#line 17 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
static const struct pike_mac pike_umac64 =
_PIKE_MAC(umac64, UMAC64_AES);


#undef internal_init_Nettle_UMAC64_AES_defined
#define internal_init_Nettle_UMAC64_AES_defined

#undef Nettle_UMAC64_AES_event_handler_defined
#define Nettle_UMAC64_AES_event_handler_defined
static void init_Nettle_UMAC64_AES_struct(void)
#line 21 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
{
struct Nettle_MAC_struct *mac;
ASSIGN_CURRENT_STORAGE(mac, struct Nettle_MAC_struct, 1,
Nettle_MAC_program);
mac->meta = &pike_umac64;
}

/*! @class State
*!
*! State for UMAC64_AES macing.
*!
*/

#undef class_Nettle_UMAC64_AES_State_defined
#define class_Nettle_UMAC64_AES_State_defined
DEFAULT_CMOD_STORAGE struct program *Nettle_UMAC64_AES_State_program=NULL;

#ifdef Nettle_UMAC64_AES_State_program_fun_num_used
DEFAULT_CMOD_STORAGE int Nettle_UMAC64_AES_State_program_fun_num=-1;
#endif /* Nettle_UMAC64_AES_State_program_fun_num_used */
/*! @decl inherit MAC::State
*/


#undef extra_Nettle_UMAC64_AES_State_defined
#define extra_Nettle_UMAC64_AES_State_defined

#undef var_umac64_Nettle_UMAC64_AES_State_defined
#define var_umac64_Nettle_UMAC64_AES_State_defined

#undef THIS
#define THIS ((struct Nettle_UMAC64_AES_State_struct *)(Pike_interpreter.frame_pointer->current_storage))

#undef THIS_NETTLE_UMAC64_AES_STATE
#define THIS_NETTLE_UMAC64_AES_STATE ((struct Nettle_UMAC64_AES_State_struct *)(Pike_interpreter.frame_pointer->current_storage))

#undef OBJ2_NETTLE_UMAC64_AES_STATE
#define OBJ2_NETTLE_UMAC64_AES_STATE(o) ((struct Nettle_UMAC64_AES_State_struct *)(o->storage+Nettle_UMAC64_AES_State_storage_offset))

#undef GET_NETTLE_UMAC64_AES_STATE_STORAGE
#define GET_NETTLE_UMAC64_AES_STATE_STORAGE(o) ((struct Nettle_UMAC64_AES_State_struct *)(o->storage+Nettle_UMAC64_AES_State_storage_offset)
static ptrdiff_t Nettle_UMAC64_AES_State_storage_offset;
struct Nettle_UMAC64_AES_State_struct {

#ifdef var_umac64_Nettle_UMAC64_AES_State_defined
#line 64 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
struct umac64_ctx umac64;
#endif /* var_umac64_Nettle_UMAC64_AES_State_defined */
};
#ifdef PIKE_DEBUG
/* Ensure the struct is used in a variable declaration, or else gdb might not see it. */
static struct Nettle_UMAC64_AES_State_struct *Nettle_UMAC64_AES_State_gdb_dummy_ptr;
#endif

#undef internal_init_Nettle_UMAC64_AES_State_defined
#define internal_init_Nettle_UMAC64_AES_State_defined

#undef Nettle_UMAC64_AES_State_event_handler_defined
#define Nettle_UMAC64_AES_State_event_handler_defined
static void init_Nettle_UMAC64_AES_State_struct(void)
#line 67 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
{
struct Nettle_MAC_State_struct *instance;
ASSIGN_CURRENT_STORAGE(instance, struct Nettle_MAC_State_struct, 1,
Nettle_MAC_State_program);
instance->ctx = &THIS->umac64;
}

#ifdef Nettle_UMAC64_AES_State_event_handler_defined
static void Nettle_UMAC64_AES_State_event_handler(int ev) {
  switch(ev) {

#ifdef internal_init_Nettle_UMAC64_AES_State_defined
  case PROG_EVENT_INIT: init_Nettle_UMAC64_AES_State_struct(); break;

#endif /* internal_init_Nettle_UMAC64_AES_State_defined */
  default: break; 
  }
}

#endif /* Nettle_UMAC64_AES_State_event_handler_defined */
/*! @endclass State
*/


#ifdef Nettle_UMAC64_AES_event_handler_defined
static void Nettle_UMAC64_AES_event_handler(int ev) {
  switch(ev) {

#ifdef internal_init_Nettle_UMAC64_AES_defined
  case PROG_EVENT_INIT: init_Nettle_UMAC64_AES_struct(); break;

#endif /* internal_init_Nettle_UMAC64_AES_defined */
  default: break; 
  }
}

#endif /* Nettle_UMAC64_AES_event_handler_defined */
/*! @endclass UMAC64_AES
*/


#line 82 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
#line 475 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"




#line 479 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
#define UMAC96_AES_BLOCK_SIZE	UMAC_BLOCK_SIZE
#define UMAC96_AES_KEY_SIZE	UMAC_KEY_SIZE
#define UMAC96_AES_IV_SIZE	UMAC_NONCE_SIZE
#define UMAC96_AES_DIGEST_SIZE	UMAC96_DIGEST_SIZE
#define pike_umac96_set_iv	umac96_set_nonce

static void pike_umac96_set_key(void *ctx, pike_nettle_size_t len,
const uint8_t *key)
{
if (len != UMAC_KEY_SIZE) {
Pike_error("Invalid key length.\n");
}
umac96_set_key(ctx, key);
}



#line 1 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
#line 1 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
/* -*- C -*-
 *
 * Cmod header-file acting as a template for the MAC classes.
 */

/*! @class UMAC96_AES
*!
*! Implementation of the UMAC96_AES MAC algorithm.
*!
*/

#undef class_Nettle_UMAC96_AES_defined
#define class_Nettle_UMAC96_AES_defined
DEFAULT_CMOD_STORAGE struct program *Nettle_UMAC96_AES_program=NULL;

#ifdef Nettle_UMAC96_AES_program_fun_num_used
DEFAULT_CMOD_STORAGE int Nettle_UMAC96_AES_program_fun_num=-1;
#endif /* Nettle_UMAC96_AES_program_fun_num_used */
/*! @decl inherit MAC
*/

#undef inherit_Nettle_MAC_Nettle_UMAC96_AES_defined
#define inherit_Nettle_MAC_Nettle_UMAC96_AES_defined
#line 15 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
static int Nettle_UMAC96_AES_Nettle_MAC_inh_num = -1;
#line 15 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
static int Nettle_UMAC96_AES_Nettle_MAC_inh_offset = -1;
#line 17 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
static const struct pike_mac pike_umac96 =
_PIKE_MAC(umac96, UMAC96_AES);


#undef internal_init_Nettle_UMAC96_AES_defined
#define internal_init_Nettle_UMAC96_AES_defined

#undef Nettle_UMAC96_AES_event_handler_defined
#define Nettle_UMAC96_AES_event_handler_defined
static void init_Nettle_UMAC96_AES_struct(void)
#line 21 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
{
struct Nettle_MAC_struct *mac;
ASSIGN_CURRENT_STORAGE(mac, struct Nettle_MAC_struct, 1,
Nettle_MAC_program);
mac->meta = &pike_umac96;
}

/*! @class State
*!
*! State for UMAC96_AES macing.
*!
*/

#undef class_Nettle_UMAC96_AES_State_defined
#define class_Nettle_UMAC96_AES_State_defined
DEFAULT_CMOD_STORAGE struct program *Nettle_UMAC96_AES_State_program=NULL;

#ifdef Nettle_UMAC96_AES_State_program_fun_num_used
DEFAULT_CMOD_STORAGE int Nettle_UMAC96_AES_State_program_fun_num=-1;
#endif /* Nettle_UMAC96_AES_State_program_fun_num_used */
/*! @decl inherit MAC::State
*/


#undef extra_Nettle_UMAC96_AES_State_defined
#define extra_Nettle_UMAC96_AES_State_defined

#undef var_umac96_Nettle_UMAC96_AES_State_defined
#define var_umac96_Nettle_UMAC96_AES_State_defined

#undef THIS
#define THIS ((struct Nettle_UMAC96_AES_State_struct *)(Pike_interpreter.frame_pointer->current_storage))

#undef THIS_NETTLE_UMAC96_AES_STATE
#define THIS_NETTLE_UMAC96_AES_STATE ((struct Nettle_UMAC96_AES_State_struct *)(Pike_interpreter.frame_pointer->current_storage))

#undef OBJ2_NETTLE_UMAC96_AES_STATE
#define OBJ2_NETTLE_UMAC96_AES_STATE(o) ((struct Nettle_UMAC96_AES_State_struct *)(o->storage+Nettle_UMAC96_AES_State_storage_offset))

#undef GET_NETTLE_UMAC96_AES_STATE_STORAGE
#define GET_NETTLE_UMAC96_AES_STATE_STORAGE(o) ((struct Nettle_UMAC96_AES_State_struct *)(o->storage+Nettle_UMAC96_AES_State_storage_offset)
static ptrdiff_t Nettle_UMAC96_AES_State_storage_offset;
struct Nettle_UMAC96_AES_State_struct {

#ifdef var_umac96_Nettle_UMAC96_AES_State_defined
#line 64 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
struct umac96_ctx umac96;
#endif /* var_umac96_Nettle_UMAC96_AES_State_defined */
};
#ifdef PIKE_DEBUG
/* Ensure the struct is used in a variable declaration, or else gdb might not see it. */
static struct Nettle_UMAC96_AES_State_struct *Nettle_UMAC96_AES_State_gdb_dummy_ptr;
#endif

#undef internal_init_Nettle_UMAC96_AES_State_defined
#define internal_init_Nettle_UMAC96_AES_State_defined

#undef Nettle_UMAC96_AES_State_event_handler_defined
#define Nettle_UMAC96_AES_State_event_handler_defined
static void init_Nettle_UMAC96_AES_State_struct(void)
#line 67 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
{
struct Nettle_MAC_State_struct *instance;
ASSIGN_CURRENT_STORAGE(instance, struct Nettle_MAC_State_struct, 1,
Nettle_MAC_State_program);
instance->ctx = &THIS->umac96;
}

#ifdef Nettle_UMAC96_AES_State_event_handler_defined
static void Nettle_UMAC96_AES_State_event_handler(int ev) {
  switch(ev) {

#ifdef internal_init_Nettle_UMAC96_AES_State_defined
  case PROG_EVENT_INIT: init_Nettle_UMAC96_AES_State_struct(); break;

#endif /* internal_init_Nettle_UMAC96_AES_State_defined */
  default: break; 
  }
}

#endif /* Nettle_UMAC96_AES_State_event_handler_defined */
/*! @endclass State
*/


#ifdef Nettle_UMAC96_AES_event_handler_defined
static void Nettle_UMAC96_AES_event_handler(int ev) {
  switch(ev) {

#ifdef internal_init_Nettle_UMAC96_AES_defined
  case PROG_EVENT_INIT: init_Nettle_UMAC96_AES_struct(); break;

#endif /* internal_init_Nettle_UMAC96_AES_defined */
  default: break; 
  }
}

#endif /* Nettle_UMAC96_AES_event_handler_defined */
/*! @endclass UMAC96_AES
*/


#line 82 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
#line 496 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"




#line 500 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
#define UMAC128_AES_BLOCK_SIZE	UMAC_BLOCK_SIZE
#define UMAC128_AES_KEY_SIZE	UMAC_KEY_SIZE
#define UMAC128_AES_IV_SIZE	UMAC_NONCE_SIZE
#define UMAC128_AES_DIGEST_SIZE	UMAC128_DIGEST_SIZE
#define pike_umac128_set_iv	umac128_set_nonce

static void pike_umac128_set_key(void *ctx, pike_nettle_size_t len,
const uint8_t *key)
{
if (len != UMAC_KEY_SIZE) {
Pike_error("Invalid key length.\n");
}
umac128_set_key(ctx, key);
}



#line 1 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
#line 1 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
/* -*- C -*-
 *
 * Cmod header-file acting as a template for the MAC classes.
 */

/*! @class UMAC128_AES
*!
*! Implementation of the UMAC128_AES MAC algorithm.
*!
*/

#undef class_Nettle_UMAC128_AES_defined
#define class_Nettle_UMAC128_AES_defined
DEFAULT_CMOD_STORAGE struct program *Nettle_UMAC128_AES_program=NULL;

#ifdef Nettle_UMAC128_AES_program_fun_num_used
DEFAULT_CMOD_STORAGE int Nettle_UMAC128_AES_program_fun_num=-1;
#endif /* Nettle_UMAC128_AES_program_fun_num_used */
/*! @decl inherit MAC
*/

#undef inherit_Nettle_MAC_Nettle_UMAC128_AES_defined
#define inherit_Nettle_MAC_Nettle_UMAC128_AES_defined
#line 15 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
static int Nettle_UMAC128_AES_Nettle_MAC_inh_num = -1;
#line 15 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
static int Nettle_UMAC128_AES_Nettle_MAC_inh_offset = -1;
#line 17 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
static const struct pike_mac pike_umac128 =
_PIKE_MAC(umac128, UMAC128_AES);


#undef internal_init_Nettle_UMAC128_AES_defined
#define internal_init_Nettle_UMAC128_AES_defined

#undef Nettle_UMAC128_AES_event_handler_defined
#define Nettle_UMAC128_AES_event_handler_defined
static void init_Nettle_UMAC128_AES_struct(void)
#line 21 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
{
struct Nettle_MAC_struct *mac;
ASSIGN_CURRENT_STORAGE(mac, struct Nettle_MAC_struct, 1,
Nettle_MAC_program);
mac->meta = &pike_umac128;
}

/*! @class State
*!
*! State for UMAC128_AES macing.
*!
*/

#undef class_Nettle_UMAC128_AES_State_defined
#define class_Nettle_UMAC128_AES_State_defined
DEFAULT_CMOD_STORAGE struct program *Nettle_UMAC128_AES_State_program=NULL;

#ifdef Nettle_UMAC128_AES_State_program_fun_num_used
DEFAULT_CMOD_STORAGE int Nettle_UMAC128_AES_State_program_fun_num=-1;
#endif /* Nettle_UMAC128_AES_State_program_fun_num_used */
/*! @decl inherit MAC::State
*/


#undef extra_Nettle_UMAC128_AES_State_defined
#define extra_Nettle_UMAC128_AES_State_defined

#undef var_umac128_Nettle_UMAC128_AES_State_defined
#define var_umac128_Nettle_UMAC128_AES_State_defined

#undef THIS
#define THIS ((struct Nettle_UMAC128_AES_State_struct *)(Pike_interpreter.frame_pointer->current_storage))

#undef THIS_NETTLE_UMAC128_AES_STATE
#define THIS_NETTLE_UMAC128_AES_STATE ((struct Nettle_UMAC128_AES_State_struct *)(Pike_interpreter.frame_pointer->current_storage))

#undef OBJ2_NETTLE_UMAC128_AES_STATE
#define OBJ2_NETTLE_UMAC128_AES_STATE(o) ((struct Nettle_UMAC128_AES_State_struct *)(o->storage+Nettle_UMAC128_AES_State_storage_offset))

#undef GET_NETTLE_UMAC128_AES_STATE_STORAGE
#define GET_NETTLE_UMAC128_AES_STATE_STORAGE(o) ((struct Nettle_UMAC128_AES_State_struct *)(o->storage+Nettle_UMAC128_AES_State_storage_offset)
static ptrdiff_t Nettle_UMAC128_AES_State_storage_offset;
struct Nettle_UMAC128_AES_State_struct {

#ifdef var_umac128_Nettle_UMAC128_AES_State_defined
#line 64 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
struct umac128_ctx umac128;
#endif /* var_umac128_Nettle_UMAC128_AES_State_defined */
};
#ifdef PIKE_DEBUG
/* Ensure the struct is used in a variable declaration, or else gdb might not see it. */
static struct Nettle_UMAC128_AES_State_struct *Nettle_UMAC128_AES_State_gdb_dummy_ptr;
#endif

#undef internal_init_Nettle_UMAC128_AES_State_defined
#define internal_init_Nettle_UMAC128_AES_State_defined

#undef Nettle_UMAC128_AES_State_event_handler_defined
#define Nettle_UMAC128_AES_State_event_handler_defined
static void init_Nettle_UMAC128_AES_State_struct(void)
#line 67 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
{
struct Nettle_MAC_State_struct *instance;
ASSIGN_CURRENT_STORAGE(instance, struct Nettle_MAC_State_struct, 1,
Nettle_MAC_State_program);
instance->ctx = &THIS->umac128;
}

#ifdef Nettle_UMAC128_AES_State_event_handler_defined
static void Nettle_UMAC128_AES_State_event_handler(int ev) {
  switch(ev) {

#ifdef internal_init_Nettle_UMAC128_AES_State_defined
  case PROG_EVENT_INIT: init_Nettle_UMAC128_AES_State_struct(); break;

#endif /* internal_init_Nettle_UMAC128_AES_State_defined */
  default: break; 
  }
}

#endif /* Nettle_UMAC128_AES_State_event_handler_defined */
/*! @endclass State
*/


#ifdef Nettle_UMAC128_AES_event_handler_defined
static void Nettle_UMAC128_AES_event_handler(int ev) {
  switch(ev) {

#ifdef internal_init_Nettle_UMAC128_AES_defined
  case PROG_EVENT_INIT: init_Nettle_UMAC128_AES_struct(); break;

#endif /* internal_init_Nettle_UMAC128_AES_defined */
  default: break; 
  }
}

#endif /* Nettle_UMAC128_AES_event_handler_defined */
/*! @endclass UMAC128_AES
*/


#line 82 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
#line 517 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"




#line 521 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
#endif

/*! @endmodule Nettle */

void
mac_init(void)
{
werror("Nettle, mac init\n");

#ifdef module_strings_declared
module_strings[0] = 
  make_shared_binary_string("State",
                            CONSTANT_STRLEN("State"));
module_strings[1] = 
  make_shared_binary_string("__builtin.Nettle.MAC",
                            CONSTANT_STRLEN("__builtin.Nettle.MAC"));
#endif

#ifdef CMOD_MAP_PROGRAM_IDS_DEFINED
set_program_id_to_id( ___cmod_map_program_ids );

#endif /* CMOD_MAP_PROGRAM_IDS_DEFINED */

#ifdef class_Nettle_MAC_defined

#ifdef PROG_NETTLE_MAC_ID
#line 82 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
  START_NEW_PROGRAM_ID(NETTLE_MAC);
#else
#line 82 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
  start_new_program();

#endif /* PROG_NETTLE_MAC_ID */
#line 82 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
  Nettle_MAC_program = Pike_compiler->new_program;

#ifndef tObjImpl_NETTLE_MAC

#undef tObjIs_NETTLE_MAC
#define tObjIs_NETTLE_MAC "\3\1\177\0\0\2"

#undef tObjImpl_NETTLE_MAC
#define tObjImpl_NETTLE_MAC "\3\0\177\0\0\2"

#endif /* tObjImpl_NETTLE_MAC */

#ifdef THIS_NETTLE_MAC
  Nettle_MAC_storage_offset = ADD_STORAGE(struct Nettle_MAC_struct);
#endif /* THIS_NETTLE_MAC */

#ifdef inherit_cq__22__builtin_2ENettle_2EMAC_22_Nettle_MAC_defined
#line 86 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
  Nettle_MAC_cq__22__builtin_2ENettle_2EMAC_22_inh_num = Pike_compiler->new_program->num_inherits;
  do {
#line 86 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
    struct program *p = resolve_program(module_strings[1] /* "__builtin.Nettle.MAC" */);
    if (p) {
#line 86 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
      low_inherit(p, NULL, -1, 0, 0, NULL);
#line 86 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
      Nettle_MAC_cq__22__builtin_2ENettle_2EMAC_22_inh_offset = Pike_compiler->new_program->inherits[Nettle_MAC_cq__22__builtin_2ENettle_2EMAC_22_inh_num].identifier_level;
#line 86 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
      free_program(p);
    } else {
#line 86 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
      yyerror("Inherit failed.");
    }
  } while(0);
#endif /* inherit_cq__22__builtin_2ENettle_2EMAC_22_Nettle_MAC_defined */

#ifdef class_Nettle_MAC_State_defined

#ifdef PROG_NETTLE_MAC_STATE_ID
#line 166 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
  START_NEW_PROGRAM_ID(NETTLE_MAC_STATE);
#else
#line 166 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
  start_new_program();

#endif /* PROG_NETTLE_MAC_STATE_ID */
#line 166 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
  Nettle_MAC_State_program = Pike_compiler->new_program;

#ifndef tObjImpl_NETTLE_MAC_STATE

#undef tObjIs_NETTLE_MAC_STATE
#define tObjIs_NETTLE_MAC_STATE "\3\1\177\0\0\3"

#undef tObjImpl_NETTLE_MAC_STATE
#define tObjImpl_NETTLE_MAC_STATE "\3\0\177\0\0\3"

#endif /* tObjImpl_NETTLE_MAC_STATE */

#ifdef THIS_NETTLE_MAC_STATE
  Nettle_MAC_State_storage_offset = ADD_STORAGE(struct Nettle_MAC_State_struct);
#endif /* THIS_NETTLE_MAC_STATE */

#ifdef extra_Nettle_MAC_State_defined
#line 173 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
{
/* Perform an inherit of the State class (if any) that our parent
       * may contain via its inherit of __builtin.Nettle.MAC.
       */
struct program *parent_prog = Pike_compiler->previous->new_program;
struct object *parent_obj = Pike_compiler->previous->fake_object;
int parent_State_fun_num =
really_low_find_shared_string_identifier(module_strings[0] /* "State" */,
parent_prog,
SEE_PROTECTED|SEE_PRIVATE);
if (parent_State_fun_num >= 0) {
struct program *parent_State_prog =
low_program_from_function(parent_obj, parent_State_fun_num);
if (parent_State_prog) {
parent_State_fun_num =
really_low_reference_inherited_identifier(Pike_compiler->previous,
0, parent_State_fun_num);
low_inherit(parent_State_prog, 0,
parent_State_fun_num,
1 + 42, 0, NULL);
}
}
}


#endif /* extra_Nettle_MAC_State_defined */

#ifdef Nettle_MAC_State_event_handler_defined
  pike_set_prog_event_callback(Nettle_MAC_State_event_handler);

#ifndef Nettle_MAC_State_gc_live_obj
  Pike_compiler->new_program->flags &= ~PROGRAM_LIVE_OBJ;

#endif /* Nettle_MAC_State_gc_live_obj */

#endif /* Nettle_MAC_State_event_handler_defined */

#ifdef f_Nettle_MAC_State_create_defined

#ifdef f_Nettle_MAC_State_create_fun_num_used
  f_Nettle_MAC_State_create_fun_num =
#endif /* f_Nettle_MAC_State_create_fun_num_used */
#line 208 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
    ADD_FUNCTION2("create", f_Nettle_MAC_State_create, tFunc(tStr8,tVoid), ID_PROTECTED, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Nettle_MAC_State_create_defined */

#ifdef f_Nettle_MAC_State_set_iv_defined

#ifdef f_Nettle_MAC_State_set_iv_fun_num_used
  f_Nettle_MAC_State_set_iv_fun_num =
#endif /* f_Nettle_MAC_State_set_iv_fun_num_used */
#line 234 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
    ADD_FUNCTION2("set_iv", f_Nettle_MAC_State_set_iv, tFunc(tStr8, tObjImpl_NETTLE_MAC_STATE), 0, OPT_SIDE_EFFECT);

#endif /* f_Nettle_MAC_State_set_iv_defined */

#ifdef f_Nettle_MAC_State_update_defined

#ifdef f_Nettle_MAC_State_update_fun_num_used
  f_Nettle_MAC_State_update_fun_num =
#endif /* f_Nettle_MAC_State_update_fun_num_used */
#line 268 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
    ADD_FUNCTION2("update", f_Nettle_MAC_State_update, tFunc(tStr8, tObjImpl_NETTLE_MAC_STATE), 0, OPT_SIDE_EFFECT);

#endif /* f_Nettle_MAC_State_update_defined */

#ifdef f_Nettle_MAC_State_digest_defined

#ifdef f_Nettle_MAC_State_digest_fun_num_used
  f_Nettle_MAC_State_digest_fun_num =
#endif /* f_Nettle_MAC_State_digest_fun_num_used */
#line 306 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
    ADD_FUNCTION2("digest", f_Nettle_MAC_State_digest, tFunc(tOr("\10\200\0\0\0\177\377\377\377",tVoid),tStr8), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Nettle_MAC_State_digest_defined */

#ifdef f_Nettle_MAC_State_cq__backtick_28_29_defined

#ifdef f_Nettle_MAC_State_cq__backtick_28_29_fun_num_used
  f_Nettle_MAC_State_cq__backtick_28_29_fun_num =
#endif /* f_Nettle_MAC_State_cq__backtick_28_29_fun_num_used */
#line 342 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
    ADD_FUNCTION2("`()", f_Nettle_MAC_State_cq__backtick_28_29, tFunc(tStr8,tStr8), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Nettle_MAC_State_cq__backtick_28_29_defined */
#line 167 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
  Pike_compiler->new_program->flags |= PROGRAM_USES_PARENT|PROGRAM_NEEDS_PARENT|PROGRAM_CLEAR_STORAGE;
#line 166 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
  Nettle_MAC_State_program=end_program();
#line 166 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
#ifdef Nettle_MAC_State_program_fun_num_used
Nettle_MAC_State_program_fun_num=
#endif
 add_program_constant("State",Nettle_MAC_State_program,0);

#endif /* class_Nettle_MAC_State_defined */

#ifdef Nettle_MAC_event_handler_defined
  pike_set_prog_event_callback(Nettle_MAC_event_handler);

#ifndef Nettle_MAC_gc_live_obj
  Pike_compiler->new_program->flags &= ~PROGRAM_LIVE_OBJ;

#endif /* Nettle_MAC_gc_live_obj */

#endif /* Nettle_MAC_event_handler_defined */

#ifdef f_Nettle_MAC_name_defined

#ifdef f_Nettle_MAC_name_fun_num_used
  f_Nettle_MAC_name_fun_num =
#endif /* f_Nettle_MAC_name_fun_num_used */
#line 94 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
    ADD_FUNCTION2("name", f_Nettle_MAC_name, tFunc(tNone,tStr8), 0, OPT_TRY_OPTIMIZE);

#endif /* f_Nettle_MAC_name_defined */

#ifdef f_Nettle_MAC_digest_size_defined

#ifdef f_Nettle_MAC_digest_size_fun_num_used
  f_Nettle_MAC_digest_size_fun_num =
#endif /* f_Nettle_MAC_digest_size_fun_num_used */
#line 107 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
    ADD_FUNCTION2("digest_size", f_Nettle_MAC_digest_size, tFunc(tNone,"\10\0\0\0\0\177\377\377\377"), 0, OPT_TRY_OPTIMIZE);

#endif /* f_Nettle_MAC_digest_size_defined */

#ifdef f_Nettle_MAC_block_size_defined

#ifdef f_Nettle_MAC_block_size_fun_num_used
  f_Nettle_MAC_block_size_fun_num =
#endif /* f_Nettle_MAC_block_size_fun_num_used */
#line 120 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
    ADD_FUNCTION2("block_size", f_Nettle_MAC_block_size, tFunc(tNone,"\10\0\0\0\0\177\377\377\377"), 0, OPT_TRY_OPTIMIZE);

#endif /* f_Nettle_MAC_block_size_defined */

#ifdef f_Nettle_MAC_key_size_defined

#ifdef f_Nettle_MAC_key_size_fun_num_used
  f_Nettle_MAC_key_size_fun_num =
#endif /* f_Nettle_MAC_key_size_fun_num_used */
#line 133 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
    ADD_FUNCTION2("key_size", f_Nettle_MAC_key_size, tFunc(tNone,"\10\0\0\0\0\177\377\377\377"), 0, OPT_TRY_OPTIMIZE);

#endif /* f_Nettle_MAC_key_size_defined */

#ifdef f_Nettle_MAC_iv_size_defined

#ifdef f_Nettle_MAC_iv_size_fun_num_used
  f_Nettle_MAC_iv_size_fun_num =
#endif /* f_Nettle_MAC_iv_size_fun_num_used */
#line 148 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
    ADD_FUNCTION2("iv_size", f_Nettle_MAC_iv_size, tFunc(tNone,"\10\0\0\0\0\177\377\377\377"), 0, OPT_TRY_OPTIMIZE);

#endif /* f_Nettle_MAC_iv_size_defined */
#line 82 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
  Nettle_MAC_program=end_program();
#line 82 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
#ifdef Nettle_MAC_program_fun_num_used
Nettle_MAC_program_fun_num=
#endif
 add_program_constant("MAC",Nettle_MAC_program,0);

#endif /* class_Nettle_MAC_defined */

#ifdef class_Nettle_POLY1305_AES_defined

#ifdef PROG_NETTLE_POLY1305_AES_ID
#line 11 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
  START_NEW_PROGRAM_ID(NETTLE_POLY1305_AES);
#else
#line 11 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
  start_new_program();

#endif /* PROG_NETTLE_POLY1305_AES_ID */
#line 11 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
  Nettle_POLY1305_AES_program = Pike_compiler->new_program;

#ifndef tObjImpl_NETTLE_POLY1305_AES

#undef tObjIs_NETTLE_POLY1305_AES
#define tObjIs_NETTLE_POLY1305_AES "\3\1\177\0\0\4"

#undef tObjImpl_NETTLE_POLY1305_AES
#define tObjImpl_NETTLE_POLY1305_AES "\3\0\177\0\0\4"

#endif /* tObjImpl_NETTLE_POLY1305_AES */

#ifdef inherit_Nettle_MAC_Nettle_POLY1305_AES_defined
#line 15 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
  Nettle_POLY1305_AES_Nettle_MAC_inh_num = Pike_compiler->new_program->num_inherits;
#line 15 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
  low_inherit(Nettle_MAC_program, NULL, -1, 0, 0, NULL);
#line 15 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
  Nettle_POLY1305_AES_Nettle_MAC_inh_offset = Pike_compiler->new_program->inherits[Nettle_POLY1305_AES_Nettle_MAC_inh_num].identifier_level;

#endif /* inherit_Nettle_MAC_Nettle_POLY1305_AES_defined */

#ifdef class_Nettle_POLY1305_AES_State_defined

#ifdef PROG_NETTLE_POLY1305_AES_STATE_ID
#line 33 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
  START_NEW_PROGRAM_ID(NETTLE_POLY1305_AES_STATE);
#else
#line 33 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
  start_new_program();

#endif /* PROG_NETTLE_POLY1305_AES_STATE_ID */
#line 33 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
  Nettle_POLY1305_AES_State_program = Pike_compiler->new_program;

#ifndef tObjImpl_NETTLE_POLY1305_AES_STATE

#undef tObjIs_NETTLE_POLY1305_AES_STATE
#define tObjIs_NETTLE_POLY1305_AES_STATE "\3\1\177\0\0\5"

#undef tObjImpl_NETTLE_POLY1305_AES_STATE
#define tObjImpl_NETTLE_POLY1305_AES_STATE "\3\0\177\0\0\5"

#endif /* tObjImpl_NETTLE_POLY1305_AES_STATE */

#ifdef THIS_NETTLE_POLY1305_AES_STATE
  Nettle_POLY1305_AES_State_storage_offset = ADD_STORAGE(struct Nettle_POLY1305_AES_State_struct);
#endif /* THIS_NETTLE_POLY1305_AES_STATE */

#ifdef extra_Nettle_POLY1305_AES_State_defined
#line 40 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
{
/* Perform an inherit of the MAC.State class that our parent
       * contains via its inherit of MAC.
       */
struct program *parent_prog = Pike_compiler->previous->new_program;
struct object *parent_obj = Pike_compiler->previous->fake_object;
int parent_State_fun_num =
really_low_find_shared_string_identifier(module_strings[0] /* "State" */,
parent_prog,
SEE_PROTECTED|SEE_PRIVATE);
if (parent_State_fun_num >= 0) {
struct program *parent_State_prog =
low_program_from_function(parent_obj, parent_State_fun_num);
if (parent_State_prog) {
parent_State_fun_num =
really_low_reference_inherited_identifier(Pike_compiler->previous,
0, parent_State_fun_num);
low_inherit(parent_State_prog, 0,
parent_State_fun_num,
1 + 42, 0, NULL);
}
}
}


#endif /* extra_Nettle_POLY1305_AES_State_defined */

#ifdef Nettle_POLY1305_AES_State_event_handler_defined
  pike_set_prog_event_callback(Nettle_POLY1305_AES_State_event_handler);

#ifndef Nettle_POLY1305_AES_State_gc_live_obj
  Pike_compiler->new_program->flags &= ~PROGRAM_LIVE_OBJ;

#endif /* Nettle_POLY1305_AES_State_gc_live_obj */

#endif /* Nettle_POLY1305_AES_State_event_handler_defined */
#line 34 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
  Pike_compiler->new_program->flags |= PROGRAM_NEEDS_PARENT|PROGRAM_USES_PARENT;
#line 33 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
  Nettle_POLY1305_AES_State_program=end_program();
#line 33 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
#ifdef Nettle_POLY1305_AES_State_program_fun_num_used
Nettle_POLY1305_AES_State_program_fun_num=
#endif
 add_program_constant("State",Nettle_POLY1305_AES_State_program,0);

#endif /* class_Nettle_POLY1305_AES_State_defined */

#ifdef Nettle_POLY1305_AES_event_handler_defined
  pike_set_prog_event_callback(Nettle_POLY1305_AES_event_handler);

#ifndef Nettle_POLY1305_AES_gc_live_obj
  Pike_compiler->new_program->flags &= ~PROGRAM_LIVE_OBJ;

#endif /* Nettle_POLY1305_AES_gc_live_obj */

#endif /* Nettle_POLY1305_AES_event_handler_defined */
#line 11 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
  Nettle_POLY1305_AES_program=end_program();
#line 11 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
#ifdef Nettle_POLY1305_AES_program_fun_num_used
Nettle_POLY1305_AES_program_fun_num=
#endif
 add_program_constant("POLY1305_AES",Nettle_POLY1305_AES_program,0);

#endif /* class_Nettle_POLY1305_AES_defined */

#ifdef class_Nettle_UMAC32_AES_defined

#ifdef PROG_NETTLE_UMAC32_AES_ID
#line 11 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
  START_NEW_PROGRAM_ID(NETTLE_UMAC32_AES);
#else
#line 11 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
  start_new_program();

#endif /* PROG_NETTLE_UMAC32_AES_ID */
#line 11 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
  Nettle_UMAC32_AES_program = Pike_compiler->new_program;

#ifndef tObjImpl_NETTLE_UMAC32_AES

#undef tObjIs_NETTLE_UMAC32_AES
#define tObjIs_NETTLE_UMAC32_AES "\3\1\177\0\0\6"

#undef tObjImpl_NETTLE_UMAC32_AES
#define tObjImpl_NETTLE_UMAC32_AES "\3\0\177\0\0\6"

#endif /* tObjImpl_NETTLE_UMAC32_AES */

#ifdef inherit_Nettle_MAC_Nettle_UMAC32_AES_defined
#line 15 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
  Nettle_UMAC32_AES_Nettle_MAC_inh_num = Pike_compiler->new_program->num_inherits;
#line 15 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
  low_inherit(Nettle_MAC_program, NULL, -1, 0, 0, NULL);
#line 15 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
  Nettle_UMAC32_AES_Nettle_MAC_inh_offset = Pike_compiler->new_program->inherits[Nettle_UMAC32_AES_Nettle_MAC_inh_num].identifier_level;

#endif /* inherit_Nettle_MAC_Nettle_UMAC32_AES_defined */

#ifdef class_Nettle_UMAC32_AES_State_defined

#ifdef PROG_NETTLE_UMAC32_AES_STATE_ID
#line 33 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
  START_NEW_PROGRAM_ID(NETTLE_UMAC32_AES_STATE);
#else
#line 33 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
  start_new_program();

#endif /* PROG_NETTLE_UMAC32_AES_STATE_ID */
#line 33 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
  Nettle_UMAC32_AES_State_program = Pike_compiler->new_program;

#ifndef tObjImpl_NETTLE_UMAC32_AES_STATE

#undef tObjIs_NETTLE_UMAC32_AES_STATE
#define tObjIs_NETTLE_UMAC32_AES_STATE "\3\1\177\0\0\a"

#undef tObjImpl_NETTLE_UMAC32_AES_STATE
#define tObjImpl_NETTLE_UMAC32_AES_STATE "\3\0\177\0\0\a"

#endif /* tObjImpl_NETTLE_UMAC32_AES_STATE */

#ifdef THIS_NETTLE_UMAC32_AES_STATE
  Nettle_UMAC32_AES_State_storage_offset = ADD_STORAGE(struct Nettle_UMAC32_AES_State_struct);
#endif /* THIS_NETTLE_UMAC32_AES_STATE */

#ifdef extra_Nettle_UMAC32_AES_State_defined
#line 40 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
{
/* Perform an inherit of the MAC.State class that our parent
       * contains via its inherit of MAC.
       */
struct program *parent_prog = Pike_compiler->previous->new_program;
struct object *parent_obj = Pike_compiler->previous->fake_object;
int parent_State_fun_num =
really_low_find_shared_string_identifier(module_strings[0] /* "State" */,
parent_prog,
SEE_PROTECTED|SEE_PRIVATE);
if (parent_State_fun_num >= 0) {
struct program *parent_State_prog =
low_program_from_function(parent_obj, parent_State_fun_num);
if (parent_State_prog) {
parent_State_fun_num =
really_low_reference_inherited_identifier(Pike_compiler->previous,
0, parent_State_fun_num);
low_inherit(parent_State_prog, 0,
parent_State_fun_num,
1 + 42, 0, NULL);
}
}
}


#endif /* extra_Nettle_UMAC32_AES_State_defined */

#ifdef Nettle_UMAC32_AES_State_event_handler_defined
  pike_set_prog_event_callback(Nettle_UMAC32_AES_State_event_handler);

#ifndef Nettle_UMAC32_AES_State_gc_live_obj
  Pike_compiler->new_program->flags &= ~PROGRAM_LIVE_OBJ;

#endif /* Nettle_UMAC32_AES_State_gc_live_obj */

#endif /* Nettle_UMAC32_AES_State_event_handler_defined */
#line 34 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
  Pike_compiler->new_program->flags |= PROGRAM_NEEDS_PARENT|PROGRAM_USES_PARENT;
#line 33 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
  Nettle_UMAC32_AES_State_program=end_program();
#line 33 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
#ifdef Nettle_UMAC32_AES_State_program_fun_num_used
Nettle_UMAC32_AES_State_program_fun_num=
#endif
 add_program_constant("State",Nettle_UMAC32_AES_State_program,0);

#endif /* class_Nettle_UMAC32_AES_State_defined */

#ifdef Nettle_UMAC32_AES_event_handler_defined
  pike_set_prog_event_callback(Nettle_UMAC32_AES_event_handler);

#ifndef Nettle_UMAC32_AES_gc_live_obj
  Pike_compiler->new_program->flags &= ~PROGRAM_LIVE_OBJ;

#endif /* Nettle_UMAC32_AES_gc_live_obj */

#endif /* Nettle_UMAC32_AES_event_handler_defined */
#line 11 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
  Nettle_UMAC32_AES_program=end_program();
#line 11 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
#ifdef Nettle_UMAC32_AES_program_fun_num_used
Nettle_UMAC32_AES_program_fun_num=
#endif
 add_program_constant("UMAC32_AES",Nettle_UMAC32_AES_program,0);

#endif /* class_Nettle_UMAC32_AES_defined */

#ifdef class_Nettle_UMAC64_AES_defined

#ifdef PROG_NETTLE_UMAC64_AES_ID
#line 11 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
  START_NEW_PROGRAM_ID(NETTLE_UMAC64_AES);
#else
#line 11 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
  start_new_program();

#endif /* PROG_NETTLE_UMAC64_AES_ID */
#line 11 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
  Nettle_UMAC64_AES_program = Pike_compiler->new_program;

#ifndef tObjImpl_NETTLE_UMAC64_AES

#undef tObjIs_NETTLE_UMAC64_AES
#define tObjIs_NETTLE_UMAC64_AES "\3\1\177\0\0\b"

#undef tObjImpl_NETTLE_UMAC64_AES
#define tObjImpl_NETTLE_UMAC64_AES "\3\0\177\0\0\b"

#endif /* tObjImpl_NETTLE_UMAC64_AES */

#ifdef inherit_Nettle_MAC_Nettle_UMAC64_AES_defined
#line 15 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
  Nettle_UMAC64_AES_Nettle_MAC_inh_num = Pike_compiler->new_program->num_inherits;
#line 15 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
  low_inherit(Nettle_MAC_program, NULL, -1, 0, 0, NULL);
#line 15 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
  Nettle_UMAC64_AES_Nettle_MAC_inh_offset = Pike_compiler->new_program->inherits[Nettle_UMAC64_AES_Nettle_MAC_inh_num].identifier_level;

#endif /* inherit_Nettle_MAC_Nettle_UMAC64_AES_defined */

#ifdef class_Nettle_UMAC64_AES_State_defined

#ifdef PROG_NETTLE_UMAC64_AES_STATE_ID
#line 33 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
  START_NEW_PROGRAM_ID(NETTLE_UMAC64_AES_STATE);
#else
#line 33 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
  start_new_program();

#endif /* PROG_NETTLE_UMAC64_AES_STATE_ID */
#line 33 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
  Nettle_UMAC64_AES_State_program = Pike_compiler->new_program;

#ifndef tObjImpl_NETTLE_UMAC64_AES_STATE

#undef tObjIs_NETTLE_UMAC64_AES_STATE
#define tObjIs_NETTLE_UMAC64_AES_STATE "\3\1\177\0\0\t"

#undef tObjImpl_NETTLE_UMAC64_AES_STATE
#define tObjImpl_NETTLE_UMAC64_AES_STATE "\3\0\177\0\0\t"

#endif /* tObjImpl_NETTLE_UMAC64_AES_STATE */

#ifdef THIS_NETTLE_UMAC64_AES_STATE
  Nettle_UMAC64_AES_State_storage_offset = ADD_STORAGE(struct Nettle_UMAC64_AES_State_struct);
#endif /* THIS_NETTLE_UMAC64_AES_STATE */

#ifdef extra_Nettle_UMAC64_AES_State_defined
#line 40 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
{
/* Perform an inherit of the MAC.State class that our parent
       * contains via its inherit of MAC.
       */
struct program *parent_prog = Pike_compiler->previous->new_program;
struct object *parent_obj = Pike_compiler->previous->fake_object;
int parent_State_fun_num =
really_low_find_shared_string_identifier(module_strings[0] /* "State" */,
parent_prog,
SEE_PROTECTED|SEE_PRIVATE);
if (parent_State_fun_num >= 0) {
struct program *parent_State_prog =
low_program_from_function(parent_obj, parent_State_fun_num);
if (parent_State_prog) {
parent_State_fun_num =
really_low_reference_inherited_identifier(Pike_compiler->previous,
0, parent_State_fun_num);
low_inherit(parent_State_prog, 0,
parent_State_fun_num,
1 + 42, 0, NULL);
}
}
}


#endif /* extra_Nettle_UMAC64_AES_State_defined */

#ifdef Nettle_UMAC64_AES_State_event_handler_defined
  pike_set_prog_event_callback(Nettle_UMAC64_AES_State_event_handler);

#ifndef Nettle_UMAC64_AES_State_gc_live_obj
  Pike_compiler->new_program->flags &= ~PROGRAM_LIVE_OBJ;

#endif /* Nettle_UMAC64_AES_State_gc_live_obj */

#endif /* Nettle_UMAC64_AES_State_event_handler_defined */
#line 34 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
  Pike_compiler->new_program->flags |= PROGRAM_NEEDS_PARENT|PROGRAM_USES_PARENT;
#line 33 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
  Nettle_UMAC64_AES_State_program=end_program();
#line 33 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
#ifdef Nettle_UMAC64_AES_State_program_fun_num_used
Nettle_UMAC64_AES_State_program_fun_num=
#endif
 add_program_constant("State",Nettle_UMAC64_AES_State_program,0);

#endif /* class_Nettle_UMAC64_AES_State_defined */

#ifdef Nettle_UMAC64_AES_event_handler_defined
  pike_set_prog_event_callback(Nettle_UMAC64_AES_event_handler);

#ifndef Nettle_UMAC64_AES_gc_live_obj
  Pike_compiler->new_program->flags &= ~PROGRAM_LIVE_OBJ;

#endif /* Nettle_UMAC64_AES_gc_live_obj */

#endif /* Nettle_UMAC64_AES_event_handler_defined */
#line 11 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
  Nettle_UMAC64_AES_program=end_program();
#line 11 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
#ifdef Nettle_UMAC64_AES_program_fun_num_used
Nettle_UMAC64_AES_program_fun_num=
#endif
 add_program_constant("UMAC64_AES",Nettle_UMAC64_AES_program,0);

#endif /* class_Nettle_UMAC64_AES_defined */

#ifdef class_Nettle_UMAC96_AES_defined

#ifdef PROG_NETTLE_UMAC96_AES_ID
#line 11 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
  START_NEW_PROGRAM_ID(NETTLE_UMAC96_AES);
#else
#line 11 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
  start_new_program();

#endif /* PROG_NETTLE_UMAC96_AES_ID */
#line 11 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
  Nettle_UMAC96_AES_program = Pike_compiler->new_program;

#ifndef tObjImpl_NETTLE_UMAC96_AES

#undef tObjIs_NETTLE_UMAC96_AES
#define tObjIs_NETTLE_UMAC96_AES "\3\1\177\0\0\n"

#undef tObjImpl_NETTLE_UMAC96_AES
#define tObjImpl_NETTLE_UMAC96_AES "\3\0\177\0\0\n"

#endif /* tObjImpl_NETTLE_UMAC96_AES */

#ifdef inherit_Nettle_MAC_Nettle_UMAC96_AES_defined
#line 15 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
  Nettle_UMAC96_AES_Nettle_MAC_inh_num = Pike_compiler->new_program->num_inherits;
#line 15 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
  low_inherit(Nettle_MAC_program, NULL, -1, 0, 0, NULL);
#line 15 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
  Nettle_UMAC96_AES_Nettle_MAC_inh_offset = Pike_compiler->new_program->inherits[Nettle_UMAC96_AES_Nettle_MAC_inh_num].identifier_level;

#endif /* inherit_Nettle_MAC_Nettle_UMAC96_AES_defined */

#ifdef class_Nettle_UMAC96_AES_State_defined

#ifdef PROG_NETTLE_UMAC96_AES_STATE_ID
#line 33 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
  START_NEW_PROGRAM_ID(NETTLE_UMAC96_AES_STATE);
#else
#line 33 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
  start_new_program();

#endif /* PROG_NETTLE_UMAC96_AES_STATE_ID */
#line 33 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
  Nettle_UMAC96_AES_State_program = Pike_compiler->new_program;

#ifndef tObjImpl_NETTLE_UMAC96_AES_STATE

#undef tObjIs_NETTLE_UMAC96_AES_STATE
#define tObjIs_NETTLE_UMAC96_AES_STATE "\3\1\177\0\0\v"

#undef tObjImpl_NETTLE_UMAC96_AES_STATE
#define tObjImpl_NETTLE_UMAC96_AES_STATE "\3\0\177\0\0\v"

#endif /* tObjImpl_NETTLE_UMAC96_AES_STATE */

#ifdef THIS_NETTLE_UMAC96_AES_STATE
  Nettle_UMAC96_AES_State_storage_offset = ADD_STORAGE(struct Nettle_UMAC96_AES_State_struct);
#endif /* THIS_NETTLE_UMAC96_AES_STATE */

#ifdef extra_Nettle_UMAC96_AES_State_defined
#line 40 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
{
/* Perform an inherit of the MAC.State class that our parent
       * contains via its inherit of MAC.
       */
struct program *parent_prog = Pike_compiler->previous->new_program;
struct object *parent_obj = Pike_compiler->previous->fake_object;
int parent_State_fun_num =
really_low_find_shared_string_identifier(module_strings[0] /* "State" */,
parent_prog,
SEE_PROTECTED|SEE_PRIVATE);
if (parent_State_fun_num >= 0) {
struct program *parent_State_prog =
low_program_from_function(parent_obj, parent_State_fun_num);
if (parent_State_prog) {
parent_State_fun_num =
really_low_reference_inherited_identifier(Pike_compiler->previous,
0, parent_State_fun_num);
low_inherit(parent_State_prog, 0,
parent_State_fun_num,
1 + 42, 0, NULL);
}
}
}


#endif /* extra_Nettle_UMAC96_AES_State_defined */

#ifdef Nettle_UMAC96_AES_State_event_handler_defined
  pike_set_prog_event_callback(Nettle_UMAC96_AES_State_event_handler);

#ifndef Nettle_UMAC96_AES_State_gc_live_obj
  Pike_compiler->new_program->flags &= ~PROGRAM_LIVE_OBJ;

#endif /* Nettle_UMAC96_AES_State_gc_live_obj */

#endif /* Nettle_UMAC96_AES_State_event_handler_defined */
#line 34 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
  Pike_compiler->new_program->flags |= PROGRAM_NEEDS_PARENT|PROGRAM_USES_PARENT;
#line 33 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
  Nettle_UMAC96_AES_State_program=end_program();
#line 33 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
#ifdef Nettle_UMAC96_AES_State_program_fun_num_used
Nettle_UMAC96_AES_State_program_fun_num=
#endif
 add_program_constant("State",Nettle_UMAC96_AES_State_program,0);

#endif /* class_Nettle_UMAC96_AES_State_defined */

#ifdef Nettle_UMAC96_AES_event_handler_defined
  pike_set_prog_event_callback(Nettle_UMAC96_AES_event_handler);

#ifndef Nettle_UMAC96_AES_gc_live_obj
  Pike_compiler->new_program->flags &= ~PROGRAM_LIVE_OBJ;

#endif /* Nettle_UMAC96_AES_gc_live_obj */

#endif /* Nettle_UMAC96_AES_event_handler_defined */
#line 11 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
  Nettle_UMAC96_AES_program=end_program();
#line 11 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
#ifdef Nettle_UMAC96_AES_program_fun_num_used
Nettle_UMAC96_AES_program_fun_num=
#endif
 add_program_constant("UMAC96_AES",Nettle_UMAC96_AES_program,0);

#endif /* class_Nettle_UMAC96_AES_defined */

#ifdef class_Nettle_UMAC128_AES_defined

#ifdef PROG_NETTLE_UMAC128_AES_ID
#line 11 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
  START_NEW_PROGRAM_ID(NETTLE_UMAC128_AES);
#else
#line 11 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
  start_new_program();

#endif /* PROG_NETTLE_UMAC128_AES_ID */
#line 11 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
  Nettle_UMAC128_AES_program = Pike_compiler->new_program;

#ifndef tObjImpl_NETTLE_UMAC128_AES

#undef tObjIs_NETTLE_UMAC128_AES
#define tObjIs_NETTLE_UMAC128_AES "\3\1\177\0\0\f"

#undef tObjImpl_NETTLE_UMAC128_AES
#define tObjImpl_NETTLE_UMAC128_AES "\3\0\177\0\0\f"

#endif /* tObjImpl_NETTLE_UMAC128_AES */

#ifdef inherit_Nettle_MAC_Nettle_UMAC128_AES_defined
#line 15 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
  Nettle_UMAC128_AES_Nettle_MAC_inh_num = Pike_compiler->new_program->num_inherits;
#line 15 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
  low_inherit(Nettle_MAC_program, NULL, -1, 0, 0, NULL);
#line 15 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
  Nettle_UMAC128_AES_Nettle_MAC_inh_offset = Pike_compiler->new_program->inherits[Nettle_UMAC128_AES_Nettle_MAC_inh_num].identifier_level;

#endif /* inherit_Nettle_MAC_Nettle_UMAC128_AES_defined */

#ifdef class_Nettle_UMAC128_AES_State_defined

#ifdef PROG_NETTLE_UMAC128_AES_STATE_ID
#line 33 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
  START_NEW_PROGRAM_ID(NETTLE_UMAC128_AES_STATE);
#else
#line 33 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
  start_new_program();

#endif /* PROG_NETTLE_UMAC128_AES_STATE_ID */
#line 33 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
  Nettle_UMAC128_AES_State_program = Pike_compiler->new_program;

#ifndef tObjImpl_NETTLE_UMAC128_AES_STATE

#undef tObjIs_NETTLE_UMAC128_AES_STATE
#define tObjIs_NETTLE_UMAC128_AES_STATE "\3\1\177\0\0\r"

#undef tObjImpl_NETTLE_UMAC128_AES_STATE
#define tObjImpl_NETTLE_UMAC128_AES_STATE "\3\0\177\0\0\r"

#endif /* tObjImpl_NETTLE_UMAC128_AES_STATE */

#ifdef THIS_NETTLE_UMAC128_AES_STATE
  Nettle_UMAC128_AES_State_storage_offset = ADD_STORAGE(struct Nettle_UMAC128_AES_State_struct);
#endif /* THIS_NETTLE_UMAC128_AES_STATE */

#ifdef extra_Nettle_UMAC128_AES_State_defined
#line 40 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
{
/* Perform an inherit of the MAC.State class that our parent
       * contains via its inherit of MAC.
       */
struct program *parent_prog = Pike_compiler->previous->new_program;
struct object *parent_obj = Pike_compiler->previous->fake_object;
int parent_State_fun_num =
really_low_find_shared_string_identifier(module_strings[0] /* "State" */,
parent_prog,
SEE_PROTECTED|SEE_PRIVATE);
if (parent_State_fun_num >= 0) {
struct program *parent_State_prog =
low_program_from_function(parent_obj, parent_State_fun_num);
if (parent_State_prog) {
parent_State_fun_num =
really_low_reference_inherited_identifier(Pike_compiler->previous,
0, parent_State_fun_num);
low_inherit(parent_State_prog, 0,
parent_State_fun_num,
1 + 42, 0, NULL);
}
}
}


#endif /* extra_Nettle_UMAC128_AES_State_defined */

#ifdef Nettle_UMAC128_AES_State_event_handler_defined
  pike_set_prog_event_callback(Nettle_UMAC128_AES_State_event_handler);

#ifndef Nettle_UMAC128_AES_State_gc_live_obj
  Pike_compiler->new_program->flags &= ~PROGRAM_LIVE_OBJ;

#endif /* Nettle_UMAC128_AES_State_gc_live_obj */

#endif /* Nettle_UMAC128_AES_State_event_handler_defined */
#line 34 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
  Pike_compiler->new_program->flags |= PROGRAM_NEEDS_PARENT|PROGRAM_USES_PARENT;
#line 33 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
  Nettle_UMAC128_AES_State_program=end_program();
#line 33 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
#ifdef Nettle_UMAC128_AES_State_program_fun_num_used
Nettle_UMAC128_AES_State_program_fun_num=
#endif
 add_program_constant("State",Nettle_UMAC128_AES_State_program,0);

#endif /* class_Nettle_UMAC128_AES_State_defined */

#ifdef Nettle_UMAC128_AES_event_handler_defined
  pike_set_prog_event_callback(Nettle_UMAC128_AES_event_handler);

#ifndef Nettle_UMAC128_AES_gc_live_obj
  Pike_compiler->new_program->flags &= ~PROGRAM_LIVE_OBJ;

#endif /* Nettle_UMAC128_AES_gc_live_obj */

#endif /* Nettle_UMAC128_AES_event_handler_defined */
#line 11 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
  Nettle_UMAC128_AES_program=end_program();
#line 11 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.H"
#ifdef Nettle_UMAC128_AES_program_fun_num_used
Nettle_UMAC128_AES_program_fun_num=
#endif
 add_program_constant("UMAC128_AES",Nettle_UMAC128_AES_program,0);

#endif /* class_Nettle_UMAC128_AES_defined */

#ifdef CMOD_MAP_PROGRAM_IDS_DEFINED
set_program_id_to_id( 0 );
#endif /* CMOD_MAP_PROGRAM_IDS_DEFINED */
#line 529 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
;
}

void
mac_exit(void)
{
werror("Nettle, mac exit\n");

#ifdef class_Nettle_MAC_defined

#ifdef class_Nettle_MAC_State_defined
  if(Nettle_MAC_State_program) {
#line 166 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
    free_program(Nettle_MAC_State_program);
    Nettle_MAC_State_program=0;
  }

#endif /* class_Nettle_MAC_State_defined */
  if(Nettle_MAC_program) {
#line 82 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
    free_program(Nettle_MAC_program);
    Nettle_MAC_program=0;
  }

#endif /* class_Nettle_MAC_defined */

#ifdef class_Nettle_POLY1305_AES_defined

#ifdef class_Nettle_POLY1305_AES_State_defined
  if(Nettle_POLY1305_AES_State_program) {
#line 33 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
    free_program(Nettle_POLY1305_AES_State_program);
    Nettle_POLY1305_AES_State_program=0;
  }

#endif /* class_Nettle_POLY1305_AES_State_defined */
  if(Nettle_POLY1305_AES_program) {
#line 11 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
    free_program(Nettle_POLY1305_AES_program);
    Nettle_POLY1305_AES_program=0;
  }

#endif /* class_Nettle_POLY1305_AES_defined */

#ifdef class_Nettle_UMAC32_AES_defined

#ifdef class_Nettle_UMAC32_AES_State_defined
  if(Nettle_UMAC32_AES_State_program) {
#line 33 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
    free_program(Nettle_UMAC32_AES_State_program);
    Nettle_UMAC32_AES_State_program=0;
  }

#endif /* class_Nettle_UMAC32_AES_State_defined */
  if(Nettle_UMAC32_AES_program) {
#line 11 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
    free_program(Nettle_UMAC32_AES_program);
    Nettle_UMAC32_AES_program=0;
  }

#endif /* class_Nettle_UMAC32_AES_defined */

#ifdef class_Nettle_UMAC64_AES_defined

#ifdef class_Nettle_UMAC64_AES_State_defined
  if(Nettle_UMAC64_AES_State_program) {
#line 33 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
    free_program(Nettle_UMAC64_AES_State_program);
    Nettle_UMAC64_AES_State_program=0;
  }

#endif /* class_Nettle_UMAC64_AES_State_defined */
  if(Nettle_UMAC64_AES_program) {
#line 11 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
    free_program(Nettle_UMAC64_AES_program);
    Nettle_UMAC64_AES_program=0;
  }

#endif /* class_Nettle_UMAC64_AES_defined */

#ifdef class_Nettle_UMAC96_AES_defined

#ifdef class_Nettle_UMAC96_AES_State_defined
  if(Nettle_UMAC96_AES_State_program) {
#line 33 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
    free_program(Nettle_UMAC96_AES_State_program);
    Nettle_UMAC96_AES_State_program=0;
  }

#endif /* class_Nettle_UMAC96_AES_State_defined */
  if(Nettle_UMAC96_AES_program) {
#line 11 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
    free_program(Nettle_UMAC96_AES_program);
    Nettle_UMAC96_AES_program=0;
  }

#endif /* class_Nettle_UMAC96_AES_defined */

#ifdef class_Nettle_UMAC128_AES_defined

#ifdef class_Nettle_UMAC128_AES_State_defined
  if(Nettle_UMAC128_AES_State_program) {
#line 33 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
    free_program(Nettle_UMAC128_AES_State_program);
    Nettle_UMAC128_AES_State_program=0;
  }

#endif /* class_Nettle_UMAC128_AES_State_defined */
  if(Nettle_UMAC128_AES_program) {
#line 11 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
    free_program(Nettle_UMAC128_AES_program);
    Nettle_UMAC128_AES_program=0;
  }

#endif /* class_Nettle_UMAC128_AES_defined */

#ifdef module_strings_declared
{
  int i;
  for(i=0; i < 2; i++) {
    if (module_strings[i]) free_string(module_strings[i]);
    module_strings[i] = NULL;
  }
}
#endif
#line 536 "/Users/hww3/devel/pike/src/post_modules/Nettle/mac.cmod"
;
}

#endif /* HAVE_LIBNETTLE */


#ifdef CMOD_MAP_PROGRAM_IDS_DEFINED
static int ___cmod_map_program_ids(int id)
{
  int i = 0;
  if( (id&0x7f000000) != 0x7f000000 ) return id;
  id = id&0x00ffffff;
#ifdef class_Nettle_UMAC64_AES_defined
if(id==8) return Nettle_UMAC64_AES_program->id;
#endif
#ifdef class_Nettle_UMAC64_AES_State_defined
if(id==9) return Nettle_UMAC64_AES_State_program->id;
#endif
#ifdef class_Nettle_UMAC96_AES_defined
if(id==10) return Nettle_UMAC96_AES_program->id;
#endif
#ifdef class_Nettle_MAC_defined
if(id==2) return Nettle_MAC_program->id;
#endif
#ifdef class_Nettle_UMAC96_AES_State_defined
if(id==11) return Nettle_UMAC96_AES_State_program->id;
#endif
#ifdef class_Nettle_MAC_State_defined
if(id==3) return Nettle_MAC_State_program->id;
#endif
#ifdef class_Nettle_UMAC128_AES_defined
if(id==12) return Nettle_UMAC128_AES_program->id;
#endif
#ifdef class_Nettle_POLY1305_AES_defined
if(id==4) return Nettle_POLY1305_AES_program->id;
#endif
#ifdef class_Nettle_UMAC128_AES_State_defined
if(id==13) return Nettle_UMAC128_AES_State_program->id;
#endif
#ifdef class_Nettle_POLY1305_AES_State_defined
if(id==5) return Nettle_POLY1305_AES_State_program->id;
#endif
#ifdef class_Nettle_UMAC32_AES_defined
if(id==6) return Nettle_UMAC32_AES_program->id;
#endif
#ifdef class_Nettle_UMAC32_AES_State_defined
if(id==7) return Nettle_UMAC32_AES_State_program->id;
#endif
  return 0;
}
#endif /* CMOD_MAP_PROGRAM_IDS_DEFINED */
