+ unsigned char randomdata[256];
+
+ /* Get random data */
+ if (rng)
+ silc_rng_get_rn_data(rng, sizeof(randomdata), randomdata,
+ sizeof(randomdata));
+ else
+ silc_rng_global_get_rn_data(rng, sizeof(randomdata), randomdata,
+ sizeof(randomdata));
+
+ return silc_auth_public_key_auth_generate_wpub(public_key, private_key,
+ randomdata, sizeof(randomdata),
+ hash, rng, id, type, generated,
+ context);
+}
+
+/* Generates Authentication Payload with authentication data. This is used
+ to do public key based authentication. This generates the random data
+ and the actual authentication data. Returns NULL on error. */
+
+SilcAsyncOperation
+silc_auth_public_key_auth_generate_wpub(SilcPublicKey public_key,
+ SilcPrivateKey private_key,
+ const unsigned char *pubdata,
+ SilcUInt32 pubdata_len,
+ SilcHash hash,
+ SilcRng rng,
+ const void *id, SilcIdType type,
+ SilcAuthGenerated generated,
+ void *context)
+{
+ SilcAuthGenerateContext a;
+ SilcAsyncOperation op;