Update license

This commit is contained in:
bsdevlin 2019-02-15 01:58:34 -05:00
parent 66aad005df
commit ab3e37782e
7 changed files with 165 additions and 19 deletions

View File

@ -1,3 +1,23 @@
/*
The BLAKE2b g function.
Copyright (C) 2019 Benjamin Devlin and Zcash Foundation
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
module blake2b_g module blake2b_g
#( #(
parameter PIPELINES = 1 // Do we want to optionally add pipeline stages parameter PIPELINES = 1 // Do we want to optionally add pipeline stages

View File

@ -1,3 +1,22 @@
/*
The BLAKE2b package file.
Copyright (C) 2019 Benjamin Devlin and Zcash Foundation
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package blake2b_pkg; package blake2b_pkg;
// Initial values // Initial values

View File

@ -1,7 +1,24 @@
/* Implemented from RFC-7693, The BLAKE2b Cryptographic Hash and Message Authentication Code (MAC) /*
* Parameters are passed in as an input. Inputs and outputs are AXI stream and respect flow control. Implemented from RFC-7693, The BLAKE2b Cryptographic Hash and Message Authentication Code (MAC)
* Only only hash is computed at a time, and takes 26 clocks * number of 128 Byte message blocks. Parameters are passed in as an input. Inputs and outputs are AXI stream and respect flow control.
*/ Only only hash is computed at a time, and takes 26 clocks * number of 128 Byte message blocks.
Does not have functionalty to use a key.
Copyright (C) 2019 Benjamin Devlin and Zcash Foundation
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
module blake2b_top module blake2b_top
import blake2b_pkg::*; import blake2b_pkg::*;

View File

@ -1,3 +1,22 @@
/*
The BLAKE2b g function testbench.
Copyright (C) 2019 Benjamin Devlin and Zcash Foundation
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
module blake2b_g_tb(); module blake2b_g_tb();
logic clk; logic clk;

View File

@ -1,5 +1,26 @@
/*
The BLAKE2b testbench.
Copyright (C) 2019 Benjamin Devlin and Zcash Foundation
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
module blake2b_top_tb(); module blake2b_top_tb();
parameter USE_BLAKE2B_PIPE = 1; // This instantiates the pipelined version instead
import blake2b_pkg::*; import blake2b_pkg::*;
import common_pkg::*; import common_pkg::*;
@ -22,15 +43,30 @@ initial begin
forever #10ns clk = ~clk; forever #10ns clk = ~clk;
end end
generate if ( USE_BLAKE2B_PIPE == 0 ) begin: DUT_GEN
blake2b_top DUT ( blake2b_top DUT (
.i_clk ( clk ), .i_clk ( clk ),
.i_rst ( rst ), .i_rst ( rst ),
.i_parameters ( parameters ), .i_parameters ( parameters ),
.i_byte_len ( i_byte_len ), .i_byte_len ( i_byte_len ),
.i_block ( i_block ), .i_block ( i_block ),
.o_hash ( out_hash ) .o_hash ( out_hash )
); );
end else begin
blake2b_pipe_top #(
.ROUNDS ( 12 ),
.MSG_LEN ( 3 )
)
DUT (
.i_clk ( clk ),
.i_rst ( rst ),
.i_parameters ( parameters ),
.i_byte_len ( i_byte_len ),
.i_block ( i_block ),
.o_hash ( out_hash )
);
end
endgenerate
// This test runs the hash which is shown in the RFC, for "abc" // This test runs the hash which is shown in the RFC, for "abc"
task rfc_test(); task rfc_test();
@ -86,8 +122,8 @@ initial begin
#200ns; #200ns;
rfc_test(); rfc_test();
test_128_bytes(); // test_128_bytes();
test_140_bytes(); // test_140_bytes();
#10us $finish(); #10us $finish();

View File

@ -1,5 +1,22 @@
/*
Interface for a AXI stream
Copyright (C) 2019 Benjamin Devlin and Zcash Foundation
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
// Interface for a AXI stream
interface if_axi_stream # ( interface if_axi_stream # (
parameter DAT_BYTS = 8, parameter DAT_BYTS = 8,
parameter CTL_BYTS = 8 parameter CTL_BYTS = 8
@ -19,8 +36,8 @@ interface if_axi_stream # (
logic [DAT_BITS-1:0] dat; logic [DAT_BITS-1:0] dat;
logic [$clog2(DAT_BYTS)-1:0] mod; logic [$clog2(DAT_BYTS)-1:0] mod;
modport sink (input val, err, sop, eop, ctl, dat, output rdy); modport sink (input val, err, sop, eop, ctl, dat, mod, output rdy);
modport source (output val, err, sop, eop, ctl, dat, input rdy, import task reset_source()); modport source (output val, err, sop, eop, ctl, dat, mod, input rdy, import task reset_source());
// Task to reset a source interface signals to all 0 // Task to reset a source interface signals to all 0
task reset_source(); task reset_source();

View File

@ -1,4 +1,22 @@
// Common parameter values and tasks /*
Common parameter values and tasks
Copyright (C) 2019 Benjamin Devlin and Zcash Foundation
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package common_pkg; package common_pkg;
parameter MAX_SIM_BYTS = 1024; // In simulation tasks how big is the logic register for putting / getting data parameter MAX_SIM_BYTS = 1024; // In simulation tasks how big is the logic register for putting / getting data