pike.git / src / post_modules / Nettle / hash.H

version» Context lines:

pike.git/src/post_modules/Nettle/hash.H:87:    DOCSTART() @decl void create(string(8bit) passwd, void|int b)    *! @param passwd    *! The secret password (K).    *!    *! @param b    *! Block size. Must @expr{0@} (zero) or equal to the @[block_size()].    DOCEND()    PIKEFUN void create(string(8bit) passwd, void|int b)    flags ID_PROTECTED;    { -  const struct nettle_hash *meta = THIS->meta = ((struct Nettle_Hash_struct *)parent_storage(2, Nettle_Hash_program))->meta; +  const struct nettle_hash *meta = THIS->meta = +  ((struct Nettle_Hash_struct *) +  parent_storage(2, Nettle_Hash_program))->meta;    NO_WIDE_STRING(passwd); -  +  if (b && b->u.integer && (b->u.integer != meta->block_size)) { +  Pike_error("Block sizes other than %d are not supported.\n", +  meta->block_size); +  }    HMAC_SET_KEY(&THIS->ctx, meta, passwd->len, (const uint8_t *)passwd->str);    if (cmod_CONCAT_EVAL(f_Hash__HMAC_, NETTLE_NAME, _create_fun_num) != -1) {    /* Pass along the password to the inherited pike-level code. */    apply_current(cmod_CONCAT_EVAL(f_Hash__HMAC_, NETTLE_NAME,    _create_fun_num), args);    }    }       PIKEFUN string(8bit) `()(string(8bit) text)    flags ID_PROTECTED;