OpenCores
URL https://opencores.org/ocsvn/pairing/pairing/trunk

Subversion Repositories pairing

[/] [pairing/] [trunk/] [rtl/] [tate_pairing.v] - Diff between revs 11 and 12

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 11 Rev 12
Line 85... Line 85...
        else if (change) f3m_reset <= 1;
        else if (change) f3m_reset <= 1;
        else f3m_reset <= 0;
        else f3m_reset <= 0;
endmodule
endmodule
 
 
// do Tate pairing, hahahaha
// do Tate pairing, hahahaha
module tate_pairing(clk, reset, x1, y1, x2, y2, done, sel, out);
module tate_pairing(clk, reset, x1, y1, x2, y2, done, out);
    input clk, reset;
    input clk, reset;
    input [`WIDTH:0] x1, y1, x2, y2;
    input [`WIDTH:0] x1, y1, x2, y2;
    input [7:0] sel;
 
    output reg done;
    output reg done;
    output reg [149:0] out;
    output reg [`W6:0] out;
 
 
    reg delay1, rst1;
    reg delay1, rst1;
    wire done1, rst2;
    wire done1, rst2;
    wire [`W6:0] out1, out2;
    wire [`W6:0] out1, out2;
    wire [149:0] tmp;
 
    reg [`W6:0] o;
 
    reg [2:0] K;
    reg [2:0] K;
 
 
    assign tmp = o[`W6:1050];
 
 
 
    duursma_lee_algo
    duursma_lee_algo
        ins1 (clk, rst1, x1, y1, x2, y2, done1, out1);
        ins1 (clk, rst1, x1, y1, x2, y2, done1, out1);
    second_part
    second_part
        ins2 (clk, rst2, out1, out2, done2);
        ins2 (clk, rst2, out1, out2, done2);
    func6
    func6
Line 125... Line 120...
        else if ((K[2]&rst2)|(K[1]&done2)|K[0])
        else if ((K[2]&rst2)|(K[1]&done2)|K[0])
            K <= K >> 1;
            K <= K >> 1;
 
 
    always @ (posedge clk)
    always @ (posedge clk)
        if (reset) done <= 0;
        if (reset) done <= 0;
        else if (K[0]) begin done <= 1; o <= out2; end
        else if (K[0]) begin done <= 1; out <= out2; end
 
 
    always @ (o, sel, tmp)
 
        out = (sel[0] ? o[150-1:0] : 0) |
 
              (sel[1] ? o[300-1:150] : 0) |
 
              (sel[2] ? o[450-1:300] : 0) |
 
              (sel[3] ? o[600-1:450] : 0) |
 
              (sel[4] ? o[750-1:600] : 0) |
 
              (sel[5] ? o[900-1:750] : 0) |
 
              (sel[6] ? o[1050-1:900] : 0) |
 
              (sel[7] ? tmp : 0) ;
 
 
 
endmodule
endmodule
 
 
 No newline at end of file
 No newline at end of file
 
 
 No newline at end of file
 No newline at end of file

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.