A sharp bilinear estimate for the Klein--Gordon equation in arbitrary space-time dimensions