Reference: The calculations are the customary ones based on the normal approximation to the binomial distribution. See for example Hypothesis Testing: Categorical Data - Estimation of Sample Size and Power for Comparing Two Binomial Proportions in Bernard Rosner's Fundamentals of Biostatistics.