I present formal correctness of a big integer library based on dynamically allocated lists. The package has been implemented in a programming language similar to C. In addition to the standard operations for big integers, the package provides a function which computes modulo exponentiation results using the square-and-multiply algorithm. We introduce predicates which help us deal with heap modification caused by function calls. Formal correctness has been verified with respect to partial correctness using the Hoare logic environment of the interactive theorem prover Isabelle.