Computing the cardinality of the Jacobian of a curve of genus 2 is an important task for cryptography. Mestre has proposed an algorithm based on the computation of the p-adic canonical lift using Richelot isogenies. We explain this algorithm and how to adapt it to use the many improvements that exist for elliptic curves.