Verifying and Synthesizing Constant-Resource Implementations with Types

01/05/2018
by   Van Chan Ngo, et al.
0

We propose a novel type system for verifying that programs correctly implement constant-resource behavior. Our type system extends recent work on automatic amortized resource analysis (AARA), a set of techniques that automatically derive provable upper bounds on the resource consumption of programs. We devise new techniques that build on the potential method to achieve compositionality, precision, and automation. A strict global requirement that a program always maintains constant resource usage is too restrictive for most practical applications. It is sufficient to require that the program's resource behavior remain constant with respect to an attacker who is only allowed to observe part of the program's state and behavior. To account for this, our type system incorporates information flow tracking into its resource analysis. This allows our system to certify programs that need to violate the constant-time requirement in certain cases, as long as doing so does not leak confidential information to attackers. We formalize this guarantee by defining a new notion of resource-aware noninterference, and prove that our system enforces it. Finally, we show how our type inference algorithm can be used to synthesize a constant-time implementation from one that cannot be verified as secure, effectively repairing insecure programs automatically. We also show how a second novel AARA system that computes lower bounds on resource usage can be used to derive quantitative bounds on the amount of information that a program leaks through its resource use. We implemented each of these systems in Resource Aware ML, and show that it can be applied to verify constant-time behavior in a number of applications including encryption and decryption routines, database queries, and other resource-aware functionality.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
06/29/2020

Liquid Resource Types

This article presents liquid resource types, a technique for automatical...
research
11/24/2017

Bounded Expectations: Resource Analysis for Probabilistic Programs

This paper presents a new static analysis for deriving upper bounds on t...
research
04/16/2019

Resource-Guided Program Synthesis

This article presents resource-guided synthesis, a technique for synthes...
research
02/15/2023

Multi-graded Featherweight Java

Resource-aware type systems statically approximate not only the expected...
research
03/06/2021

Synthesis with Asymptotic Resource Bounds

We present a method for synthesizing recursive functions that satisfy bo...
research
08/14/2019

Type-Based Resource Analysis on Haskell

We propose an amortized analysis that approximates the resource usage of...
research
08/18/2021

Selectively-Amortized Resource Bounding (Extended Version)

We consider the problem of automatically proving resource bounds. That i...

Please sign up or login with your details

Forgot password? Click here to reset