DPDK usage discussions
 help / color / mirror / Atom feed
* [dpdk-users] dpdk-users] [Snow 3g Hash API]
@ 2016-07-08 14:57 amartya.das
  2016-07-11 15:18 ` De Lara Guarch, Pablo
  0 siblings, 1 reply; 3+ messages in thread
From: amartya.das @ 2016-07-08 14:57 UTC (permalink / raw)
  To: users

Hi,

I am trying to integrate Snow3G API in our stack. I have made a below data dump to be used for unit test:

struct snow3g_hash_test_data snow3g_hash_test_case_2 = {
                .key = {
                                .data = {0xe4,0xa8,0x46,0x48,0x1e,0xbd,0x10,0x26,0x70,0xe2,0x3a,0xc0,0x32,0xfb,0xca,0xe0},
                                .len = 16
                },

                .aad = {
                                .data = {
                                                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                                                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
                                },
                                .len = 16
                },

                .plaintext = {
                                .data = {0x83, 0x32, 0x00, 0x10},
                                .len = 32
                },
                .validAuthLenInBits = {
                                .len = 32
                                },
                .validAuthOffsetLenInBits = {
                                .len = 128
                },
                .digest = {
                                .data = {0x38, 0xB5, 0x54, 0xC0 },
                                .len  = 4
                }
};


However, I want to test with count = 1024, dir = 01, fresh = 0 as per 3gpp test vector . In that case aad.data  value will be changed.

It will be a great help, if anybody could tell what will be add.data value for that and logic to put the data accordingly.

Thanks in advance.

BRs
Amartya


The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. www.wipro.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-users] dpdk-users] [Snow 3g Hash API]
  2016-07-08 14:57 [dpdk-users] dpdk-users] [Snow 3g Hash API] amartya.das
@ 2016-07-11 15:18 ` De Lara Guarch, Pablo
  2016-07-12  3:01   ` amartya.das
  0 siblings, 1 reply; 3+ messages in thread
From: De Lara Guarch, Pablo @ 2016-07-11 15:18 UTC (permalink / raw)
  To: amartya.das, users

Hi Amartya,

> -----Original Message-----
> From: users [mailto:users-bounces@dpdk.org] On Behalf Of
> amartya.das@wipro.com
> Sent: Friday, July 08, 2016 3:58 PM
> To: users@dpdk.org
> Subject: [dpdk-users] dpdk-users] [Snow 3g Hash API]
> 
> Hi,
> 
> I am trying to integrate Snow3G API in our stack. I have made a below data
> dump to be used for unit test:
> 
> struct snow3g_hash_test_data snow3g_hash_test_case_2 = {
>                 .key = {
>                                 .data =
> {0xe4,0xa8,0x46,0x48,0x1e,0xbd,0x10,0x26,0x70,0xe2,0x3a,0xc0,0x32,0xfb,0xc
> a,0xe0},
>                                 .len = 16
>                 },
> 
>                 .aad = {
>                                 .data = {
>                                                 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>                                                 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
>                                 },
>                                 .len = 16
>                 },
> 
>                 .plaintext = {
>                                 .data = {0x83, 0x32, 0x00, 0x10},
>                                 .len = 32
>                 },
>                 .validAuthLenInBits = {
>                                 .len = 32
>                                 },
>                 .validAuthOffsetLenInBits = {
>                                 .len = 128
>                 },
>                 .digest = {
>                                 .data = {0x38, 0xB5, 0x54, 0xC0 },
>                                 .len  = 4
>                 }
> };
> 
> 
> However, I want to test with count = 1024, dir = 01, fresh = 0 as per 3gpp test
> vector . In that case aad.data  value will be changed.
> 
> It will be a great help, if anybody could tell what will be add.data value for
> that and logic to put the data accordingly.

The AAD is the IV passed to the Snow3G f9 function. 
>From the 3GPP specifications, the IV is (from MSB to LSB):
IV_3 = COUNT[0-31]
IV_2 = FRESH[0-31]
IV_1 = DIRECTION[0] XOR COUNT[0] || COUNT[1-31]
IV_0 = FRESH[0-31]

So, in your case:
IV = 0x00000400,  0x00000000, 0x80000400, 0x00000000

Pablo
> 
> Thanks in advance.
> 
> BRs
> Amartya

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-users] dpdk-users] [Snow 3g Hash API]
  2016-07-11 15:18 ` De Lara Guarch, Pablo
