// main thread
 public void Init(Chan chan)
 {
     if (onInit != null)
     {
         DH.DHExchange(out secretSend, out modpowerSend);
         DH.DHExchange(out secretRecv, out modpowerRecv);
         onInit.Invoke(chan, modpowerSend, modpowerRecv);
     }
 }