Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up unused code in w1_encode #31

Merged
merged 2 commits into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflow_metadata/pr_hash
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0498b952cc0e6254259daf7a40977490ef109005599f452d7c850f0399d1d571c41792c8008c4147c6cbbe088b49c43c
8228e7ec4ec4d34b04381d60d78531d4272ad45a40e512452b4bba66638e4ed80982600151ac84f9ba2a11d22d72ff03
2 changes: 1 addition & 1 deletion .github/workflow_metadata/pr_timestamp
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1730913274
1731347747
6 changes: 2 additions & 4 deletions src/decompose/rtl/decompose.sv
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@ module decompose
output logic [63:0] w1_o,
output logic buffer_en,

output logic decompose_done,
output logic w1_encode_done
output logic decompose_done


);
Expand Down Expand Up @@ -263,8 +262,7 @@ module decompose
.w1_encode_enable(verify ? &usehint_ready : &mod_ready),
.r1_i(r1_mux),
.w1_o(w1_o),
.buffer_en(buffer_en),
.w1_encode_done(w1_encode_done)
.buffer_en(buffer_en)
);


Expand Down
18 changes: 1 addition & 17 deletions src/decompose/rtl/decompose_w1_encode.sv
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,13 @@ module decompose_w1_encode
input wire [3:0][3:0] r1_i,

output logic [63:0] w1_o,
output logic buffer_en,

output logic w1_encode_done
output logic buffer_en
);

localparam BUFFER_CYC = 4;

//Enable counter
logic [1:0] buffer_count;
logic [2:0] rounds_count;

//Flags
logic w1_en_reg;
Expand Down Expand Up @@ -81,20 +78,7 @@ module decompose_w1_encode
buffer_count <= buffer_count - 'h1;
end

//Rounds counter
always_ff @(posedge clk or negedge reset_n) begin
if (!reset_n)
rounds_count <= 'h0;
else if (zeroize)
rounds_count <= 'h0;
else if (init_count_first)
rounds_count <= MLDSA_K-1;
else if ((rounds_count > 0))
rounds_count <= rounds_count - 'h1;
end

assign buffer_en = w1_en_reg && (buffer_count == 'h0);
assign w1_encode_done = (rounds_count == 'h0);

//r1 shift reg
always_ff @(posedge clk or negedge reset_n) begin
Expand Down
3 changes: 1 addition & 2 deletions src/mldsa_top/rtl/mldsa_top.sv
Original file line number Diff line number Diff line change
Expand Up @@ -588,8 +588,7 @@ decompose_inst (
.buffer_en(decomp_msg_valid),

//TODO: check what high level controller requirement is
.decompose_done(decompose_done),
.w1_encode_done()
.decompose_done(decompose_done)
);

skencode
Expand Down