OpenCores
URL https://opencores.org/ocsvn/gost28147-89/gost28147-89/trunk

Subversion Repositories gost28147-89

[/] [gost28147-89/] [trunk/] [rtl/] [gost89_round.v] - Blame information for rev 5

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 5 fanatid
module gost89_round(
2
  input          clk,
3
  input  [511:0] sbox,
4
  input  [31:0]  key,
5
  input  [31:0]  n1,
6
  input  [31:0]  n2,
7
  output [31:0]  out1,
8
  output [31:0]  out2
9
);
10
  wire [31:0] tmp1, tmp2;
11
 
12
  assign tmp1 = n1 + key;
13
 
14
  gost89_sbox
15
    sbox1(sbox[511:448], tmp1[3:0],   tmp2[3:0]),
16
    sbox2(sbox[447:384], tmp1[7:4],   tmp2[7:4]),
17
    sbox3(sbox[383:320], tmp1[11:8],  tmp2[11:8]),
18
    sbox4(sbox[319:256], tmp1[15:12], tmp2[15:12]),
19
    sbox5(sbox[255:192], tmp1[19:16], tmp2[19:16]),
20
    sbox6(sbox[191:128], tmp1[23:20], tmp2[23:20]),
21
    sbox7(sbox[127:64],  tmp1[27:24], tmp2[27:24]),
22
    sbox8(sbox[63 :0],   tmp1[31:28], tmp2[31:28]);
23
 
24
  assign out1[10:0]  = tmp2[31:21] ^ n2[10:0];
25
  assign out1[31:11] = tmp2[20:0]  ^ n2[31:11];
26
 
27
  assign out2 = n1;
28
endmodule

powered by: WebSVN 2.1.0

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