This code was primarily written by Karthikeyan Bhargavan (INRIA). An earlier version was written by Jean Karim Zinzindohoue (INRIA).