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

Subversion Repositories apbtoaes128

[/] [apbtoaes128/] [trunk/] [pli/] [bfm_ctr/] [aes_bfm_decryption_dma_ctr.h] - Diff between revs 9 and 12

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

Rev 9 Rev 12
Line 294... Line 294...
 
 
 
 
                                        if(counter_write == 9)
                                        if(counter_write == 9)
                                        {
                                        {
 
 
 
                                                if(DATATYPE == TYPE_00)// NO DINR DOUTR SWAP DATA
 
                                                {
                                                v_ecb.value.integer = ADDR_AES_CR;
                                                v_ecb.value.integer = ADDR_AES_CR;
                                                vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay);
                                                vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay);
 
 
                                                t_ecb.type = vpiScaledRealTime;
 
                                                t_ecb.real = 0;
 
                                                v_ecb.format=vpiIntVal;
 
                                                v_ecb.value.integer = 6225;
                                                v_ecb.value.integer = 6225;
                                                vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay);
                                                vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay);
 
 
 
                                                }else if(DATATYPE == TYPE_01)// 16 BIT DINR DOUTR SWAP DATA
 
                                                {
 
                                                        v_ecb.value.integer = ADDR_AES_CR;
 
                                                        vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay);
 
 
 
                                                        v_ecb.value.integer = 6227;
 
                                                        vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay);
 
 
 
                                                }else if(DATATYPE == TYPE_02)// 8 BIT DINR DOUTR SWAP DATA
 
                                                {
 
                                                        v_ecb.value.integer = ADDR_AES_CR;
 
                                                        vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay);
 
 
 
                                                        v_ecb.value.integer = 6229;
 
                                                        vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay);
 
 
 
                                                }else if(DATATYPE == TYPE_03)// BIT DINR DOUTR SWAP DATA
 
                                                {
 
                                                        v_ecb.value.integer = ADDR_AES_CR;
 
                                                        vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay);
 
 
 
                                                        v_ecb.value.integer = 6231;
 
                                                        vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay);
 
                                                }
 
 
                                        }
                                        }
 
 
 
 
                                        if(counter_write > 9  &&  counter_write < 14) //WRITE DINR
                                        if(counter_write > 9  &&  counter_write < 14) //WRITE DINR
                                        {
                                        {
Line 316... Line 340...
 
 
 
 
                                                if(FIPS_ENABLE == FIPS)
                                                if(FIPS_ENABLE == FIPS)
                                                {
                                                {
 
 
 
                                                        if(DATATYPE == TYPE_00)
 
                                                        {
 
 
                                                        if(counter_write == 10)
                                                        if(counter_write == 10)
                                                        {
                                                        {
                                                                a = a | TEXT_CTR_FIPS_DERIVATED[0];
                                                                a = a | TEXT_CTR_FIPS_DERIVATED[0];
                                                                a = a << 8;
                                                                a = a << 8;
                                                                a = a | TEXT_CTR_FIPS_DERIVATED[1];
                                                                a = a | TEXT_CTR_FIPS_DERIVATED[1];
Line 363... Line 390...
                                                                d = d | TEXT_CTR_FIPS_DERIVATED[15];
                                                                d = d | TEXT_CTR_FIPS_DERIVATED[15];
                                                                v_ecb.value.integer = d;
                                                                v_ecb.value.integer = d;
 
 
                                                        }
                                                        }
 
 
 
                                                        }else if(DATATYPE == TYPE_01)
 
                                                        {
 
 
 
 
 
                                                                if(counter_write == 10)
 
                                                                {
 
                                                                        a = a | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[0];
 
                                                                        a = a << 8;
 
                                                                        a = a | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[1];
 
                                                                        a = a << 8;
 
                                                                        a = a | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[2];
 
                                                                        a = a << 8;
 
                                                                        a = a | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[3];
 
                                                                        v_ecb.value.integer = a;
 
 
 
                                                                }else if(counter_write == 11)
 
                                                                {
 
                                                                        b = b | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[4];
 
                                                                        b = b << 8;
 
                                                                        b = b | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[5];
 
                                                                        b = b << 8;
 
                                                                        b = b | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[6];
 
                                                                        b = b << 8;
 
                                                                        b = b | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[7];
 
                                                                        v_ecb.value.integer = b;
 
 
 
                                                                }else if(counter_write == 12 )
 
                                                                {
 
 
 
                                                                        c = c | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[8];
 
                                                                        c = c << 8;
 
                                                                        c = c | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[9];
 
                                                                        c = c << 8;
 
                                                                        c = c | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[10];
 
                                                                        c = c << 8;
 
                                                                        c = c | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[11];
 
                                                                        v_ecb.value.integer = c;
 
 
 
                                                                }else if(counter_write == 13 )
 
                                                                {
 
                                                                        d = d | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[12];
 
                                                                        d = d << 8;
 
                                                                        d = d | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[13];
 
                                                                        d = d << 8;
 
                                                                        d = d | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[14];
 
                                                                        d = d << 8;
 
                                                                        d = d | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[15];
 
                                                                        v_ecb.value.integer = d;
 
 
 
                                                                }
 
 
 
                                                        }else if(DATATYPE == TYPE_02)
 
                                                        {
 
                                                                if(counter_write == 10)
 
                                                                {
 
                                                                        a = a | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[0];
 
                                                                        a = a << 8;
 
                                                                        a = a | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[1];
 
                                                                        a = a << 8;
 
                                                                        a = a | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[2];
 
                                                                        a = a << 8;
 
                                                                        a = a | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[3];
 
                                                                        v_ecb.value.integer = a;
 
 
 
                                                                }else if(counter_write == 11)
 
                                                                {
 
                                                                        b = b | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[4];
 
                                                                        b = b << 8;
 
                                                                        b = b | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[5];
 
                                                                        b = b << 8;
 
                                                                        b = b | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[6];
 
                                                                        b = b << 8;
 
                                                                        b = b | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[7];
 
                                                                        v_ecb.value.integer = b;
 
 
 
                                                                }else if(counter_write == 12 )
 
                                                                {
 
 
 
                                                                        c = c | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[8];
 
                                                                        c = c << 8;
 
                                                                        c = c | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[9];
 
                                                                        c = c << 8;
 
                                                                        c = c | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[10];
 
                                                                        c = c << 8;
 
                                                                        c = c | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[11];
 
                                                                        v_ecb.value.integer = c;
 
 
 
                                                                }else if(counter_write == 13 )
 
                                                                {
 
                                                                        d = d | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[12];
 
                                                                        d = d << 8;
 
                                                                        d = d | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[13];
 
                                                                        d = d << 8;
 
                                                                        d = d | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[14];
 
                                                                        d = d << 8;
 
                                                                        d = d | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[15];
 
                                                                        v_ecb.value.integer = d;
 
 
 
                                                                }
 
 
 
 
 
 
 
                                                        }else if(DATATYPE == TYPE_03)
 
                                                        {
 
                                                                if(counter_write == 10)
 
                                                                {
 
                                                                        a = a | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[0];
 
                                                                        a = a << 8;
 
                                                                        a = a | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[1];
 
                                                                        a = a << 8;
 
                                                                        a = a | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[2];
 
                                                                        a = a << 8;
 
                                                                        a = a | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[3];
 
                                                                        v_ecb.value.integer = a;
 
 
 
                                                                }else if(counter_write == 11)
 
                                                                {
 
                                                                        b = b | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[4];
 
                                                                        b = b << 8;
 
                                                                        b = b | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[5];
 
                                                                        b = b << 8;
 
                                                                        b = b | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[6];
 
                                                                        b = b << 8;
 
                                                                        b = b | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[7];
 
                                                                        v_ecb.value.integer = b;
 
 
 
                                                                }else if(counter_write == 12 )
 
                                                                {
 
 
 
                                                                        c = c | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[8];
 
                                                                        c = c << 8;
 
                                                                        c = c | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[9];
 
                                                                        c = c << 8;
 
                                                                        c = c | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[10];
 
                                                                        c = c << 8;
 
                                                                        c = c | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[11];
 
                                                                        v_ecb.value.integer = c;
 
 
 
                                                                }else if(counter_write == 13 )
 
                                                                {
 
                                                                        d = d | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[12];
 
                                                                        d = d << 8;
 
                                                                        d = d | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[13];
 
                                                                        d = d << 8;
 
                                                                        d = d | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[14];
 
                                                                        d = d << 8;
 
                                                                        d = d | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[15];
 
                                                                        v_ecb.value.integer = d;
 
 
 
                                                                }
 
 
 
 
 
 
 
                                                        }
 
 
 
 
                                                }else if(FIPS_ENABLE == RANDOM_DATA)
                                                }else if(FIPS_ENABLE == RANDOM_DATA)
                                                {
                                                {
                                                        v_ecb.value.integer = data_in(rd);
                                                        v_ecb.value.integer = data_in(rd);
                                                }
                                                }

powered by: WebSVN 2.1.0

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