compute master secret