Skip to main content

Formal Verification of Arithmetic Masking in Hardware and Software

  • Conference paper
  • First Online:
Applied Cryptography and Network Security (ACNS 2023)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 13905))

Included in the following conference series:

Abstract

Masking is a popular countermeasure to protect cryptographic implementations against physical attacks like differential power analysis. So far, research focused on Boolean masking for symmetric algorithms like AES and Keccak. With the advent of post-quantum cryptography (PQC), arithmetic masking has received increasing attention because many PQC algorithms require a combination of arithmetic and Boolean masking and respective conversion algorithms (A2B/B2A), which represent an interesting but very challenging research topic. While there already exist formal verification concepts for Boolean masked implementations, the same cannot be said about arithmetic masking and accompanying mask conversion algorithms.

In this work, we demonstrate the first formal verification approach for (any-order) Boolean and arithmetic masking which can be applied to both hardware and software, while considering side-effects such as glitches and transitions. First, we show how a formal verification approach for Boolean masking can be used in the context of arithmetic masking such that we can verify A2B/B2A conversions for arbitrary masking orders. We investigate various conversion algorithms in hardware and software, and point out several new findings such as glitch-based issues for straightforward implementations of Coron et al.-A2B in hardware, transition-based leakage in Goubin-A2B in software, and more general implementation pitfalls when utilizing common optimization techniques in PQC. We provide the first formal analysis of table-based A2Bs from a probing security perspective and point out that they might not be easy to implement securely on processors that use of memory buffers or caches.

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 89.00
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 119.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

Notes

  1. 1.

    https://github.com/barbara-gigerl/arithmetic-masking-hw-sw.

  2. 2.

    https://github.com/IAIK/coco-ibex.

  3. 3.

    Runtime of a few hours for a single 32-bit addition.

