BLAKE2 by christian-krieg
BLAKE2 VHDL IP Core
This package provides a VHDL implementation of the BLAKE2 Cryptographic Hash and Message Authentication Code as specified in
Markku-Juhani O. Saarinen and Jean-Philippe Aumasson: The BLAKE2 Cryptographic Hash and Message Authentication Code (MAC). RFC 7693, Internet Engineering Task Force, November 2015. DOI: https://doi.org/10.17487/RFC7693
This intellectual property (IP) core was developed in the course "Digital Integrated Circuits Design" at the Institute of Computer Technology, Vienna University of Technology (TU Wien). Vienna, April 2018.
This package is licensed under the 3-clause BSD license: https://opensource.org/licenses/BSD-3-Clause
The documentation is licensed under the CC BY 4.0 license: https://creativecommons.org/licenses/by/4.0/
Authors: Benedikt Tutzer Dinka Milovancev
Supervisors: Christian Krieg Martin Mosbeck Axel Jantsch
CONTENTS
-
The top entity is implemented in
blake2.vhd
. -
blake2b.vhd
andblake2s.vhd
contain wrappers for BLAKE2b and BLAKE2s and hide some generics of theblake2
entity by setting them to the appropriate values for the chosen algorithm.
This repo contains a testbench for each of the two algorithms. The testbenches compare the output of the corresponding entity to hashes generated by the reference implementation provided in RFC 7693.
To run the tests, execute runsim.sh
. The tests are performed using ghdl
, so
make sure that ghdl
is available on your system. It is possible to use
VHDL simulators other that ghdl
. In this case the simulation script needs
to be adapted to the simulator's command-line interface.
HOW TO USE
Split the message to be hashed into chunks of BLOCK_SIZE
bytes. Send them to
the entity sequentially by setting the message port and raising valid_in
for
one clock cycle.
message_len
needs to be set to the number of bytes that are to be hashed in
total. This includes the additional chunk containing the key, so when a key is
used, the size of one complete chunk needs to be added to message_len
(128 bytes for BLAKE2b, or 64 bytes for BLAKE2s, respectively).
The length of the hash can be chosen by setting hash_len
.
After sending one chunk, wait for compress_ready
to be HIGH
before sending
the next chunk. When the last chunk is sent, the input last_chunk
needs to be
set to HIGH
. After the last chunk is encoded, the output valid_out
is
raised and the hash is available at the hash
output port.
TODO
-
Design and implement an Advanced Extensible Interface (AXI) controller to include the core in a system-on-chip (SoC) design. Check out the following repository on github:
https://github.com/Architech-Silica/Designing-a-Custom-AXI-Slave-Peripheral
-
Implement the core on as many different platforms as possible and report area, timing, power consumption, utilized resources
Copyright (c) 2018 Dinka Milovancev and Benedikt Tutzer The reference implementation in the `testgen' directory is Copyright (c) 2018 IETF Trust and M-J. Saarinen Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1) Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2) Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3) Neither the name of Internet Society, IETF or IETF Trust, nor the names of specific contributors, may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
https://github.com/christian-krieg/blake2.git
Issue Tracker
Last activity 2 years ago
Primary language: VHDL
4 watchers
3 stars
67 commits by 4 contributors
activity over the last year
LibreCores data updated 5 months ago