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

Subversion Repositories apbtoaes128

[/] [apbtoaes128/] [trunk/] [rtl/] [mix_columns.v] - Diff between revs 7 and 14

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

Rev 7 Rev 14
Line 114... Line 114...
// Word to Byte transformation
// Word to Byte transformation
//=====================================================================================
//=====================================================================================
generate
generate
        genvar i;
        genvar i;
        for(i = 0 ; i < NUM_WORDS; i = i + 1)
        for(i = 0 ; i < NUM_WORDS; i = i + 1)
 
        begin:WBT
                assign col[i] = mix_in[WORD_SIZE*(i + 1) - 1: WORD_SIZE*i];
                assign col[i] = mix_in[WORD_SIZE*(i + 1) - 1: WORD_SIZE*i];
 
        end
endgenerate
endgenerate
 
 
//=====================================================================================
//=====================================================================================
// Direct Mix Column Operation
// Direct Mix Column Operation
//=====================================================================================
//=====================================================================================
generate
generate
        genvar j;
        genvar j;
        for(j = 0; j < NUM_WORDS; j = j + 1)
        for(j = 0; j < NUM_WORDS; j = j + 1)
                begin
                begin:DMCO
                        assign sum_p[j] = col[(j + 1)%NUM_WORDS] ^ col[(j + 2)%NUM_WORDS] ^ col[(j + 3)%NUM_WORDS];
                        assign sum_p[j] = col[(j + 1)%NUM_WORDS] ^ col[(j + 2)%NUM_WORDS] ^ col[(j + 3)%NUM_WORDS];
                        assign mix_out_enc[ WORD_SIZE*(j + 1) - 1 : WORD_SIZE*j] = aes_mult_02(col[j] ^ col[(j + NUM_WORDS - 1)%NUM_WORDS]) ^ sum_p[j];
                        assign mix_out_enc[ WORD_SIZE*(j + 1) - 1 : WORD_SIZE*j] = aes_mult_02(col[j] ^ col[(j + NUM_WORDS - 1)%NUM_WORDS]) ^ sum_p[j];
                end
                end
endgenerate
endgenerate
 
 

powered by: WebSVN 2.1.0

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