References

  1. Adomnicai, A., Fournier, J.J.A., Masson, L.: Bricklayer attack: a side-channel analysis on the ChaCha quarter round. In: Patra, A., Smart, N.P. (eds.) INDOCRYPT 2017. LNCS, vol. 10698, pp. 65–84. Springer, Cham (2017). https://doi.org/10.1007/978-3-319-71667-1_4

    Chapter  Google Scholar 

  2. Barrett, P.: Implementing the Rivest Shamir and Adleman Public key encryption algorithm on a standard digital signal processor. In: Odlyzko, A.M. (ed.) CRYPTO 1986. LNCS, vol. 263, pp. 311–323. Springer, Heidelberg (1987). https://doi.org/10.1007/3-540-47721-7_24

    Chapter  Google Scholar 

  3. Barthe, G., Belaïd, S., Cassiers, G., Fouque, P.-A., Grégoire, B., Standaert, F.-X.: maskVerif: automated verification of higher-order masking in presence of physical defaults. In: Sako, K., Schneider, S., Ryan, P.Y.A. (eds.) ESORICS 2019. LNCS, vol. 11735, pp. 300–318. Springer, Cham (2019). https://doi.org/10.1007/978-3-030-29959-0_15

    Chapter  Google Scholar 

  4. Barthe, G., Belaïd, S., Dupressoir, F., Fouque, P.-A., Grégoire, B., Strub, P.-Y.: Verified proofs of higher-order masking. In: Oswald, E., Fischlin, M. (eds.) EUROCRYPT 2015. LNCS, vol. 9056, pp. 457–485. Springer, Heidelberg (2015). https://doi.org/10.1007/978-3-662-46800-5_18

    Chapter  Google Scholar 

  5. Barthe, G., et al.: Masking the GLP lattice-based signature scheme at any order. In: Nielsen, J.B., Rijmen, V. (eds.) EUROCRYPT 2018. LNCS, vol. 10821, pp. 354–384. Springer, Cham (2018). https://doi.org/10.1007/978-3-319-78375-8_12

    Chapter  Google Scholar 

  6. Barthe, G., Gourjon, M., Grégoire, B., Orlt, M., Paglialonga, C., Porth, L.: Masking in fine-grained leakage models: construction, implementation and verification. IACR Trans. Cryptogr. Hardw. Embed. Syst. 2021(2), 189–228 (2021)

    Article  Google Scholar 

  7. Beaulieu, R., Shors, D., Smith, J., Treatman-Clark, S., Weeks, B., Wingers, L.: The SIMON and SPECK families of lightweight block ciphers. IACR Cryptol. ePrint Arch. 404 (2013)

    Google Scholar 

  8. Beierle, C., et al.: Alzette: a 64-bit ARX-box. In: Micciancio, D., Ristenpart, T. (eds.) CRYPTO 2020. LNCS, vol. 12172, pp. 419–448. Springer, Cham (2020). https://doi.org/10.1007/978-3-030-56877-1_15

    Chapter  Google Scholar 

  9. Beirendonck, M.V., D’Anvers, J., Verbauwhede, I.: Analysis and comparison of table-based arithmetic to boolean masking. IACR Cryptol. ePrint Arch. 2021, 67 (2021)

    Google Scholar 

  10. Bernstein, D.J.: ChaCha, a variant of Salsa20. In: Workshop Record of SASC, vol. 8, pp. 3–5 (2008)

    Google Scholar 

  11. Bettale, L., Coron, J., Zeitoun, R.: Improved high-order conversion from boolean to arithmetic masking. IACR Trans. Cryptogr. Hardw. Embed. Syst. 2018(2), 22–45 (2018)

    Article  Google Scholar 

  12. Bhasin, S., Guilley, S., Sauvage, L., Danger, J.-L.: Unrolling cryptographic circuits: a simple countermeasure against side-channel attacks. In: Pieprzyk, J. (ed.) CT-RSA 2010. LNCS, vol. 5985, pp. 195–207. Springer, Heidelberg (2010). https://doi.org/10.1007/978-3-642-11925-5_14

    Chapter  Google Scholar 

  13. Bloem, R., Gross, H., Iusupov, R., Könighofer, B., Mangard, S., Winter, J.: Formal verification of masked hardware implementations in the presence of glitches. In: Nielsen, J.B., Rijmen, V. (eds.) EUROCRYPT 2018. LNCS, vol. 10821, pp. 321–353. Springer, Cham (2018). https://doi.org/10.1007/978-3-319-78375-8_11

    Chapter  MATH  Google Scholar 

  14. Bos, J.W., Gourjon, M., Renes, J., Schneider, T., van Vredendaal, C.: Masking kyber: first- and higher-order implementations. IACR Cryptol. ePrint Arch. 2021, 483 (2021)

    Google Scholar 

  15. Botros, L., Kannwischer, M.J., Schwabe, P.: Memory-efficient high-speed implementation of kyber on cortex-M4. In: Buchmann, J., Nitaj, A., Rachidi, T. (eds.) AFRICACRYPT 2019. LNCS, vol. 11627, pp. 209–228. Springer, Cham (2019). https://doi.org/10.1007/978-3-030-23696-0_11

    Chapter  Google Scholar 

  16. Chen, C., Eisenbarth, T., von Maurich, I., Steinwandt, R.: Masking large keys in hardware: a masked implementation of McEliece. In: Dunkelman, O., Keliher, L. (eds.) SAC 2015. LNCS, vol. 9566, pp. 293–309. Springer, Cham (2016). https://doi.org/10.1007/978-3-319-31301-6_18

    Chapter  MATH  Google Scholar 

  17. De Cnudde, T., Bilgin, B., Gierlichs, B., Nikov, V., Nikova, S., Rijmen, V.: Does coupling affect the security of masked implementations? In: Guilley, S. (ed.) COSADE 2017. LNCS, vol. 10348, pp. 1–18. Springer, Cham (2017). https://doi.org/10.1007/978-3-319-64647-3_1

    Chapter  Google Scholar 

  18. De Cnudde, T., Reparaz, O., Bilgin, B., Nikova, S., Nikov, V., Rijmen, V.: Masking AES with \(d+1\) shares in hardware. In: Gierlichs, B., Poschmann, A.Y. (eds.) CHES 2016. LNCS, vol. 9813, pp. 194–212. Springer, Heidelberg (2016). https://doi.org/10.1007/978-3-662-53140-2_10

    Chapter  MATH  Google Scholar 

  19. Coron, J.-S.: High-order conversion from boolean to arithmetic masking. In: Fischer, W., Homma, N. (eds.) CHES 2017. LNCS, vol. 10529, pp. 93–114. Springer, Cham (2017). https://doi.org/10.1007/978-3-319-66787-4_5

    Chapter  Google Scholar 

  20. Coron, J., Gérard, F., Montoya, S., Zeitoun, R.: High-order table-based conversion algorithms and masking lattice-based encryption. IACR Trans. Cryptogr. Hardw. Embed. Syst. 2022(2), 1–40 (2022)

    Google Scholar 

  21. Coron, J.-S., Giraud, C., Prouff, E., Renner, S., Rivain, M., Vadnala, P.K.: Conversion of security proofs from one leakage model to another: a new issue. In: Schindler, W., Huss, S.A. (eds.) COSADE 2012. LNCS, vol. 7275, pp. 69–81. Springer, Heidelberg (2012). https://doi.org/10.1007/978-3-642-29912-4_6

    Chapter  Google Scholar 

  22. Coron, J.-S., Großschädl, J., Tibouchi, M., Vadnala, P.K.: Conversion from arithmetic to boolean masking with logarithmic complexity. In: Leander, G. (ed.) FSE 2015. LNCS, vol. 9054, pp. 130–149. Springer, Heidelberg (2015). https://doi.org/10.1007/978-3-662-48116-5_7

    Chapter  Google Scholar 

  23. Coron, J.-S., Großschädl, J., Vadnala, P.K.: Secure conversion between boolean and arithmetic masking of any order. In: Batina, L., Robshaw, M. (eds.) CHES 2014. LNCS, vol. 8731, pp. 188–205. Springer, Heidelberg (2014). https://doi.org/10.1007/978-3-662-44709-3_11

    Chapter  MATH  Google Scholar 

  24. Coron, J.-S., Prouff, E., Rivain, M., Roche, T.: Higher-order side channel security and mask refreshing. In: Moriai, S. (ed.) FSE 2013. LNCS, vol. 8424, pp. 410–424. Springer, Heidelberg (2014). https://doi.org/10.1007/978-3-662-43933-3_21

    Chapter  Google Scholar 

  25. Coron, J.-S., Tchulkine, A.: A new algorithm for switching from arithmetic to boolean masking. In: Walter, C.D., Koç, Ç.K., Paar, C. (eds.) CHES 2003. LNCS, vol. 2779, pp. 89–97. Springer, Heidelberg (2003). https://doi.org/10.1007/978-3-540-45238-6_8

    Chapter  Google Scholar 

  26. Debraize, B.: Efficient and provably secure methods for switching from arithmetic to boolean masking. In: Prouff, E., Schaumont, P. (eds.) CHES 2012. LNCS, vol. 7428, pp. 107–121. Springer, Heidelberg (2012). https://doi.org/10.1007/978-3-642-33027-8_7

    Chapter  MATH  Google Scholar 

  27. Dinu, D., Großschädl, J., Corre, Y.L.: Efficient masking of ARX-based block ciphers using carry-save addition on boolean shares. In: Nguyen, P.Q., Zhou, J. (eds.) ISC 2017. LNCS, vol. 10599, pp. 39–57. Springer, Cham (2017). https://doi.org/10.1007/978-3-319-69659-1_3

    Chapter  Google Scholar 

  28. Faust, S., Grosso, V., Pozo, S.M.D., Paglialonga, C., Standaert, F.: Composable masking schemes in the presence of physical defaults & the robust probing model. IACR Trans. Cryptogr. Hardw. Embed. Syst. 2018(3), 89–120 (2018)

    Article  Google Scholar 

  29. Fritzmann, T., et al.: Masked accelerators and instruction set extensions for post-quantum cryptography. IACR Cryptol. ePrint Arch. 2021, 479 (2021)

    Google Scholar 

  30. Fujisaki, E., Okamoto, T.: Secure integration of asymmetric and symmetric encryption schemes. In: Wiener, M. (ed.) CRYPTO 1999. LNCS, vol. 1666, pp. 537–554. Springer, Heidelberg (1999). https://doi.org/10.1007/3-540-48405-1_34

    Chapter  Google Scholar 

  31. Gao, P.: Formal verification of masking countermeasures for arithmetic programs. In: 35th IEEE/ACM International Conference on Automated Software Engineering, ASE 2020, Melbourne, Australia, 21–25 September 2020, pp. 1385–1387. IEEE (2020)

    Google Scholar 

  32. Gao, P., Xie, H., Song, F., Chen, T.: A hybrid approach to formal verification of higher-order masked arithmetic programs. CoRR, abs/2006.09171 (2020)

    Google Scholar 

  33. Gao, P., Xie, H., Zhang, J., Song, F., Chen, T.: Quantitative verification of masked arithmetic programs against side-channel attacks. In: Vojnar, T., Zhang, L. (eds.) TACAS 2019. LNCS, vol. 11427, pp. 155–173. Springer, Cham (2019). https://doi.org/10.1007/978-3-030-17462-0_9

    Chapter  Google Scholar 

  34. Gao, P., Zhang, J., Song, F., Wang, C.: Verifying and quantifying side-channel resistance of masked software implementations. ACM Trans. Softw. Eng. Methodol. 28(3), 16:1–16:32 (2019)

    Google Scholar 

  35. Gérard, F., Rossi, M.: An efficient and provable masked implementation of qTESLA. In: Belaïd, S., Güneysu, T. (eds.) CARDIS 2019. LNCS, vol. 11833, pp. 74–91. Springer, Cham (2020). https://doi.org/10.1007/978-3-030-42068-0_5

    Chapter  Google Scholar 

  36. Gigerl, B., Hadzic, V., Primas, R., Mangard, S., Bloem, R.: Coco: co-design and co-verification of masked software implementations on CPUs. In: 30th USENIX Security Symposium, USENIX Security 2021 (2021)

    Google Scholar 

  37. Gigerl, B., Primas, R., Mangard, S.: Secure and efficient software masking on superscalar pipelined processors. In: Tibouchi, M., Wang, H. (eds.) ASIACRYPT 2021. LNCS, vol. 13091, pp. 3–32. Springer, Cham (2021). https://doi.org/10.1007/978-3-030-92075-3_1

    Chapter  Google Scholar 

  38. Goodwill, G., Jun, B., Jaffe, J., Rohatgi, P.: A testing methodology for side-channel resistance validation. In: NIST Non-Invasive Attack Testing Workshop (2011)

    Google Scholar 

  39. Goubin, L.: A sound method for switching between boolean and arithmetic masking. In: Koç, Ç.K., Naccache, D., Paar, C. (eds.) CHES 2001. LNCS, vol. 2162, pp. 3–15. Springer, Heidelberg (2001). https://doi.org/10.1007/3-540-44709-1_2

    Chapter  Google Scholar 

  40. Groß, H., Iusupov, R., Bloem, R.: Generic low-latency masking in hardware. IACR Trans. Cryptogr. Hardw. Embed. Syst. 2018(2), 1–21 (2018)

    Google Scholar 

  41. Groß, H., Mangard, S., Korak, T.: Domain-oriented masking: compact masked hardware implementations with arbitrary protection order. In: Proceedings of the ACM Workshop on Theory of Implementation Security, TIS@CCS 2016, Vienna, Austria, October 2016, p. 3. ACM (2016)

    Google Scholar 

  42. Hadzic, V., Bloem, R.: COCOALMA: a versatile masking verifier. In: Formal Methods in Computer Aided Design, FMCAD 2021, New Haven, CT, USA, 19–22 October 2021, pp. 1–10. IEEE (2021)

    Google Scholar 

  43. Hutter, M., Tunstall, M.: Constant-time higher-order boolean-to-arithmetic masking. J. Cryptogr. Eng. 9(2), 173–184 (2019)

    Article  Google Scholar 

  44. Ishai, Y., Sahai, A., Wagner, D.: Private circuits: securing hardware against probing attacks. In: Boneh, D. (ed.) CRYPTO 2003. LNCS, vol. 2729, pp. 463–481. Springer, Heidelberg (2003). https://doi.org/10.1007/978-3-540-45146-4_27

    Chapter  Google Scholar 

  45. Karroumi, M., Richard, B., Joye, M.: Addition with blinded operands. In: Prouff, E. (ed.) COSADE 2014. LNCS, vol. 8622, pp. 41–55. Springer, Cham (2014). https://doi.org/10.1007/978-3-319-10175-0_4

    Chapter  Google Scholar 

  46. Knichel, D., Sasdrich, P., Moradi, A.: SILVER – statistical independence and leakage verification. In: Moriai, S., Wang, H. (eds.) ASIACRYPT 2020. LNCS, vol. 12491, pp. 787–816. Springer, Cham (2020). https://doi.org/10.1007/978-3-030-64837-4_26

    Chapter  Google Scholar 

  47. Kocher, P., Jaffe, J., Jun, B.: Differential power analysis. In: Wiener, M. (ed.) CRYPTO 1999. LNCS, vol. 1666, pp. 388–397. Springer, Heidelberg (1999). https://doi.org/10.1007/3-540-48405-1_25

    Chapter  Google Scholar 

  48. Mangard, S., Popp, T., Gammel, B.M.: Side-channel leakage of masked CMOS gates. In: Menezes, A. (ed.) CT-RSA 2005. LNCS, vol. 3376, pp. 351–365. Springer, Heidelberg (2005). https://doi.org/10.1007/978-3-540-30574-3_24

    Chapter  Google Scholar 

  49. Mano, M.M.: Computer System Architecture. Prentice Hall, Hoboken (1982)

    MATH  Google Scholar 

  50. Meunier, Q.L., Pons, E., Heydemann, K.: Leakageverif: scalable and efficient leakage verification in symbolic expressions. IACR Cryptol. ePrint Arch. 1468 (2021)

    Google Scholar 

  51. Montgomery, P.L.: Modular multiplication without trial division. Math. Comput. 44(170), 519–521 (1985)

    Article  MathSciNet  MATH  Google Scholar 

  52. Moos, T., Moradi, A., Schneider, T., Standaert, F.: Glitch-resistant masking revisited or why proofs in the robust probing model are needed. IACR Trans. Cryptogr. Hardw. Embed. Syst. 2019(2), 256–292 (2019)

    Article  Google Scholar 

  53. National Institute of Standards and Technology (NIST). FIPS-180-2: Secure Hash Standard (2002)

    Google Scholar 

  54. Neiße, O., Pulkus, J.: Switching blindings with a view towards IDEA. In: Joye, M., Quisquater, J.-J. (eds.) CHES 2004. LNCS, vol. 3156, pp. 230–239. Springer, Heidelberg (2004). https://doi.org/10.1007/978-3-540-28632-5_17

    Chapter  Google Scholar 

  55. Oder, T., Schneider, T., Pöppelmann, T., Güneysu, T.: Practical CCA2-secure and masked ring-LWE implementation. IACR Trans. Cryptogr. Hardw. Embed. Syst. 2018(1), 142–174 (2018)

    Article  Google Scholar 

  56. O’Donnell, R.: Analysis of Boolean Functions. Cambridge University Press, Cambridge (2014)

    Book  MATH  Google Scholar 

  57. Quisquater, J.-J., Samyde, D.: ElectroMagnetic analysis (EMA): measures and counter-measures for smart cards. In: Attali, I., Jensen, T. (eds.) E-smart 2001. LNCS, vol. 2140, pp. 200–210. Springer, Heidelberg (2001). https://doi.org/10.1007/3-540-45418-7_17

    Chapter  MATH  Google Scholar 

  58. Reparaz, O., Bilgin, B., Nikova, S., Gierlichs, B., Verbauwhede, I.: Consolidating masking schemes. In: Gennaro, R., Robshaw, M. (eds.) CRYPTO 2015. LNCS, vol. 9215, pp. 764–783. Springer, Heidelberg (2015). https://doi.org/10.1007/978-3-662-47989-6_37

    Chapter  Google Scholar 

  59. Schneider, T., Moradi, A., Güneysu, T.: Arithmetic addition over boolean masking. In: Malkin, T., Kolesnikov, V., Lewko, A.B., Polychronakis, M. (eds.) ACNS 2015. LNCS, vol. 9092, pp. 559–578. Springer, Cham (2015). https://doi.org/10.1007/978-3-319-28166-7_27

    Chapter  MATH  Google Scholar 

  60. Schneider, T., Paglialonga, C., Oder, T., Güneysu, T.: Efficiently masking binomial sampling at arbitrary orders for lattice-based crypto. In: Lin, D., Sako, K. (eds.) PKC 2019. LNCS, vol. 11443, pp. 534–564. Springer, Cham (2019). https://doi.org/10.1007/978-3-030-17259-6_18

    Chapter  Google Scholar 

  61. Turan, M.S., et al.: Status report on the second round of the NIST lightweight cryptography standardization process. Technical report, Gaithersburg, MD, USA (2021). https://doi.org/10.6028/NIST.IR.8369

