GithubHelp home page GithubHelp logo

ascon / ascon-hardware Goto Github PK

View Code? Open in Web Editor NEW
21.0 8.0 4.0 8.55 MB

NIST LWC Hardware Reference Implementation of Ascon v1.2

Home Page: https://ascon.iaik.tugraz.at/

License: GNU General Public License v3.0

VHDL 37.73% Makefile 0.82% Python 56.53% Shell 0.05% C 4.87%
authenticated-encryption lightweight-cryptography symmetric-key-cryptography

ascon-hardware's Introduction

NIST LWC Hardware Reference Design of Ascon v1.2

  • Hardware Design Group: Institute of Applied Information Processing and Communications, Graz, Austria
  • Primary Hardware Designers:
  • LWC candidate: Ascon
  • LWC Hardware API version: 1.2.0

Ascon is a family of authenticated encryption and hashing algorithms designed to be lightweight and easy to implement, even with added countermeasures against side-channel attacks. Ascon has been selected as new standard for lightweight cryptography in the NIST Lightweight Cryptography competition (2019โ€“2023). Ascon has also been selected as the primary choice for lightweight authenticated encryption in the final portfolio of the CAESAR competition (2014-2019).

This code base contains a VHDL implementation of Ascon. I recently also published a Verilog implementation of Ascon that uses a similar but simpler crypto core interface and has a considerably reduced code size. Also, the Verilog implementation comes with a more permissive CC0 license. The Verilog implementation is available here.

Available Variants

  • v1 : ascon128v12 + asconhashv12, 32-bit interface, 1 permutation round per clock cycle
  • v1_8bit : ascon128v12 + asconhashv12, 8-bit interface, 1 permutation round per clock cycle
  • v1_16bit : ascon128v12 + asconhashv12, 16-bit interface, 1 permutation round per clock cycle
  • v2 : ascon128av12 + asconhashav12, 32-bit interface, 1 permutation round per clock cycle
  • v3 : ascon128v12 + asconhashv12, 32-bit interface, 2 permutation rounds per clock cycle
  • v4 : ascon128av12 + asconhashav12, 32-bit interface, 2 permutation rounds per clock cycle
  • v5 : ascon128v12 + asconhashv12, 32-bit interface, 3 permutation rounds per clock cycle
  • v6 : ascon128av12 + asconhashav12, 32-bit interface, 4 permutation rounds per clock cycle

Folders

  • hardware: HDL sources and testbench scripts.
  • software: Software reference implementation and Known-Answer-Test (KAT) generation scripts.

Quick Start

  • Install the GHDL open-source VHDL simulator (tested with version 0.37 and 1.0 and 2.0):
    • sudo apt install ghdl
  • Execute VHDL testbench for v1 (or other variants):
    • cd hardware/ascon_lwc
    • make v1

Generating new Testvectors from Software

  • Install testvector generation scripts:
    • pip install software/cryptotvgen
  • Compile Ascon software reference implementations:
    • cryptotvgen --prepare_libs --candidates_dir=software/ascon_ref
  • Locate testvector generation scripts:
    • cd software/cryptotvgen/examples
  • Run (and optionally modify) a testvector generation script:
    • python genkat_v1.py
  • Replace existing testvectors (KAT) of v1 with the newly generated ones:
    • mv testvectors/v1_32 testvectors/v1
    • rm -r ../../../hardware/ascon_lwc/KAT/v1
    • mv testvectors/v1 ../../../hardware/ascon_lwc/KAT
  • Execute VHDL testbench for v1:
    • cd ../../../hardware/ascon_lwc
    • make v1

Acknowledgements

This code base is based on version 1.2.0 of the LWC Hardware API Development Package that was mainly developed by the Cryptographic Engineering Research Group (CERG) at George Mason University (GMU).

Parts of the development package have been developed by the Department of Electrical and Computer Engineering (ECE) at Technical University of Munich (TUM).

The Ascon-specific modifications have been developed by the Institute of Applied Information Processing and Communications (IAIK) at Graz University of Technology (TUG).

ascon-hardware's People

Contributors

rprimas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ascon-hardware's Issues

make: *** [Makefile:167: src_rtl/v1/LWC_config_32.o] Error 127

I followed all the steps at make v1 i got this error:
(env) imran@Imran:/ascon-github/ascon-hardware/software/cryptotvgen/examples$ mv testvectors/v1_32 testvectors/v1
(env) imran@Imran:
/ascon-github/ascon-hardware/software/cryptotvgen/examples$ rm -r ../../../hardware/ascon_lwc/KAT/v1
(env) imran@Imran:/ascon-github/ascon-hardware/software/cryptotvgen/examples$ mv testvectors/v1 ../../../hardware/ascon_lwc/KAT
(env) imran@Imran:
/ascon-github/ascon-hardware/software/cryptotvgen/examples$ cd ../../../hardware/ascon_lwc
(env) imran@Imran:~/ascon-github/ascon-hardware/hardware/ascon_lwc$ make v1
ghdl -a --std=08 -frelaxed-rules --warn-no-vital-generic -frelaxed -O3 -Wbinding -Wreserved -Wlibrary -Wvital-generic -Wdelayed-checks -Wbody -Wspecs -Wunused --warn-no-runtime-error --mb-comments src_rtl/v1/LWC_config_32.vhd
make: ghdl: No such file or directory
make: *** [Makefile:167: src_rtl/v1/LWC_config_32.o] Error 127

Vivado synthesis failed for source RTL

Hello,
I am trying to compile the source RTL files in Vivado 2023.2, however, I have the following errors:
[Synth 8-36] 'lwc_config' is not declared
[/sources_1/new/NIST_LWAPI_pkg.vhd":60]
[Synth 8-439] module 'LWC' not found
[Common 17-69] Command failed: Vivado Synthesis failed

I have added all .vhd files in the ascon-hardware/hardware/src-rtl (FIFO.vhd, LWC.vhd, etc.) into my project, but when I click run synthesis, I get the above mentioned errors. Is there something that I am missing?
This is the line that fails:
constant W : natural := LWC_config.W;

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.