360 research outputs found
An embedded language framework for hardware compilation
Various languages have been proposed to describe synchronous hardware at an abstract, yet synthesisable level. We propose a uniform framework within which such languages can be developed, and combined together for simulation, synthesis, and verification. We do this by embedding the languages in Lava — a hardware description language (HDL), itself embedded in the functional programming language Haskell. The approach allows us to easily experiment with new formal languages and language features, and also provides easy access to formal verification tools aiding program verification.peer-reviewe
CryptOpt: Verified Compilation with Random Program Search for Cryptographic Primitives
Most software domains rely on compilers to translate high-level code to
multiple different machine languages, with performance not too much worse than
what developers would have the patience to write directly in assembly language.
However, cryptography has been an exception, where many performance-critical
routines have been written directly in assembly (sometimes through
metaprogramming layers). Some past work has shown how to do formal verification
of that assembly, and other work has shown how to generate C code automatically
along with formal proof, but with consequent performance penalties vs. the
best-known assembly. We present CryptOpt, the first compilation pipeline that
specializes high-level cryptographic functional programs into assembly code
significantly faster than what GCC or Clang produce, with mechanized proof (in
Coq) whose final theorem statement mentions little beyond the input functional
program and the operational semantics of x86-64 assembly. On the optimization
side, we apply randomized search through the space of assembly programs, with
repeated automatic benchmarking on target CPUs. On the formal-verification
side, we connect to the Fiat Cryptography framework (which translates
functional programs into C-like IR code) and extend it with a new formally
verified program-equivalence checker, incorporating a modest subset of known
features of SMT solvers and symbolic-execution engines. The overall prototype
is quite practical, e.g. producing new fastest-known implementations for the
relatively new Intel i9 12G, of finite-field arithmetic for both Curve25519
(part of the TLS standard) and the Bitcoin elliptic curve secp256k1
HyPLC: Hybrid Programmable Logic Controller Program Translation for Verification
Programmable Logic Controllers (PLCs) provide a prominent choice of
implementation platform for safety-critical industrial control systems. Formal
verification provides ways of establishing correctness guarantees, which can be
quite important for such safety-critical applications. But since PLC code does
not include an analytic model of the system plant, their verification is
limited to discrete properties. In this paper, we, thus, start the other way
around with hybrid programs that include continuous plant models in addition to
discrete control algorithms. Even deep correctness properties of hybrid
programs can be formally verified in the theorem prover KeYmaera X that
implements differential dynamic logic, dL, for hybrid programs. After verifying
the hybrid program, we now present an approach for translating hybrid programs
into PLC code. The new tool, HyPLC, implements this translation of discrete
control code of verified hybrid program models to PLC controller code and, vice
versa, the translation of existing PLC code into the discrete control actions
for a hybrid program given an additional input of the continuous dynamics of
the system to be verified. This approach allows for the generation of real
controller code while preserving, by compilation, the correctness of a valid
and verified hybrid program. PLCs are common cyber-physical interfaces for
safety-critical industrial control applications, and HyPLC serves as a
pragmatic tool for bridging formal verification of complex cyber-physical
systems at the algorithmic level of hybrid programs with the execution layer of
concrete PLC implementations.Comment: 13 pages, 9 figures. ICCPS 201
Formal Verification of a Constant-Time Preserving C Compiler
Timing side-channels are arguably one of the main sources of
vulnerabilities in cryptographic implementations. One effective
mitigation against timing side-channels is to write programs that do
not perform secret-dependent branches and memory accesses. This
mitigation, known as \u27\u27cryptographic constant-time\u27\u27, is
adopted by several popular cryptographic libraries.
This paper focuses on compilation of cryptographic constant-time
programs, and more specifically on the following question: is the
code generated by a realistic compiler for a constant-time source
program itself provably constant-time? Surprisingly, we answer the
question positively for a mildly modified version of the CompCert
compiler, a formally verified and moderately optimizing compiler for
C. Concretely, we modify the CompCert compiler to eliminate sources
of potential leakage. Then, we instrument the operational semantics
of CompCert intermediate languages so as to be able to capture
cryptographic constant-time. Finally, we prove that the modified
CompCert compiler preserves constant-time. Our mechanization
maximizes reuse of the CompCert correctness proof, through the use
of new proof techniques for proving preservation of constant-time.
These techniques achieve complementary trade-offs between generality
and tractability of proof effort, and are of independent interest
Towards An Automated Approach to Hardware/Software Decomposition
We propose in this paper an algebraic approach to hard-ware/software partitioning in Verilog Hardware Description Language (HDL). We explore a collection of algebraic laws for Verilog programs, from which we design a set of syntax-based algebraic rules to conduct hardware/software partitioning. The co-specification language and the target hardware and software description languages are specific subsets of Verilog. Through this, we confirm successful verification for the correctness of the partitioning process by an algebra of Verilog. Facilitated by Verilog’s rich features, we have also successfully studied hw/sw partitioning for environment-driven systems.Singapore-MIT Alliance (SMA
The Parma Polyhedra Library: Toward a Complete Set of Numerical Abstractions for the Analysis and Verification of Hardware and Software Systems
Since its inception as a student project in 2001, initially just for the
handling (as the name implies) of convex polyhedra, the Parma Polyhedra Library
has been continuously improved and extended by joining scrupulous research on
the theoretical foundations of (possibly non-convex) numerical abstractions to
a total adherence to the best available practices in software development. Even
though it is still not fully mature and functionally complete, the Parma
Polyhedra Library already offers a combination of functionality, reliability,
usability and performance that is not matched by similar, freely available
libraries. In this paper, we present the main features of the current version
of the library, emphasizing those that distinguish it from other similar
libraries and those that are important for applications in the field of
analysis and verification of hardware and software systems.Comment: 38 pages, 2 figures, 3 listings, 3 table
Terrier: an embedded operating system using advanced types for safety
Operating systems software is fundamental to modern computer
systems: all other applications are dependent upon the correct and
timely provision of basic system services. At the same time,
advances in programming languages and type theory have lead to the
creation of functional programming languages with type systems that
are designed to combine theorem proving with practical systems
programming. The Terrier operating system project focuses on
low-level systems programming in the context of a multi-core,
real-time, embedded system, while taking advantage of a dependently
typed programming language named ATS to improve
reliability. Terrier is a new point in the design space for an
operating system, one that leans heavily on an associated
programming language, ATS, to provide safety that has traditionally
been in the scope of hardware protection and kernel
privilege. Terrier tries to have far fewer abstractions between
program and hardware. The purpose of Terrier is to put programs as
much in contact with the real hardware, real memory, and real timing
constraints as possible, while still retaining the ability to
multiplex programs and provide for a reasonable level of safety
through static analysis
Lessons from Formally Verified Deployed Software Systems (Extended version)
The technology of formal software verification has made spectacular advances,
but how much does it actually benefit the development of practical software?
Considerable disagreement remains about the practicality of building systems
with mechanically-checked proofs of correctness. Is this prospect confined to a
few expensive, life-critical projects, or can the idea be applied to a wide
segment of the software industry?
To help answer this question, the present survey examines a range of
projects, in various application areas, that have produced formally verified
systems and deployed them for actual use. It considers the technologies used,
the form of verification applied, the results obtained, and the lessons that
can be drawn for the software industry at large and its ability to benefit from
formal verification techniques and tools.
Note: a short version of this paper is also available, covering in detail
only a subset of the considered systems. The present version is intended for
full reference.Comment: arXiv admin note: text overlap with arXiv:1211.6186 by other author
- …