pike.git / src / post_modules / Nettle / hogweed.cmod

version» Context lines:

pike.git/src/post_modules/Nettle/hogweed.cmod:98:    push_bignum((MP_INT *)&key.x);       dsa_private_key_clear(&key);    dsa_public_key_clear(&pub);       f_aggregate(5);    stack_pop_n_elems_keep_top(args); /* Remove p_bits, q_bits and rnd. */   }      /*! @decl array(object(Gmp.mpz)) @ -  *! rsa_generate_keypair(int bits, int e, function(int:string(0..255)) rnd) +  *! rsa_generate_keypair(int bits, int e, @ +  *! function(int:string(0..255)) rnd)    *!    *! Generates an RSA key pair with a @[bits] sized modulus (n), using    *! the provided value for @[e] and random function @[rnd].    *!    *! @returns    *! @array    *! @elem Gmp.mpz 0    *! The value n, the modulo.    *! @elem Gmp.mpz 1    *! The value d, the private exponent.
pike.git/src/post_modules/Nettle/hogweed.cmod:437:    */    PIKEFUN object(Gmp.mpz) get_private_key()    {    struct object *ret;    push_object(ret = fast_clone_object(get_auto_bignum_program()));    ecc_scalar_get(&THIS->key, (mpz_ptr)ret->storage);    }       /*! @decl void set_private_key(object(Gmp.mpz)|int k)    *! -  *! Set the private key. +  *! Set the private key (and corresponding private key).    *!    *! @note    *! Throws errors if the key isn't valid for the curve.    */    PIKEFUN void set_private_key(object(Gmp.mpz)|int k)    {    convert_svalue_to_bignum(k);    if (!ecc_scalar_set(&THIS->key, (mpz_srcptr)k->u.object->storage)) {    SIMPLE_ARG_ERROR("set_private_key", 1, "Invalid key for curve.");    } -  +  /* Set the corresponding public key, */ +  ecc_point_mul_g(&THIS->pub, &THIS->key);    }       /*! @decl object(Gmp.mpz) get_x()    *!    *! Get the x coordinate of the public key.    *!    *! @seealso    *! @[get_y()]    */    PIKEFUN object(Gmp.mpz) get_x()