HACL* in Mozilla Firefox
Formal methods and high assurance applications for the web
Real World Crypto 2018
- B. Beurdouche
- K. Bhargavan
- J. Protzenko
J-K. Zinzindohoué (Project Everest)
- F. Kiefer
- E. Rescorla
- T. Taubert
- M. Thomson
(Mozilla)
HACL* in Mozilla Firefox Formal methods and high assurance - - PowerPoint PPT Presentation
HACL* in Mozilla Firefox Formal methods and high assurance applications for the web B. Beurdouche F. Kiefer K. Bhargavan E. Rescorla J. Protzenko T. Taubert J-K. Zinzindohou M. Thomson (Project Everest) (Mozilla) Real World Crypto 2018
Real World Crypto 2018
J-K. Zinzindohoué (Project Everest)
(Mozilla)
(think Heartbleed)
(think Lucky 13)
[2016] Integer overflow in OpenSSL’s Poly1305
[2014] TweetNaCl [2014] Curve25519-Donna
Even for very skilled programmers or cryptographers !
6
Multi product security library
Large number of primitives
interoperability Higher level components
7
There was no clear way on how to get there...
Decision
correctness using formal verification “NSS is old, there is a lot of legacy code” “How can we make NSS more modern and get higher confidence in its correctness ?”
Emilia Kasper, Real World Crypto (2015)
Recent academic developments for Cryptography
10
CCS 2017 -https://eprint.iacr.org/2017/536
Code
(F*)
Spec
(F*)
Trusted Library
(F*)
Memory safety Functional correctness Secret independence
Verify
(F*)
failure Potential bug success
Verified Code
(C)
Compile
(KreMLin)
Cannot be compiled to C
Cr Crypto
(RFC, NIST…)
State-of-the-art code
(C)
failure success
Correctness theorem [ICFP2017]
13
Low*
CCS 2017 -https://eprint.iacr.org/2017/536 Functionalities
Formal verification can scale up !
15
19
20
CPU c CPU cycles/byte
Lower is better Encrypt, Hash,
1 Diffie-Hellman Sign, verify 16KB
+20 % faster than previous NSS code
22
23
contributors
Write F* spec & code Verified Code
(C)
Extract to C and Test
success success failure
Format and Audit
success failure
CI Verification and Tests
success failure
Production Prove Low* code
success failure
27
The future of NSS
The future of HACL*
28
(NSS crypto is eligible to Mozilla’s bug bounty program)
Project Everest