@ 2016-07-12  3:01   ` amartya.das
  0 siblings, 0 replies; 3+ messages in thread
From: amartya.das @ 2016-07-12  3:01 UTC (permalink / raw)
  To: pablo.de.lara.guarch, users

Thanks. I saw the libsso code. As made the changes accordingly and its working now.

IV_0 = (count) (4 bytes)
IV_1 = (fresh) (4 bytes)
IV_2 = (count^(dir<<31)) (4 bytes)
IV_3  = (fresh^(dir<<15)) (4 bytes)

BRs
Amartya

-----Original Message-----
From: De Lara Guarch, Pablo [mailto:pablo.de.lara.guarch@intel.com]
Sent: Monday, July 11, 2016 8:49 PM
To: Amartya Kumar Das (MFG & Tech) <amartya.das@wipro.com>; users@dpdk.org
Subject: RE: dpdk-users] [Snow 3g Hash API]

** This mail has been sent from an external source **

Hi Amartya,

> -----Original Message-----
> From: users [mailto:users-bounces@dpdk.org] On Behalf Of
> amartya.das@wipro.com
> Sent: Friday, July 08, 2016 3:58 PM
> To: users@dpdk.org
> Subject: [dpdk-users] dpdk-users] [Snow 3g Hash API]
>
> Hi,
>
> I am trying to integrate Snow3G API in our stack. I have made a below
> data dump to be used for unit test:
>
> struct snow3g_hash_test_data snow3g_hash_test_case_2 = {
>                 .key = {
>                                 .data =
> {0xe4,0xa8,0x46,0x48,0x1e,0xbd,0x10,0x26,0x70,0xe2,0x3a,0xc0,0x32,0xfb
> ,0xc
> a,0xe0},
>                                 .len = 16
>                 },
>
>                 .aad = {
>                                 .data = {
>                                                 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>                                                 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
>                                 },
>                                 .len = 16
>                 },
>
>                 .plaintext = {
>                                 .data = {0x83, 0x32, 0x00, 0x10},
>                                 .len = 32
>                 },
>                 .validAuthLenInBits = {
>                                 .len = 32
>                                 },
>                 .validAuthOffsetLenInBits = {
>                                 .len = 128
>                 },
>                 .digest = {
>                                 .data = {0x38, 0xB5, 0x54, 0xC0 },
>                                 .len  = 4
>                 }
> };
>
>
> However, I want to test with count = 1024, dir = 01, fresh = 0 as per
> 3gpp test vector . In that case aad.data  value will be changed.
>
> It will be a great help, if anybody could tell what will be add.data
> value for that and logic to put the data accordingly.

The AAD is the IV passed to the Snow3G f9 function.
>From the 3GPP specifications, the IV is (from MSB to LSB):
IV_3 = COUNT[0-31]
IV_2 = FRESH[0-31]
IV_1 = DIRECTION[0] XOR COUNT[0] || COUNT[1-31]
IV_0 = FRESH[0-31]

So, in your case:
IV = 0x00000400,  0x00000000, 0x80000400, 0x00000000

Pablo
>
> Thanks in advance.
>
> BRs
> Amartya

The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. www.wipro.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-07-12  3:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-08 14:57 [dpdk-users] dpdk-users] [Snow 3g Hash API] amartya.das
2016-07-11 15:18 ` De Lara Guarch, Pablo
2016-07-12  3:01   ` amartya.das

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).