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

Subversion Repositories apbtoaes128

[/] [apbtoaes128/] [trunk/] [pli/] [bfm_ctr/] [aes_bfm_encryption_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 300... Line 300...
 
 
 
 
                                }else if(counter_write == 9)//ENABLE CR
                                }else if(counter_write == 9)//ENABLE CR
                                {
                                {
 
 
 
                                        if(DATATYPE == TYPE_00)// NO DINR DOUTR SWAP DATA
 
                                        {
 
                                                v_ecb.value.integer = ADDR_AES_CR;
 
                                                vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay);
 
 
 
                                                v_ecb.value.integer = 6209;
 
                                                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;
                                        v_ecb.value.integer = ADDR_AES_CR;
                                        vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay);
                                        vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay);
 
 
                                        //v_ecb.value.integer = 1;
                                                v_ecb.value.integer = 6211;
                                        //vpi_put_value(PWDATA, &v_ecb, NULL, vpiNoDelay);
                                                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 = 6213;
 
                                                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 = 6209;//data_in(rd);
                                                v_ecb.value.integer = 6215;
                                        vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay);
                                        vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay);
 
                                        }
 
 
                                }else if(counter_write > 9  &&  counter_write < 14) //WRITE DINR
                                }else if(counter_write > 9  &&  counter_write < 14) //WRITE DINR
                                {
                                {
 
 
                                        v_ecb.value.integer = ADDR_AES_DINR;
                                        v_ecb.value.integer = ADDR_AES_DINR;
Line 319... Line 343...
 
 
 
 
                                        if(FIPS_ENABLE == FIPS)
                                        if(FIPS_ENABLE == FIPS)
                                        {
                                        {
 
 
 
                                                if(DATATYPE == TYPE_00)
 
                                                {
 
 
                                                if(counter_write == 10)
                                                if(counter_write == 10)
                                                {
                                                {
                                                        a = a | TEXT_FIPS_CTR_NOT_DERIVATED[0];
                                                        a = a | TEXT_FIPS_CTR_NOT_DERIVATED[0];
                                                        a = a << 8;
                                                        a = a << 8;
                                                        a = a | TEXT_FIPS_CTR_NOT_DERIVATED[1];
                                                        a = a | TEXT_FIPS_CTR_NOT_DERIVATED[1];
Line 366... Line 393...
                                                        d = d | TEXT_FIPS_CTR_NOT_DERIVATED[15];
                                                        d = d | TEXT_FIPS_CTR_NOT_DERIVATED[15];
                                                        v_ecb.value.integer = d;
                                                        v_ecb.value.integer = d;
 
 
                                                }
                                                }
 
 
 
                                                }else if(DATATYPE > TYPE_00)
 
                                                {
 
 
 
 
 
                                                        if(counter_write == 10)
 
                                                        {
 
                                                                a = a | TEXT_FIPS_CTR_NOT_DATATYPE_DERIVATED[0];
 
                                                                a = a << 8;
 
                                                                a = a | TEXT_FIPS_CTR_NOT_DATATYPE_DERIVATED[1];
 
                                                                a = a << 8;
 
                                                                a = a | TEXT_FIPS_CTR_NOT_DATATYPE_DERIVATED[2];
 
                                                                a = a << 8;
 
                                                                a = a | TEXT_FIPS_CTR_NOT_DATATYPE_DERIVATED[3];
 
                                                                v_ecb.value.integer = a;
 
 
 
                                                        }else if(counter_write == 11)
 
                                                        {
 
                                                                b = b | TEXT_FIPS_CTR_NOT_DATATYPE_DERIVATED[4];
 
                                                                b = b << 8;
 
                                                                b = b | TEXT_FIPS_CTR_NOT_DATATYPE_DERIVATED[5];
 
                                                                b = b << 8;
 
                                                                b = b | TEXT_FIPS_CTR_NOT_DATATYPE_DERIVATED[6];
 
                                                                b = b << 8;
 
                                                                b = b | TEXT_FIPS_CTR_NOT_DATATYPE_DERIVATED[7];
 
                                                                v_ecb.value.integer = b;
 
 
 
                                                        }else if(counter_write == 12 )
 
                                                        {
 
 
 
                                                                c = c | TEXT_FIPS_CTR_NOT_DATATYPE_DERIVATED[8];
 
                                                                c = c << 8;
 
                                                                c = c | TEXT_FIPS_CTR_NOT_DATATYPE_DERIVATED[9];
 
                                                                c = c << 8;
 
                                                                c = c | TEXT_FIPS_CTR_NOT_DATATYPE_DERIVATED[10];
 
                                                                c = c << 8;
 
                                                                c = c | TEXT_FIPS_CTR_NOT_DATATYPE_DERIVATED[11];
 
                                                                v_ecb.value.integer = c;
 
 
 
                                                        }else if(counter_write == 13 )
 
                                                        {
 
                                                                d = d | TEXT_FIPS_CTR_NOT_DATATYPE_DERIVATED[12];
 
                                                                d = d << 8;
 
                                                                d = d | TEXT_FIPS_CTR_NOT_DATATYPE_DERIVATED[13];
 
                                                                d = d << 8;
 
                                                                d = d | TEXT_FIPS_CTR_NOT_DATATYPE_DERIVATED[14];
 
                                                                d = d << 8;
 
                                                                d = d | TEXT_FIPS_CTR_NOT_DATATYPE_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.