Download references

Acknowledgements

This work was supported by the TU Graz LEAD project “Dependable Internet of Things in Adverse Environments”. Additionally, this project has received funding from the European Research Council (ERC) under the European Union’s Horizon 2020 research and innovation programme (grant agreement No 681402).

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Barbara Gigerl .

Editor information

Editors and Affiliations

Appendices

A Iterative and Unrolled Circuits

Fig. 3.
figure 3

Iterative circuit [12]

Fig. 4.
figure 4

Unrolled circuit [12]

B Fourier Expansion of the Arithmetic Addition

Recall the Fourier expansion of the AND, OR and XOR functions:

$$\begin{aligned} \textsc {And}\quad W(a \wedge b)&= \frac{1}{2} + \frac{1}{2}a + \frac{1}{2}b - \frac{1}{2}ab \\ \textsc {Or}\quad W(a \vee b)&= -\frac{1}{2} + \frac{1}{2}a + \frac{1}{2}b + \frac{1}{2}ab \\ \textsc {Xor}\quad W(a \oplus b)&= ab \end{aligned}$$

Additionally, note that Fourier expansions represent Boolean functions as a polynomial over the real domain \(\{1,-1\}\), where 1 represents False and −1 represents True. Consequently, monomials \(x^c\) with even exponents c evaluate to 1 in Fourier expansions. The Fourier expansion of the carry and sum can hence be expressed as:

