data encryption standard

Nov 23, 2005 3 Replies

hi,



I am implementing data encryption standard using verilog. can anyone suggest efficient algorith to implemnt data encryption standard ( especially S-box).



The S-Boxes are the easy part. They are just LUTs.

I am implemnting S-box by using case statement.

6'b000000: SB[1]=4'd14; 6'b000010: SB[1]=4'd4; 6'b000100: SB[1]=4'd13; 6'b000110: SB[1]=4'd1; 6'b001000: SB[1]=4'd2; 6'b001010: SB[1]=4'd15; 6'b001100: SB[1]=4'd11; 6'b001110: SB[1]=4'd8; 6'b010000: SB[1]=4'd3; 6'b010010: SB[1]=4'd10; 6'b010100: SB[1]=4'd6; 6'b010110: SB[1]=4'd12; 6'b011000: SB[1]=4'd5; 6'b011010: SB[1]=4'd9; 6'b011100: SB[1]=4'd0; 6'b011110: SB[1]=4'd7; 6'b000001: SB[1]=4'd0; 6'b000011: SB[1]=4'd15; 6'b000101: SB[1]=4'd7; 6'b000111: SB[1]=4'd4; 6'b001001: SB[1]=4'd14; 6'b001011: SB[1]=4'd2; 6'b001101: SB[1]=4'd13; 6'b001111: SB[1]=4'd1; 6'b010001: SB[1]=4'd10; 6'b010011: SB[1]=4'd6; 6'b010101: SB[1]=4'd12; 6'b010111: SB[1]=4'd11; 6'b011001: SB[1]=4'd9; 6'b011011: SB[1]=4'd5; 6'b011101: SB[1]=4'd3; 6'b011111: SB[1]=4'd8; 6'b100000: SB[1]=4'd4; 6'b100010: SB[1]=4'd1; 6'b100100: SB[1]=4'd14; 6'b100110: SB[1]=4'd8;

Is this efficient way?

Or is any other method t o implemnt LUT

Depends... Synplify will turn that into a ROM or LUTs depending on what it thinks is best...

Simon

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required