We present algorithms for computing the squared Weil and Tate pairings on elliptic curves and the squared Tate pairing on hyperelliptic curves. The squared pairings introduced in this paper have the advantage that our algorithms
for evaluating them are deterministic and do not depend on a random choice of points. Our algorithm to evaluate the squared
Weil pairing is about 20% more efficient than the standard Weil pairing. Our algorithm for the squared Tate pairing on elliptic
curves matches the efficiency of the algorithm given by Barreto, Lynn, and Scott in the case of arbitrary base points where
their denominator cancellation technique does not apply. Our algorithm for the squared Tate pairing for hyperelliptic curves
is the first detailed implementation of the pairing for general hyperelliptic curves of genus 2, and saves an estimated 30%
over the standard algorithm.