$$\begin{aligned} \textsc {Carry} &W(c^{(j)}) = W((u^{(j)} \oplus u^{(j)}) \wedge c^{(j-1)}) \vee (u^{(j)} \wedge u^{(j)})) \\&= -(0.25u^{(j)})^2 (u^{(j)})^2 c^{(j-1)} - 0.25 (u^{(j)})^2 (u^{(j)})^2 - 0.25 (u^{(j)})^2 u^{(j)} c^{(j-1)}\\&- 0.25 u^{(j)} (u^{(j)}) ^2 c^{(j-1)} + (0.25 u^{(j)})^2 u^{(j)} + 0.25 u^{(j)} (u^{(j)}) ^2\\&- 0.5 u^{(j)} u^{(j)} c^{(j-1)} + 0.25 u^{(j)} c^{(j-1)} + 0.25 u^{(j)} c^{(j-1)} \\&+ 0.25 u^{(j)} + 0.25 u^{(j)} + 0.25 c^{(j-1)} + 0.25 \\&= 0.25 c^{(j-1)} - 0.25 - 0.25 u^{(j)} c^{(j-1)} - 0.25 u^{(j)} c^{(j-1)} + 0.25 u^{(j)}\\&+ 0.25 u^{(j)} - 0.5 u^{(j)} u^{(j)} c^{(j-1)} + 0.25 u^{(j)} c^{(j-1)} + 0.25 u^{(j)} c^{(j-1)} \\&+ 0.25 u^{(j)} + 0.25 u^{(j)} + 0.25 c^{(j-1)} + 0.25 \\&= 0.5 c^{(j-1)} + 0.5 u^{(j)} + 0.5 u^{(j)} - 0.5 u^{(j)} u^{(j)} c^{(j-1)} \\&W(c[0]) = 1 \\ \textsc {Sum} \quad&W(sum^{(j)}) = W(W(u^{(j)} \oplus u^{(j)}) \oplus c^{(j)}) \\&= W(u^{(j)}u^{(j)} \oplus c^{(j)} ) \\&= u^{(j)}u^{(j)} W(c^{(j)} ) \\&= 0.5u^{(j)} u^{(j)} c^{(j)} + 0.5 u^{(j)} + 0.5 u^{(j)} - 0.5 c^{(j)} \end{aligned}$$
Fig. 5.
figure 5

