Skip to main content

Proof Pearl: A Verified Bignum Implementation in x86-64 Machine Code

  • Conference paper
Certified Programs and Proofs (CPP 2013)

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 8307))

Included in the following conference series:

Abstract

Verification of machine code can easily deteriorate into an endless clutter of low-level details. This paper presents a case study which shows that machine-code verification does not necessitate ghastly low-level proofs. The case study we describe is the construction of an x86-64 implementation of arbitrary-precision integer arithmetic. Compared with closely related work, our proofs are shorter and, more importantly, the reasoning is at a more convenient high level of abstraction, e.g. pointer reasoning is largely avoided. We achieve this improvement as a result of using an abstraction for arrays and previously developed tools, namely, a proof-producing decompiler and compiler. The work presented in this paper has been developed in the HOL4 theorem prover. The case study resulted in 800 lines of verified 64-bit x86 machine code.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. GMP, the GNU multiple precision arithmetic library, http://gmplib.org/

  2. Affeldt, R.: On construction of a library of formally verified low-level arithmetic functions. Innovations in Systems and Software Engineering 9(2) (2013)

    Google Scholar 

  3. Appel, A.W.: Foundational proof-carrying code. In: Logic in Computer Science (LICS). IEEE Computer Society (2001)

    Google Scholar 

  4. Berghofer, S.: Verification of dependable software using spark and isabelle. In: Brauer, J., Roveri, M., Tews, H. (eds.) Systems Software Verification (SSV). OASICS, Schloss Dagstuhl - Leibniz-Zentrum fuer Informatik (2011)

    Google Scholar 

  5. Chlipala, A.: Mostly-automated verification of low-level programs in computational separation logic. In: Hall, M.W., Padua, D.A. (eds.) Programming Language Design and Implementation (PLDI). ACM (2011)

    Google Scholar 

  6. Fischer, S.: Formal verification of a big integer library. In: DATE 2008: Workshop on Dependable Software Systems (2008), http://busserver.cs.uni-sb.de/publikationen/Fi08DATE.pdf

  7. Harrison, J.: A HOL theory of euclidean space. In: Hurd, J., Melham, T. (eds.) TPHOLs 2005. LNCS, vol. 3603, pp. 114–129. Springer, Heidelberg (2005)

    Chapter  Google Scholar 

  8. Jensen, J.B., Benton, N., Kennedy, A.: High-level separation logic for low-level code. In: Principles of Programming Languages (POPL). ACM (2013)

    Google Scholar 

  9. Knuth, D.E.: The art of computer programming, 2nd edn. Seminumerical Algorithms, vol. 2. Addison Wesley Longman Publishing (1981)

    Google Scholar 

  10. Leroy, X.: Formal certification of a compiler back-end, or: programming a compiler with a proof assistant. In: Morrisett, J.G., Jones, S.L.P. (eds.) Principles of Programming Languages (POPL). ACM (2006)

    Google Scholar 

  11. Moore, J.S.: A mechanically verified language implementation. Journal of Automated Reasoning 5 (1989)

    Google Scholar 

  12. Morrisett, G., Tan, G., Tassarotti, J., Tristan, J.B., Gan, E.: RockSalt: better, faster, stronger SFI for the x86. In: Vitek, J., Lin, H., Tip, F. (eds.) Programming Language Design and Implementation (PLDI). ACM (2012)

    Google Scholar 

  13. Myreen, M., Gordon, M.J.C.: Verification of machine code implementations of arithmetic functions for cryptography. In: Schneider, K., Brandt, J. (eds.) Theorem Proving in Higher Order Logics, Emerging Trends Proceedings (TPHOLs, Poster Session), University of Kaiserslautern, Internal Report 364/07 (2007)

    Google Scholar 

  14. Myreen, M.O.: Formal verification of machine-code programs. Ph.D. thesis, University of Cambridge (2009)

    Google Scholar 

  15. Myreen, M.O.: Verified just-in-time compiler on x86. In: Hermenegildo, M.V., Palsberg, J. (eds.) Principles of Programming Languages (POPL). ACM (2010)

    Google Scholar 

  16. Myreen, M.O., Davis, J.: A verified runtime for a verified theorem prover. In: van Eekelen, M., Geuvers, H., Schmaltz, J., Wiedijk, F. (eds.) ITP 2011. LNCS, vol. 6898, pp. 265–280. Springer, Heidelberg (2011)

    Chapter  Google Scholar 

  17. Necula, G.C.: Proof-carrying code. In: Principles of Programming Languages (POPL). ACM (1997)

    Google Scholar 

  18. Reynolds, J.: Separation logic: A logic for shared mutable data structures. In: Logic in Computer Science (LICS). IEEE Computer Society (2002)

    Google Scholar 

  19. Schirmer, N.: Verification of Sequential Imperative Programs in Isabelle/HOL. Ph.D. thesis, Technical University of Munich (2006)

    Google Scholar 

  20. Slind, K., Norrish, M.: A brief overview of HOL4. In: Mohamed, O.A., Muñoz, C., Tahar, S. (eds.) TPHOLs 2008. LNCS, vol. 5170, pp. 28–32. Springer, Heidelberg (2008)

    Chapter  Google Scholar 

  21. Tan, G., Appel, A.W.: A compositional logic for control flow. In: Emerson, E.A., Namjoshi, K.S. (eds.) VMCAI 2006. LNCS, vol. 3855, pp. 80–94. Springer, Heidelberg (2006)

    Chapter  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2013 Springer International Publishing Switzerland

About this paper

Cite this paper

Myreen, M.O., Curello, G. (2013). Proof Pearl: A Verified Bignum Implementation in x86-64 Machine Code. In: Gonthier, G., Norrish, M. (eds) Certified Programs and Proofs. CPP 2013. Lecture Notes in Computer Science, vol 8307. Springer, Cham. https://doi.org/10.1007/978-3-319-03545-1_5

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-03545-1_5

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-03544-4

  • Online ISBN: 978-3-319-03545-1

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics