Efficient software implementation of elliptic curves and bilinear pairings