Schematic image of Coron et al.-A2B [23] when implemented in hardware. The arithmetic input shares \(a_0, a_1\) are transformed into Boolean shares \(b_0, b_1\). The carry computation happens in the SecAdd module, from which we draw the first part responsible for bits 0 of the final result.

C Coron et al.-A2B

D Sanity Check Measurement Setup (RNG Off)

Fig. 6.
figure 6

T-test statistics of the fixed version of Coron et al.-A2B with 400 000 traces and RNG off.

E Schneider et al.-B2A [60]

figure bc

F Debraize-A2B

figure bd

G Goubin [39]

figure be

Overwrite Leakages. In line 9 of the algorithm, the attacker probes the re-assignment of Y:

$$\begin{aligned} Y_\text {old}&= Y_{\text {line }6} \wedge a_1 \\&= (Y_{\text {line }1} \oplus b_{0\text {line }5}) \wedge a_1 \\&= (Y_{\text {line }1} \oplus (T \oplus a_0)) \wedge a_1 \\ Y_\text {new}&= T \wedge a_0 \\ Y_\text {old} \oplus Y_\text {new}&= ((Y_{\text {line }1} \oplus (T \oplus a_0)) \wedge a_1) \oplus (T \wedge a_0) \\&= (a_0 \wedge a_1) \oplus (a_0 \wedge T) \oplus (a_1 \wedge Y) \end{aligned}$$

