Giter Site home page Giter Site logo

songfu1983 / lif Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lac-dcc/lif

0.0 0.0 0.0 16.23 MB

A tool to eliminate timing-based side channels

License: GNU General Public License v3.0

Haskell 3.77% CMake 0.22% Dockerfile 0.09% Shell 2.07% C 89.58% Python 0.86% C++ 3.39%

lif's Introduction

License: GPL v3

Low-level Isochronous Form

The goal of project Lif is the development of a technique that transforms a function into a version of it that is time and memory invariant. This property ensures that the set of instructions executed will always be the same regardless of the inputs. As a consequence, the execution time of said function will be constant. Such transformation method eliminates side-channels in implementations of cryptography.

This repository is split into two folders described above:

  • lang: A small and simple language implemented in Haskell. It exists primarily with the purpose of implementing a skeleton of the invariant transformation pass.
  • llvm: A LLVM implementation of the invariant pass.

Overview

Consider the following function, which takes two lists, A and B, and returns 1 if they are equal or 0 otherwise:

int comp(int *A, int *B) {
    for (int i = 0; i < N; i++)
            if (A[i] != B[i]) return 0;
    return 1;
}

Let A = [0, 0, 0, 0] and B = [0, 0, 0, 0]. In this case, the loop body will be executed N times. Now, let A' = [1, 0, 0, 0]. When calling comp with A' and B, since the first test A'[i] != B[i] already fails, the loop body will be executed only once and the function will then return. Hence, if N is large, the execution time of this function w.r.t the first input will take longer than the execution time for the second input. This difference can, for example, be used by an external observer to retrieve informations related to those inputs.

lif's People

Contributors

luigidcsoares avatar pronesto avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.