Abstract
In this paper, we develop semantic foundations for precise cost analyses of programs running on architectures with multi-scalar pipelines and in-order execution with branch prediction. This model is then used to prove the correction of an automatic cost analysis we designed. The analysis is implemented and evaluated in an extant framework for high-assurance cryptography. In this field, developers aggressively hand-optimize their code to take maximal advantage of micro-architectural features while looking for provable semantic guarantees.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Similar content being viewed by others
Notes
- 1.
Currently, Jasmin only supports x86 architectures. Note however that our method is not specific to x86, and can be applied to other architectures.
References
Companion report. https://hal.inria.fr/hal-03779257
Albert, E., Arenas, P., Genaim, S., Puebla, G.: Closed-form upper bounds in static cost analysis. J. Autom. Reason. 46, 161–203 (2011)
Almeida, J.B., et al.: Jasmin: high-assurance and high-speed cryptography. In: Proceedings of CCS’2017, pp. 1807–1823. ACM (2017)
Almeida, J.B., et al.: The last mile: high-assurance and high-speed cryptographic implementations. In: Proceedings of S &P’2020, pp. 965–982. IEEE (2020)
Barbosa, M., et al.: SoK: computer-aided cryptography. In: Proceedings of S &P 2021, pp. 777–795. IEEE (2021)
Barthe, G., Dupressoir, F., Grégoire, B., Kunz, C., Schmidt, B., Strub, P.-Y.: EasyCrypt: a tutorial. In: Aldini, A., Lopez, J., Martinelli, F. (eds.) FOSAD 2012-2013. LNCS, vol. 8604, pp. 146–166. Springer, Cham (2014). https://doi.org/10.1007/978-3-319-10082-1_6
Bernstein, D.J.: The Poly1305-AES message-authentication code. In: Gilbert, H., Handschuh, H. (eds.) FSE 2005. LNCS, vol. 3557, pp. 32–49. Springer, Heidelberg (2005). https://doi.org/10.1007/11502760_3
Bernstein, D.J.: Curve25519: new Diffie-Hellman speed records. In: Yung, M., Dodis, Y., Kiayias, A., Malkin, T. (eds.) PKC 2006. LNCS, vol. 3958, pp. 207–228. Springer, Heidelberg (2006). https://doi.org/10.1007/11745853_14
Bernstein, D.J.: ChaCha, a variant of Salsa20. In: Workshop Record of SASC 2008: The State of the Art of Stream Ciphers (2008)
Cauligi, S., et al.: Constant-time foundations for the new spectre era. In: Proceedings of PLDI’2020, pp. 913–926. ACM (2020)
Çiçek, E., Barthe, G., Gaboardi, M., Garg, D., Hoffmann, J.: Relational cost analysis. In: Proceedings of POPL 2017, pp. 316–329. ACM (2017)
Cousot, P., Cousot, R.: Abstract interpretation: a unified lattice model for static analysis of programs by construction or approximation of fixpoints. In: Proceedings of POPL 1977, pp. 238–252. ACM (1977)
Cousot, P., et al.: The ASTREÉ analyzer. In: Sagiv, M. (ed.) ESOP 2005. LNCS, vol. 3444, pp. 21–30. Springer, Heidelberg (2005). https://doi.org/10.1007/978-3-540-31987-0_3
Crary, K., Weirich, S.: Resource bound certification. In: Proceedings of POPL 2000, pp. 184–198. ACM (2000)
Daemen, J., Rijmen, V.: AES proposal: Rijndael, version 2 (1999). http://csrc.nist.gov/archive/aes/rijndael/Rijndael-ammended.pdf
Ferdinand, C., et al.: Reliable and precise WCET determination for a real-life processor. In: Henzinger, T.A., Kirsch, C.M. (eds.) EMSOFT 2001. LNCS, vol. 2211, pp. 469–485. Springer, Heidelberg (2001). https://doi.org/10.1007/3-540-45449-7_32
Fog, A.: The microarchitecture of Intel, AMD and VIA CPUs - An optimization guide for assembly programmers and compiler makers (2020). https://www.agner.org/optimize/microarchitecture.pdf
Fog, A.: The microarchitecture of Intel, AMD and VIA CPUs - instruction tables (2020). https://www.agner.org/optimize/instruction_tables.pdf
Gulwani, S., Mehra, K.K., Chilimbi, T.M.: SPEED: precise and efficient static estimation of program computational complexity. In: Proceedings of POPL 2009, pp. 127–139. ACM (2009)
Hahn, S., Reineke, J.: Design and analysis of SIC: a provably timing-predictable pipelined processor core. In: Proceedings of RTSS 2018, pp. 469–481. IEEE (2018)
Hughes, J., Pareto, L.: Recursion and dynamic data-structures in bounded space: towards embedded ML programming. In: Proceedings of ICFP 1999. pp. 70–81. ACM (1999)
Knoth, T., Wang, D., Polikarpova, N., Hoffmann, J.: Resource-guided program synthesis. In: Proceedings of PLDI 2019, pp. 253–268. ACM (2019)
Knoth, T., Wang, D., Reynolds, A., Hoffmann, J., Polikarpova, N.: Liquid resource types. In: Proceedings of ICFP 2020, pp. 106:1–106:29 (2020)
Ngo, V.C., Dehesa-Azuara, M., Fredrikson, M., Hoffmann, J.: Verifying and synthesizing constant-resource implementations with types. In: Proceedings of SP 2017, pp. 710–728. IEEE Computer Society (2017)
Nielson, H.R.: A Hoare-like proof system for analysing the computation time of programs. Sci. Comput. Program. 9(2), 107–136 (1987)
Reistad, B., Gifford, D.K.: Static dependent costs for estimating execution time. In: Proceedings of LFP1994, pp. 65–78. ACM (1994)
Reparaz, O., Balasch, J., Verbauwhede, I.: Dude, is my code constant time? In: Proceedings of DATE 2017, pp. 1697–1702. IEEE (2017)
Wegbreit, B.: Verifying program performance. J. ACM 23(4), 691–699 (1976)
Wilhelm, R., Grund, D., Reineke, J., Schlickling, M., Pister, M., Ferdinand, C.: Memory hierarchies, pipelines, and buses for future architectures in time-critical embedded systems. IEEE Trans. Comput. Aided Des. Integr. Circuits Syst. 28(7), 966–978 (2009)
Yourst, M.T.: PTLsim: a cycle accurate full system x86-64 microarchitectural simulator. In: Proceedings of ISPASS 2019, pp. 23–34. IEEE Computer Society (2007)
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2022 The Author(s), under exclusive license to Springer Nature Switzerland AG
About this paper
Cite this paper
Barthe, G., Koutsos, A., Mirliaz, S., Pichardie, D., Schwabe, P. (2022). Semantic Foundations for Cost Analysis of Pipeline-Optimized Programs. In: Singh, G., Urban, C. (eds) Static Analysis. SAS 2022. Lecture Notes in Computer Science, vol 13790. Springer, Cham. https://doi.org/10.1007/978-3-031-22308-2_17
Download citation
DOI: https://doi.org/10.1007/978-3-031-22308-2_17
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-031-22307-5
Online ISBN: 978-3-031-22308-2
eBook Packages: Computer ScienceComputer Science (R0)