Hence, for every bit \(>= 0\), this expression will correlate with native value a.

False Positive in Goubin-A2B. Assume the attacker probes the expression \(\varOmega \oplus Y_\text {line 9}\) in line 10, which is \((Y^{(0)} \wedge (Y^{(0)} \oplus {a}_1^{(0)})) \oplus ({a}_1^{(0)} \wedge (Y^{(0)} \oplus a_0^{(0)})) \). For reasons of readability, we omit to indicate that we always refer to the LSB, i.e., skip \(^{(0)}\).

Exact Fourier Expansion

$$\begin{aligned} W((Y \wedge (Y \oplus a_1)) \oplus ((Y \oplus a_0) \wedge a_1))&= ? \\ W(Y \oplus a_0)&= Y a_0 \\ W(Y \oplus a_1)&= Y a_1 \\ W(Y \wedge (Y \oplus a_1))&= -0.5 \, Y^{2} a_{1} + 0.5 \, Y a_{1} + 0.5 \, Y + 0.5\\&= -0.5 \, a_{1} + 0.5 \, Y a_{1} + 0.5 \, Y + 0.5\\ W((Y \oplus a_0) \wedge a_1))&= -0.5 \, Y a_{0} a_{1} + 0.5 \, Y a_{0} + 0.5 \, a_{1} + 0.5 \\ W((Y \wedge (Y \oplus a_1)) \oplus ((Y \oplus a_0) \wedge a_1))&= -0.25 \, Y^{2} a_{0} a_{1}^{2} + 0.25 \, Y a_{0} a_{1}^{2} + 0.25 \, Y^{2} a_{0} - 0.5 \, Y a_{0} a_{1}\\&+ 0.25 \, Y a_{1}^{2} + 0.25 \, Y a_{0} + 0.50 \, Y a_{1} - 0.25 \, a_{1}^{2} + 0.25 \, Y\\&+ 0.25 \\&= -0.25 \, a_{0} + 0.25 \, Y a_{0} + 0.25 \, a_{0} - 0.5 \, Y a_{0} a_{1}\\&+ 0.25 \, Y + 0.25 \, Y a_{0} + 0.50 \, Y a_{1} - 0.25 + 0.25 \, Y + 0.25 \end{aligned}$$

Approximated Fourier Expansion

figure bf

Note: \(Y^2 = 1\) because in Fourier expression each element is either 1 (False) or −1 (True).

H Table Lookup on Gate-Level

Fig. 7.
figure 7

Example of table lookup including equality comparator on gate-level with 4-bit addresses and 8-bit data words. The address addr is compared to the constant address of the SRAM cell (\((0110)_b\)). If both values are equal, the resulting 1-bit signal eq is 1, and 0 otherwise. eq is further used to decide whether the respective data word should be read or not.

Rights and permissions

Reprints and permissions

Copyright information

© 2023 The Author(s), under exclusive license to Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Gigerl, B., Primas, R., Mangard, S. (2023). Formal Verification of Arithmetic Masking in Hardware and Software. In: Tibouchi, M., Wang, X. (eds) Applied Cryptography and Network Security. ACNS 2023. Lecture Notes in Computer Science, vol 13905. Springer, Cham. https://doi.org/10.1007/978-3-031-33488-7_1

Download citation

  • DOI: https://doi.org/10.1007/978-3-031-33488-7_1

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-031-33487-0

  • Online ISBN: 978-3-031-33488-7

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics