From 3ea94c872afe6309c43ac7eccf877734c33f5421 Mon Sep 17 00:00:00 2001 From: "Pavel V. Shatov (Meister)" Date: Tue, 1 Oct 2019 15:11:04 +0300 Subject: Implemented the final stage of the Montgomery modular multiplication, i.e. addition of AB and M then reduction by right-shift. --- rtl/modexpng_parameters.vh | 6 +++--- rtl/modexpng_part_recombinator.v | 15 +++++++++++++++ 2 files changed, 18 insertions(+), 3 deletions(-) (limited to 'rtl') diff --git a/rtl/modexpng_parameters.vh b/rtl/modexpng_parameters.vh index 57eef35..77b57f3 100644 --- a/rtl/modexpng_parameters.vh +++ b/rtl/modexpng_parameters.vh @@ -7,10 +7,10 @@ localparam [2:0] BANK_FAT_T1T2 = 3'd0; localparam [2:0] BANK_FAT_ABL = 3'd1; localparam [2:0] BANK_FAT_ABH = 3'd2; localparam [2:0] BANK_FAT_N = 3'd3; -localparam [2:0] BANK_FAT_ML = 3'd4; -localparam [2:0] BANK_FAT_MH = 3'd5; +localparam [2:0] BANK_FAT_ML = 3'd4; // not needed +localparam [2:0] BANK_FAT_MH = 3'd5; // not needed localparam [2:0] BANK_FAT_EXT = 3'd6; // 0 -> MH' -localparam [2:0] BANK_FAT_UNUSED = 3'd7; +localparam [2:0] BANK_FAT_UNUSED = 3'd7; // not needed localparam [1:0] BANK_SLIM_T1T2 = 2'd0; localparam [1:0] BANK_SLIM_N_COEFF = 2'd1; diff --git a/rtl/modexpng_part_recombinator.v b/rtl/modexpng_part_recombinator.v index 567ecd5..957ba8e 100644 --- a/rtl/modexpng_part_recombinator.v +++ b/rtl/modexpng_part_recombinator.v @@ -1095,6 +1095,7 @@ module modexpng_part_recombinator end // end + // endcase // 2'd2: case (rcmb_xy_dout_valid) @@ -1103,6 +1104,20 @@ module modexpng_part_recombinator // endcase // + 2'd3: case (rcmb_xy_dout_valid) + // + 2'b00: begin + // + if (recomb_msb_flag_delay_2) begin + // + rdy_adv <= ~recomb_msb_flag_delay_1; + // + end + // + end + // + endcase + // endcase // end -- cgit v1.2.3