[v4] cunit : add tests for crypto APIs

Message ID 1415888076-32356-1-git-send-email-alexandru.badicioiu@linaro.org
State New
Headers show

Commit Message

Alexandru Badicioiu Nov. 13, 2014, 2:14 p.m.
From: Alexandru Badicioiu <alexandru.badicioiu@linaro.org>

This patch adds a suite for sync and async inplace mode of crypto APIs.
Correctness of crypto operation output is verified with known test
vectors. Various options and functionalities like use session IV
or operation IV for ciphering are exercised for both modes.
For async mode there are options to use input packet buffer or a
separate buffer as the completion event and to set and retrieve the
context associated with an operation from the completion event.

Signed-off-by: Alexandru Badicioiu <alexandru.badicioiu@linaro.org>
---
 configure.ac                                  |    1 +
 test/cunit/Makefile.am                        |    2 +
 test/cunit/crypto/Makefile.am                 |   14 +
 test/cunit/crypto/odp_crypto_test.c           |  100 +++++++
 test/cunit/crypto/odp_crypto_test_async_inp.c |  371 +++++++++++++++++++++++++
 test/cunit/crypto/odp_crypto_test_async_inp.h |   17 ++
 test/cunit/crypto/odp_crypto_test_sync_inp.c  |  260 +++++++++++++++++
 test/cunit/crypto/odp_crypto_test_sync_inp.h  |   17 ++
 test/cunit/crypto/test_vectors.h              |   94 +++++++
 9 files changed, 876 insertions(+), 0 deletions(-)
 create mode 100644 test/cunit/crypto/Makefile.am
 create mode 100644 test/cunit/crypto/odp_crypto_test.c
 create mode 100644 test/cunit/crypto/odp_crypto_test_async_inp.c
 create mode 100644 test/cunit/crypto/odp_crypto_test_async_inp.h
 create mode 100644 test/cunit/crypto/odp_crypto_test_sync_inp.c
 create mode 100644 test/cunit/crypto/odp_crypto_test_sync_inp.h
 create mode 100644 test/cunit/crypto/test_vectors.h

Comments

Anders Roxell Nov. 14, 2014, 8:23 a.m. | #1
On 2014-11-13 16:14, alexandru.badicioiu@linaro.org wrote:
> From: Alexandru Badicioiu <alexandru.badicioiu@linaro.org>
> 
> This patch adds a suite for sync and async inplace mode of crypto APIs.
> Correctness of crypto operation output is verified with known test
> vectors. Various options and functionalities like use session IV
> or operation IV for ciphering are exercised for both modes.
> For async mode there are options to use input packet buffer or a
> separate buffer as the completion event and to set and retrieve the
> context associated with an operation from the completion event.
> 
> Signed-off-by: Alexandru Badicioiu <alexandru.badicioiu@linaro.org>

I haven't had time to look into this patch will send feedback later
today.

one thing is it doesn't build:

Making all in crypto
make[3]: Entering directory '/home/anders/src/check-odp/odp/test/cunit/crypto'
  CC       odp_crypto-odp_crypto_test_async_inp.o
odp_crypto_test_async_inp.c:364:2: error: initialization discards ‘const’ qualifier from pointer target type [-Werror]
  {ASYNC_INP_ENC_ALG_3DES_CBC, test_async_enc_alg_3des_cbc },
  ^
odp_crypto_test_async_inp.c:365:2: error: initialization discards ‘const’ qualifier from pointer target type [-Werror]
  {ASYNC_INP_DEC_ALG_3DES_CBC, test_async_dec_alg_3des_cbc },
  ^
odp_crypto_test_async_inp.c:366:2: error: initialization discards ‘const’ qualifier from pointer target type [-Werror]
  {ASYNC_INP_ENC_ALG_3DES_CBC_OVR_IV, test_async_enc_alg_3des_cbc_ovr_iv },
  ^
odp_crypto_test_async_inp.c:367:2: error: initialization discards ‘const’ qualifier from pointer target type [-Werror]
  {ASYNC_INP_DEC_ALG_3DES_CBC_OVR_IV, test_async_dec_alg_3des_cbc_ovr_iv },
  ^
odp_crypto_test_async_inp.c:368:2: error: initialization discards ‘const’ qualifier from pointer target type [-Werror]
  {ASYNC_INP_ALG_HMAC_MD5, test_async_alg_hmac_md5 },
  ^
odp_crypto_test_async_inp.c:369:2: error: initialization discards ‘const’ qualifier from pointer target type [-Werror]
  {ASYNC_INP_ENC_ALG_3DES_CBC_COMPL_NEW, test_async_enc_alg_3des_cbc_compl_new },
  ^
cc1: all warnings being treated as errors
Makefile:456: recipe for target 'odp_crypto-odp_crypto_test_async_inp.o' failed
make[3]: *** [odp_crypto-odp_crypto_test_async_inp.o] Error 1
make[3]: Leaving directory '/home/anders/src/check-odp/odp/test/cunit/crypto'
Makefile:732: recipe for target 'all-recursive' failed
make[2]: *** [all-recursive] Error 1
Makefile:369: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
Makefile:454: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1
Making check in crypto

Check patch compliains on this:
WARNING: braces {} are not necessary for any arm of this statement
#304: FILE: test/cunit/crypto/odp_crypto_test_async_inp.c:114:
+	if (compl_new == ODP_BUFFER_INVALID) {
[...]
+	} else {
[...]

WARNING: line over 80 characters
#556: FILE: test/cunit/crypto/odp_crypto_test_async_inp.c:366:
+	{ASYNC_INP_ENC_ALG_3DES_CBC_OVR_IV, test_async_enc_alg_3des_cbc_ovr_iv },

WARNING: line over 80 characters
#557: FILE: test/cunit/crypto/odp_crypto_test_async_inp.c:367:
+	{ASYNC_INP_DEC_ALG_3DES_CBC_OVR_IV, test_async_dec_alg_3des_cbc_ovr_iv },

WARNING: line over 80 characters
#559: FILE: test/cunit/crypto/odp_crypto_test_async_inp.c:369:
+	{ASYNC_INP_ENC_ALG_3DES_CBC_COMPL_NEW, test_async_enc_alg_3des_cbc_compl_new },


Cheers,
Anders
Alexandru Badicioiu Nov. 14, 2014, 9:49 a.m. | #2
Hi,
for build errors - which compiler/toolchain do you use? I did not modify in
any way compilation flags and I have no problem with building with a PPC
toolchain and also with the native gcc on my development machine? I use
CUnit-2.1-3.

WARNING: braces {} are not necessary for any arm of this statement
#304: FILE: test/cunit/crypto/odp_crypto_test_async_inp.c:114:
+       if (compl_new == ODP_BUFFER_INVALID) {
[...]
+       } else {
[...]
If we remove the braces the test will not compile, it seems the CUnit
macros are the problem.
I'll shorten the lines over 80 characters.

Alex


On 14 November 2014 10:23, Anders Roxell <anders.roxell@linaro.org> wrote:

> On 2014-11-13 16:14, alexandru.badicioiu@linaro.org wrote:
> > From: Alexandru Badicioiu <alexandru.badicioiu@linaro.org>
> >
> > This patch adds a suite for sync and async inplace mode of crypto APIs.
> > Correctness of crypto operation output is verified with known test
> > vectors. Various options and functionalities like use session IV
> > or operation IV for ciphering are exercised for both modes.
> > For async mode there are options to use input packet buffer or a
> > separate buffer as the completion event and to set and retrieve the
> > context associated with an operation from the completion event.
> >
> > Signed-off-by: Alexandru Badicioiu <alexandru.badicioiu@linaro.org>
>
> I haven't had time to look into this patch will send feedback later
> today.
>
> one thing is it doesn't build:
>
> Making all in crypto
> make[3]: Entering directory
> '/home/anders/src/check-odp/odp/test/cunit/crypto'
>   CC       odp_crypto-odp_crypto_test_async_inp.o
> odp_crypto_test_async_inp.c:364:2: error: initialization discards ‘const’
> qualifier from pointer target type [-Werror]
>   {ASYNC_INP_ENC_ALG_3DES_CBC, test_async_enc_alg_3des_cbc },
>   ^
> odp_crypto_test_async_inp.c:365:2: error: initialization discards ‘const’
> qualifier from pointer target type [-Werror]
>   {ASYNC_INP_DEC_ALG_3DES_CBC, test_async_dec_alg_3des_cbc },
>   ^
> odp_crypto_test_async_inp.c:366:2: error: initialization discards ‘const’
> qualifier from pointer target type [-Werror]
>   {ASYNC_INP_ENC_ALG_3DES_CBC_OVR_IV, test_async_enc_alg_3des_cbc_ovr_iv },
>   ^
> odp_crypto_test_async_inp.c:367:2: error: initialization discards ‘const’
> qualifier from pointer target type [-Werror]
>   {ASYNC_INP_DEC_ALG_3DES_CBC_OVR_IV, test_async_dec_alg_3des_cbc_ovr_iv },
>   ^
> odp_crypto_test_async_inp.c:368:2: error: initialization discards ‘const’
> qualifier from pointer target type [-Werror]
>   {ASYNC_INP_ALG_HMAC_MD5, test_async_alg_hmac_md5 },
>   ^
> odp_crypto_test_async_inp.c:369:2: error: initialization discards ‘const’
> qualifier from pointer target type [-Werror]
>   {ASYNC_INP_ENC_ALG_3DES_CBC_COMPL_NEW,
> test_async_enc_alg_3des_cbc_compl_new },
>   ^
> cc1: all warnings being treated as errors
> Makefile:456: recipe for target 'odp_crypto-odp_crypto_test_async_inp.o'
> failed
> make[3]: *** [odp_crypto-odp_crypto_test_async_inp.o] Error 1
> make[3]: Leaving directory
> '/home/anders/src/check-odp/odp/test/cunit/crypto'
> Makefile:732: recipe for target 'all-recursive' failed
> make[2]: *** [all-recursive] Error 1
> Makefile:369: recipe for target 'all-recursive' failed
> make[1]: *** [all-recursive] Error 1
> Makefile:454: recipe for target 'all-recursive' failed
> make: *** [all-recursive] Error 1
> Making check in crypto
>
> Check patch compliains on this:
> WARNING: braces {} are not necessary for any arm of this statement
> #304: FILE: test/cunit/crypto/odp_crypto_test_async_inp.c:114:
> +       if (compl_new == ODP_BUFFER_INVALID) {
> [...]
> +       } else {
> [...]
>
> WARNING: line over 80 characters
> #556: FILE: test/cunit/crypto/odp_crypto_test_async_inp.c:366:
> +       {ASYNC_INP_ENC_ALG_3DES_CBC_OVR_IV,
> test_async_enc_alg_3des_cbc_ovr_iv },
>
> WARNING: line over 80 characters
> #557: FILE: test/cunit/crypto/odp_crypto_test_async_inp.c:367:
> +       {ASYNC_INP_DEC_ALG_3DES_CBC_OVR_IV,
> test_async_dec_alg_3des_cbc_ovr_iv },
>
> WARNING: line over 80 characters
> #559: FILE: test/cunit/crypto/odp_crypto_test_async_inp.c:369:
> +       {ASYNC_INP_ENC_ALG_3DES_CBC_COMPL_NEW,
> test_async_enc_alg_3des_cbc_compl_new },
>
>
> Cheers,
> Anders
>
Taras Kondratiuk Nov. 14, 2014, 10:02 a.m. | #3
On 11/14/2014 11:49 AM, Alexandru Badicioiu wrote:
> Hi,
> for build errors - which compiler/toolchain do you use? I did not modify 
> in any way compilation flags and I have no problem with building with a 
> PPC toolchain and also with the native gcc on my development machine? I 
> use CUnit-2.1-3.
> 
> WARNING: braces {} are not necessary for any arm of this statement
> #304: FILE: test/cunit/crypto/odp_crypto_test_async_inp.c:114:
> +       if (compl_new == ODP_BUFFER_INVALID) {
> [...]
> +       } else {
> [...]
> If we remove the braces the test will not compile, it seems the CUnit 
> macros are the problem.

I've notices the same issue with CUnit macros. But it is strange.
CU_ASSERT defined like

#define CU_ASSERT(value) \
  { CU_assertImplementation((value), __LINE__, #value, __FILE__, "", CU_FALSE); }

So it already has {} around it.
Maxim Uvarov Nov. 14, 2014, 10:35 a.m. | #4
On 11/14/2014 01:02 PM, Taras Kondratiuk wrote:
> On 11/14/2014 11:49 AM, Alexandru Badicioiu wrote:
>> Hi,
>> for build errors - which compiler/toolchain do you use? I did not modify
>> in any way compilation flags and I have no problem with building with a
>> PPC toolchain and also with the native gcc on my development machine? I
>> use CUnit-2.1-3.
>>
>> WARNING: braces {} are not necessary for any arm of this statement
>> #304: FILE: test/cunit/crypto/odp_crypto_test_async_inp.c:114:
>> +       if (compl_new == ODP_BUFFER_INVALID) {
>> [...]
>> +       } else {
>> [...]
>> If we remove the braces the test will not compile, it seems the CUnit
>> macros are the problem.
> I've notices the same issue with CUnit macros. But it is strange.
> CU_ASSERT defined like
>
> #define CU_ASSERT(value) \
>    { CU_assertImplementation((value), __LINE__, #value, __FILE__, "", CU_FALSE); }
>
> So it already has {} around it.

Try to remove ";":
     if (compl_new == ODP_BUFFER_INVALID)
         CU_ASSERT(compl_event == buf)
     else
         CU_ASSERT(compl_event == compl_new);

I see that translation code added your ";" after CU_ASSERT.

  if (compl_new == (0xffffffff))
   { CU_assertImplementation((compl_event == buf), 115, "compl_event == 
buf", "odp_crypto_test_async_inp.c", "", 0); };
  else
   { CU_assertImplementation((compl_event == compl_new), 117, 
"compl_event == compl_new", "odp_crypto_test_async_inp.c", "", 0); };



Maxim.

>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/lng-odp
Maxim Uvarov Nov. 14, 2014, 10:37 a.m. | #5
On 11/14/2014 01:35 PM, Maxim Uvarov wrote:
> On 11/14/2014 01:02 PM, Taras Kondratiuk wrote:
>> On 11/14/2014 11:49 AM, Alexandru Badicioiu wrote:
>>> Hi,
>>> for build errors - which compiler/toolchain do you use? I did not 
>>> modify
>>> in any way compilation flags and I have no problem with building with a
>>> PPC toolchain and also with the native gcc on my development machine? I
>>> use CUnit-2.1-3.
>>>
>>> WARNING: braces {} are not necessary for any arm of this statement
>>> #304: FILE: test/cunit/crypto/odp_crypto_test_async_inp.c:114:
>>> +       if (compl_new == ODP_BUFFER_INVALID) {
>>> [...]
>>> +       } else {
>>> [...]
>>> If we remove the braces the test will not compile, it seems the CUnit
>>> macros are the problem.
>> I've notices the same issue with CUnit macros. But it is strange.
>> CU_ASSERT defined like
>>
>> #define CU_ASSERT(value) \
>>    { CU_assertImplementation((value), __LINE__, #value, __FILE__, "", 
>> CU_FALSE); }
>>
>> So it already has {} around it.
>
> Try to remove ";":
>     if (compl_new == ODP_BUFFER_INVALID)
>         CU_ASSERT(compl_event == buf)
>     else
>         CU_ASSERT(compl_event == compl_new);
>
However checkpatch may warn in that case. So probably initial solution 
is right.

> I see that translation code added your ";" after CU_ASSERT.
>
>  if (compl_new == (0xffffffff))
>   { CU_assertImplementation((compl_event == buf), 115, "compl_event == 
> buf", "odp_crypto_test_async_inp.c", "", 0); };
>  else
>   { CU_assertImplementation((compl_event == compl_new), 117, 
> "compl_event == compl_new", "odp_crypto_test_async_inp.c", "", 0); };
>
>
>
> Maxim.
>
>>
>> _______________________________________________
>> lng-odp mailing list
>> lng-odp@lists.linaro.org
>> http://lists.linaro.org/mailman/listinfo/lng-odp
>
Maxim Uvarov Nov. 14, 2014, 11:42 a.m. | #6
On 11/14/2014 12:49 PM, Alexandru Badicioiu wrote:
> Hi,
> for build errors - which compiler/toolchain do you use?

Alex, I see the same with:

COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.6/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 
4.6.3-1ubuntu5' --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs 
--enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr 
--program-suffix=-4.6 --enable-shared --enable-linker-build-id 
--with-system-zlib --libexecdir=/usr/lib --without-included-gettext 
--enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6 
--libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu 
--enable-libstdcxx-debug --enable-libstdcxx-time=yes 
--enable-gnu-unique-object --enable-plugin --enable-objc-gc 
--disable-werror --with-arch-32=i686 --with-tune=generic 
--enable-checking=release --build=x86_64-linux-gnu 
--host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)

gcc -DHAVE_CONFIG_H -I. -pthread -DODP_DEBUG_PRINT=1 -DODP_DEBUG=1 -W 
-Wall -Werror -Wstrict-prototypes -Wmissing-prototypes 
-Wmissing-declarations -Wold-style-definition -Wpointer-arith 
-Wcast-align -Wnested-externs -Wcast-qual -Wformat-nonliteral 
-Wformat-security -Wundef -Wwrite-strings -I. 
-I../../../platform/linux-generic/include/api 
-I../../../platform/linux-generic/include/api -I../../../helper/include 
-I/include -g -O2 -MT odp_crypto-odp_crypto_test_async_inp.o -MD -MP -MF 
.deps/odp_crypto-odp_crypto_test_async_inp.Tpo -c -o 
odp_crypto-odp_crypto_test_async_inp.o `test -f 
'odp_crypto_test_async_inp.c' || echo './'`odp_crypto_test_async_inp.c
odp_crypto_test_async_inp.c:363:2: error: initialization discards 
'const' qualifier from pointer target type [-Werror]
odp_crypto_test_async_inp.c:364:2: error: initialization discards 
'const' qualifier from pointer target type [-Werror]
odp_crypto_test_async_inp.c:365:2: error: initialization discards 
'const' qualifier from pointer target type [-Werror]
odp_crypto_test_async_inp.c:366:2: error: initialization discards 
'const' qualifier from pointer target type [-Werror]
odp_crypto_test_async_inp.c:367:2: error: initialization discards 
'const' qualifier from pointer target type [-Werror]
odp_crypto_test_async_inp.c:368:2: error: initialization discards 
'const' qualifier from pointer target type [-Werror]
cc1: all warnings being treated as errors
make: *** [odp_crypto-odp_crypto_test_async_inp.o] Error 1

Maxim.


> I did not modify in any way compilation flags and I have no problem 
> with building with a PPC toolchain and also with the native gcc on my 
> development machine? I use CUnit-2.1-3.
>
> WARNING: braces {} are not necessary for any arm of this statement
> #304: FILE: test/cunit/crypto/odp_crypto_test_async_inp.c:114:
> + if (compl_new == ODP_BUFFER_INVALID) {
> [...]
> + } else {
> [...]
> If we remove the braces the test will not compile, it seems the CUnit 
> macros are the problem.
> I'll shorten the lines over 80 characters.
>
> Alex
>
>
> On 14 November 2014 10:23, Anders Roxell <anders.roxell@linaro.org 
> <mailto:anders.roxell@linaro.org>> wrote:
>
>     On 2014-11-13 16:14, alexandru.badicioiu@linaro.org
>     <mailto:alexandru.badicioiu@linaro.org> wrote:
>     > From: Alexandru Badicioiu <alexandru.badicioiu@linaro.org
>     <mailto:alexandru.badicioiu@linaro.org>>
>     >
>     > This patch adds a suite for sync and async inplace mode of
>     crypto APIs.
>     > Correctness of crypto operation output is verified with known test
>     > vectors. Various options and functionalities like use session IV
>     > or operation IV for ciphering are exercised for both modes.
>     > For async mode there are options to use input packet buffer or a
>     > separate buffer as the completion event and to set and retrieve the
>     > context associated with an operation from the completion event.
>     >
>     > Signed-off-by: Alexandru Badicioiu
>     <alexandru.badicioiu@linaro.org
>     <mailto:alexandru.badicioiu@linaro.org>>
>
>     I haven't had time to look into this patch will send feedback later
>     today.
>
>     one thing is it doesn't build:
>
>     Making all in crypto
>     make[3]: Entering directory
>     '/home/anders/src/check-odp/odp/test/cunit/crypto'
>     CC odp_crypto-odp_crypto_test_async_inp.o
>     odp_crypto_test_async_inp.c:364:2: error: initialization discards
>     ‘const’ qualifier from pointer target type [-Werror]
>     {ASYNC_INP_ENC_ALG_3DES_CBC, test_async_enc_alg_3des_cbc },
>     ^
>     odp_crypto_test_async_inp.c:365:2: error: initialization discards
>     ‘const’ qualifier from pointer target type [-Werror]
>     {ASYNC_INP_DEC_ALG_3DES_CBC, test_async_dec_alg_3des_cbc },
>     ^
>     odp_crypto_test_async_inp.c:366:2: error: initialization discards
>     ‘const’ qualifier from pointer target type [-Werror]
>     {ASYNC_INP_ENC_ALG_3DES_CBC_OVR_IV,
>     test_async_enc_alg_3des_cbc_ovr_iv },
>     ^
>     odp_crypto_test_async_inp.c:367:2: error: initialization discards
>     ‘const’ qualifier from pointer target type [-Werror]
>     {ASYNC_INP_DEC_ALG_3DES_CBC_OVR_IV,
>     test_async_dec_alg_3des_cbc_ovr_iv },
>     ^
>     odp_crypto_test_async_inp.c:368:2: error: initialization discards
>     ‘const’ qualifier from pointer target type [-Werror]
>     {ASYNC_INP_ALG_HMAC_MD5, test_async_alg_hmac_md5 },
>     ^
>     odp_crypto_test_async_inp.c:369:2: error: initialization discards
>     ‘const’ qualifier from pointer target type [-Werror]
>     {ASYNC_INP_ENC_ALG_3DES_CBC_COMPL_NEW,
>     test_async_enc_alg_3des_cbc_compl_new },
>     ^
>     cc1: all warnings being treated as errors
>     Makefile:456: recipe for target
>     'odp_crypto-odp_crypto_test_async_inp.o' failed
>     make[3]: *** [odp_crypto-odp_crypto_test_async_inp.o] Error 1
>     make[3]: Leaving directory
>     '/home/anders/src/check-odp/odp/test/cunit/crypto'
>     Makefile:732: recipe for target 'all-recursive' failed
>     make[2]: *** [all-recursive] Error 1
>     Makefile:369: recipe for target 'all-recursive' failed
>     make[1]: *** [all-recursive] Error 1
>     Makefile:454: recipe for target 'all-recursive' failed
>     make: *** [all-recursive] Error 1
>     Making check in crypto
>
>     Check patch compliains on this:
>     WARNING: braces {} are not necessary for any arm of this statement
>     #304: FILE: test/cunit/crypto/odp_crypto_test_async_inp.c:114:
>     + if (compl_new == ODP_BUFFER_INVALID) {
>     [...]
>     + } else {
>     [...]
>
>     WARNING: line over 80 characters
>     #556: FILE: test/cunit/crypto/odp_crypto_test_async_inp.c:366:
>     + {ASYNC_INP_ENC_ALG_3DES_CBC_OVR_IV,
>     test_async_enc_alg_3des_cbc_ovr_iv },
>
>     WARNING: line over 80 characters
>     #557: FILE: test/cunit/crypto/odp_crypto_test_async_inp.c:367:
>     + {ASYNC_INP_DEC_ALG_3DES_CBC_OVR_IV,
>     test_async_dec_alg_3des_cbc_ovr_iv },
>
>     WARNING: line over 80 characters
>     #559: FILE: test/cunit/crypto/odp_crypto_test_async_inp.c:369:
>     + {ASYNC_INP_ENC_ALG_3DES_CBC_COMPL_NEW,
>     test_async_enc_alg_3des_cbc_compl_new },
>
>
>     Cheers,
>     Anders
>
>
>
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/lng-odp
Alexandru Badicioiu Nov. 14, 2014, 12:04 p.m. | #7
I have the same compilation line:

powerpc-fsl_networking-linux-gcc
--sysroot=/dnyocto/yocto_common/git/sdk-1.5/build_p4080ds_release/tmp/sysroots/p4080ds
-DHAVE_CONFIG_H -I.    -pthread  -DODP_DEBUG_PRINT=1 -DODP_DEBUG=1 -W -Wall
-Werror -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations
-Wold-style-definition -Wpointer-arith -Wcast-align -Wnested-externs
-Wcast-qual -Wformat-nonliteral -Wformat-security -Wundef -Wwrite-strings
-I. -I../../../platform/linux-generic/include/api
-I../../../platform/linux-generic/include/api -I../../../helper/include
-I/var/lib/tftpboot/rootfs-e500mc-32bit/usr/local//include -g -O2 -MT
odp_crypto-odp_crypto_test_async_inp.o -MD -MP -MF
.deps/odp_crypto-odp_crypto_test_async_inp.Tpo -c -o
odp_crypto-odp_crypto_test_async_inp.o `test -f
'odp_crypto_test_async_inp.c' || echo './'`odp_crypto_test_async_inp.c

 but it seems that your compiler says that the initialization of
test_array_async array discards the const of ASYNC_INP_ENC_ALG_3DES_CBC:

#define ASYNC_INP_ENC_ALG_3DES_CBC      "ENC_ALG_3DES_CBC"
 CU_TestInfo test_array_async[] = {
        {ASYNC_INP_ENC_ALG_3DES_CBC, enc_alg_3des_cbc },

Could you please try adding const attribute to the array?
 + const CU_TestInfo test_array_async[] = {
        {ASYNC_INP_ENC_ALG_3DES_CBC, enc_alg_3des_cbc },

Thanks,
Alex

On 14 November 2014 13:42, Maxim Uvarov <maxim.uvarov@linaro.org> wrote:

> On 11/14/2014 12:49 PM, Alexandru Badicioiu wrote:
>
>> Hi,
>> for build errors - which compiler/toolchain do you use?
>>
>
> Alex, I see the same with:
>
> COLLECT_GCC=gcc
> COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.6/lto-wrapper
> Target: x86_64-linux-gnu
> Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro
> 4.6.3-1ubuntu5' --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs
> --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr
> --program-suffix=-4.6 --enable-shared --enable-linker-build-id
> --with-system-zlib --libexecdir=/usr/lib --without-included-gettext
> --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6
> --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu
> --enable-libstdcxx-debug --enable-libstdcxx-time=yes
> --enable-gnu-unique-object --enable-plugin --enable-objc-gc
> --disable-werror --with-arch-32=i686 --with-tune=generic
> --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu
> --target=x86_64-linux-gnu
> Thread model: posix
> gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)
>
> gcc -DHAVE_CONFIG_H -I. -pthread -DODP_DEBUG_PRINT=1 -DODP_DEBUG=1 -W
> -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes
> -Wmissing-declarations -Wold-style-definition -Wpointer-arith -Wcast-align
> -Wnested-externs -Wcast-qual -Wformat-nonliteral -Wformat-security -Wundef
> -Wwrite-strings -I. -I../../../platform/linux-generic/include/api
> -I../../../platform/linux-generic/include/api -I../../../helper/include
> -I/include -g -O2 -MT odp_crypto-odp_crypto_test_async_inp.o -MD -MP -MF
> .deps/odp_crypto-odp_crypto_test_async_inp.Tpo -c -o
> odp_crypto-odp_crypto_test_async_inp.o `test -f
> 'odp_crypto_test_async_inp.c' || echo './'`odp_crypto_test_async_inp.c
> odp_crypto_test_async_inp.c:363:2: error: initialization discards 'const'
> qualifier from pointer target type [-Werror]
> odp_crypto_test_async_inp.c:364:2: error: initialization discards 'const'
> qualifier from pointer target type [-Werror]
> odp_crypto_test_async_inp.c:365:2: error: initialization discards 'const'
> qualifier from pointer target type [-Werror]
> odp_crypto_test_async_inp.c:366:2: error: initialization discards 'const'
> qualifier from pointer target type [-Werror]
> odp_crypto_test_async_inp.c:367:2: error: initialization discards 'const'
> qualifier from pointer target type [-Werror]
> odp_crypto_test_async_inp.c:368:2: error: initialization discards 'const'
> qualifier from pointer target type [-Werror]
> cc1: all warnings being treated as errors
> make: *** [odp_crypto-odp_crypto_test_async_inp.o] Error 1
>
> Maxim.
>
>
>  I did not modify in any way compilation flags and I have no problem with
>> building with a PPC toolchain and also with the native gcc on my
>> development machine? I use CUnit-2.1-3.
>>
>> WARNING: braces {} are not necessary for any arm of this statement
>> #304: FILE: test/cunit/crypto/odp_crypto_test_async_inp.c:114:
>> + if (compl_new == ODP_BUFFER_INVALID) {
>> [...]
>> + } else {
>> [...]
>> If we remove the braces the test will not compile, it seems the CUnit
>> macros are the problem.
>> I'll shorten the lines over 80 characters.
>>
>> Alex
>>
>>
>> On 14 November 2014 10:23, Anders Roxell <anders.roxell@linaro.org
>> <mailto:anders.roxell@linaro.org>> wrote:
>>
>>     On 2014-11-13 16:14, alexandru.badicioiu@linaro.org
>>     <mailto:alexandru.badicioiu@linaro.org> wrote:
>>     > From: Alexandru Badicioiu <alexandru.badicioiu@linaro.org
>>     <mailto:alexandru.badicioiu@linaro.org>>
>>     >
>>     > This patch adds a suite for sync and async inplace mode of
>>     crypto APIs.
>>     > Correctness of crypto operation output is verified with known test
>>     > vectors. Various options and functionalities like use session IV
>>     > or operation IV for ciphering are exercised for both modes.
>>     > For async mode there are options to use input packet buffer or a
>>     > separate buffer as the completion event and to set and retrieve the
>>     > context associated with an operation from the completion event.
>>     >
>>     > Signed-off-by: Alexandru Badicioiu
>>     <alexandru.badicioiu@linaro.org
>>     <mailto:alexandru.badicioiu@linaro.org>>
>>
>>
>>     I haven't had time to look into this patch will send feedback later
>>     today.
>>
>>     one thing is it doesn't build:
>>
>>     Making all in crypto
>>     make[3]: Entering directory
>>     '/home/anders/src/check-odp/odp/test/cunit/crypto'
>>     CC odp_crypto-odp_crypto_test_async_inp.o
>>     odp_crypto_test_async_inp.c:364:2: error: initialization discards
>>     ‘const’ qualifier from pointer target type [-Werror]
>>     {ASYNC_INP_ENC_ALG_3DES_CBC, test_async_enc_alg_3des_cbc },
>>     ^
>>     odp_crypto_test_async_inp.c:365:2: error: initialization discards
>>     ‘const’ qualifier from pointer target type [-Werror]
>>     {ASYNC_INP_DEC_ALG_3DES_CBC, test_async_dec_alg_3des_cbc },
>>     ^
>>     odp_crypto_test_async_inp.c:366:2: error: initialization discards
>>     ‘const’ qualifier from pointer target type [-Werror]
>>     {ASYNC_INP_ENC_ALG_3DES_CBC_OVR_IV,
>>     test_async_enc_alg_3des_cbc_ovr_iv },
>>     ^
>>     odp_crypto_test_async_inp.c:367:2: error: initialization discards
>>     ‘const’ qualifier from pointer target type [-Werror]
>>     {ASYNC_INP_DEC_ALG_3DES_CBC_OVR_IV,
>>     test_async_dec_alg_3des_cbc_ovr_iv },
>>     ^
>>     odp_crypto_test_async_inp.c:368:2: error: initialization discards
>>     ‘const’ qualifier from pointer target type [-Werror]
>>     {ASYNC_INP_ALG_HMAC_MD5, test_async_alg_hmac_md5 },
>>     ^
>>     odp_crypto_test_async_inp.c:369:2: error: initialization discards
>>     ‘const’ qualifier from pointer target type [-Werror]
>>     {ASYNC_INP_ENC_ALG_3DES_CBC_COMPL_NEW,
>>     test_async_enc_alg_3des_cbc_compl_new },
>>     ^
>>     cc1: all warnings being treated as errors
>>     Makefile:456: recipe for target
>>     'odp_crypto-odp_crypto_test_async_inp.o' failed
>>     make[3]: *** [odp_crypto-odp_crypto_test_async_inp.o] Error 1
>>     make[3]: Leaving directory
>>     '/home/anders/src/check-odp/odp/test/cunit/crypto'
>>     Makefile:732: recipe for target 'all-recursive' failed
>>     make[2]: *** [all-recursive] Error 1
>>     Makefile:369: recipe for target 'all-recursive' failed
>>     make[1]: *** [all-recursive] Error 1
>>     Makefile:454: recipe for target 'all-recursive' failed
>>     make: *** [all-recursive] Error 1
>>     Making check in crypto
>>
>>     Check patch compliains on this:
>>     WARNING: braces {} are not necessary for any arm of this statement
>>     #304: FILE: test/cunit/crypto/odp_crypto_test_async_inp.c:114:
>>     + if (compl_new == ODP_BUFFER_INVALID) {
>>     [...]
>>     + } else {
>>     [...]
>>
>>     WARNING: line over 80 characters
>>     #556: FILE: test/cunit/crypto/odp_crypto_test_async_inp.c:366:
>>     + {ASYNC_INP_ENC_ALG_3DES_CBC_OVR_IV,
>>     test_async_enc_alg_3des_cbc_ovr_iv },
>>
>>     WARNING: line over 80 characters
>>     #557: FILE: test/cunit/crypto/odp_crypto_test_async_inp.c:367:
>>     + {ASYNC_INP_DEC_ALG_3DES_CBC_OVR_IV,
>>     test_async_dec_alg_3des_cbc_ovr_iv },
>>
>>     WARNING: line over 80 characters
>>     #559: FILE: test/cunit/crypto/odp_crypto_test_async_inp.c:369:
>>     + {ASYNC_INP_ENC_ALG_3DES_CBC_COMPL_NEW,
>>     test_async_enc_alg_3des_cbc_compl_new },
>>
>>
>>     Cheers,
>>     Anders
>>
>>
>>
>>
>> _______________________________________________
>> lng-odp mailing list
>> lng-odp@lists.linaro.org
>> http://lists.linaro.org/mailman/listinfo/lng-odp
>>
>
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/lng-odp
>
Anders Roxell Nov. 14, 2014, 12:35 p.m. | #8
On 2014-11-14 11:49, Alexandru Badicioiu wrote:
> Hi,
> for build errors - which compiler/toolchain do you use? I did not modify in
> any way compilation flags and I have no problem with building with a PPC
> toolchain and also with the native gcc on my development machine? I use
> CUnit-2.1-3.

Hi,

Ubuntu 14.10:
# gcc --version
gcc (Ubuntu 4.9.1-16ubuntu6) 4.9.1
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

# dpkg -s libcunit1-dev
Package: libcunit1-dev
Status: install ok installed
Priority: optional
Section: libdevel
Installed-Size: 285
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Architecture: amd64
Source: cunit
Version: 2.1-2.dfsg-1
Depends: libcunit1 (= 2.1-2.dfsg-1)
Suggests: libcunit1-doc (= 2.1-2.dfsg-1)

Does *not* build!


Ubuntu 14.04:
# gcc --version
gcc (Ubuntu 4.8.2-19ubuntu1) 4.8.2
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

# dpkg -s libcunit1-dev
Package: libcunit1-dev
Status: install ok installed
Priority: optional
Section: libdevel
Installed-Size: 285
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Architecture: amd64
Source: cunit
Version: 2.1-2.dfsg-1
Depends: libcunit1 (= 2.1-2.dfsg-1)
Suggests: libcunit1-doc (= 2.1-2.dfsg-1)

Does *not* build!


Builds:
cross compiling with linaro toolchain release 14.09 + CUnit version 2.1-3

Do you use some 2.1-3 specific CUnit stuff?

Cheers,
Anders


> 
> WARNING: braces {} are not necessary for any arm of this statement
> #304: FILE: test/cunit/crypto/odp_crypto_test_async_inp.c:114:
> +       if (compl_new == ODP_BUFFER_INVALID) {
> [...]
> +       } else {
> [...]
> If we remove the braces the test will not compile, it seems the CUnit
> macros are the problem.
> I'll shorten the lines over 80 characters.
> 
> Alex
> 
> 
> On 14 November 2014 10:23, Anders Roxell <anders.roxell@linaro.org> wrote:
> 
> > On 2014-11-13 16:14, alexandru.badicioiu@linaro.org wrote:
> > > From: Alexandru Badicioiu <alexandru.badicioiu@linaro.org>
> > >
> > > This patch adds a suite for sync and async inplace mode of crypto APIs.
> > > Correctness of crypto operation output is verified with known test
> > > vectors. Various options and functionalities like use session IV
> > > or operation IV for ciphering are exercised for both modes.
> > > For async mode there are options to use input packet buffer or a
> > > separate buffer as the completion event and to set and retrieve the
> > > context associated with an operation from the completion event.
> > >
> > > Signed-off-by: Alexandru Badicioiu <alexandru.badicioiu@linaro.org>
> >
> > I haven't had time to look into this patch will send feedback later
> > today.
> >
> > one thing is it doesn't build:
> >
> > Making all in crypto
> > make[3]: Entering directory
> > '/home/anders/src/check-odp/odp/test/cunit/crypto'
> >   CC       odp_crypto-odp_crypto_test_async_inp.o
> > odp_crypto_test_async_inp.c:364:2: error: initialization discards ‘const’
> > qualifier from pointer target type [-Werror]
> >   {ASYNC_INP_ENC_ALG_3DES_CBC, test_async_enc_alg_3des_cbc },
> >   ^
> > odp_crypto_test_async_inp.c:365:2: error: initialization discards ‘const’
> > qualifier from pointer target type [-Werror]
> >   {ASYNC_INP_DEC_ALG_3DES_CBC, test_async_dec_alg_3des_cbc },
> >   ^
> > odp_crypto_test_async_inp.c:366:2: error: initialization discards ‘const’
> > qualifier from pointer target type [-Werror]
> >   {ASYNC_INP_ENC_ALG_3DES_CBC_OVR_IV, test_async_enc_alg_3des_cbc_ovr_iv },
> >   ^
> > odp_crypto_test_async_inp.c:367:2: error: initialization discards ‘const’
> > qualifier from pointer target type [-Werror]
> >   {ASYNC_INP_DEC_ALG_3DES_CBC_OVR_IV, test_async_dec_alg_3des_cbc_ovr_iv },
> >   ^
> > odp_crypto_test_async_inp.c:368:2: error: initialization discards ‘const’
> > qualifier from pointer target type [-Werror]
> >   {ASYNC_INP_ALG_HMAC_MD5, test_async_alg_hmac_md5 },
> >   ^
> > odp_crypto_test_async_inp.c:369:2: error: initialization discards ‘const’
> > qualifier from pointer target type [-Werror]
> >   {ASYNC_INP_ENC_ALG_3DES_CBC_COMPL_NEW,
> > test_async_enc_alg_3des_cbc_compl_new },
> >   ^
> > cc1: all warnings being treated as errors
> > Makefile:456: recipe for target 'odp_crypto-odp_crypto_test_async_inp.o'
> > failed
> > make[3]: *** [odp_crypto-odp_crypto_test_async_inp.o] Error 1
> > make[3]: Leaving directory
> > '/home/anders/src/check-odp/odp/test/cunit/crypto'
> > Makefile:732: recipe for target 'all-recursive' failed
> > make[2]: *** [all-recursive] Error 1
> > Makefile:369: recipe for target 'all-recursive' failed
> > make[1]: *** [all-recursive] Error 1
> > Makefile:454: recipe for target 'all-recursive' failed
> > make: *** [all-recursive] Error 1
> > Making check in crypto
> >
> > Check patch compliains on this:
> > WARNING: braces {} are not necessary for any arm of this statement
> > #304: FILE: test/cunit/crypto/odp_crypto_test_async_inp.c:114:
> > +       if (compl_new == ODP_BUFFER_INVALID) {
> > [...]
> > +       } else {
> > [...]
> >
> > WARNING: line over 80 characters
> > #556: FILE: test/cunit/crypto/odp_crypto_test_async_inp.c:366:
> > +       {ASYNC_INP_ENC_ALG_3DES_CBC_OVR_IV,
> > test_async_enc_alg_3des_cbc_ovr_iv },
> >
> > WARNING: line over 80 characters
> > #557: FILE: test/cunit/crypto/odp_crypto_test_async_inp.c:367:
> > +       {ASYNC_INP_DEC_ALG_3DES_CBC_OVR_IV,
> > test_async_dec_alg_3des_cbc_ovr_iv },
> >
> > WARNING: line over 80 characters
> > #559: FILE: test/cunit/crypto/odp_crypto_test_async_inp.c:369:
> > +       {ASYNC_INP_ENC_ALG_3DES_CBC_COMPL_NEW,
> > test_async_enc_alg_3des_cbc_compl_new },
> >
> >
> > Cheers,
> > Anders
> >
Alexandru Badicioiu Nov. 14, 2014, 12:48 p.m. | #9
I have no idea what is CUnit-2.1-3 specific stuff. Just download it and
build it.

Alex

On 14 November 2014 14:35, Anders Roxell <anders.roxell@linaro.org> wrote:

> On 2014-11-14 11:49, Alexandru Badicioiu wrote:
> > Hi,
> > for build errors - which compiler/toolchain do you use? I did not modify
> in
> > any way compilation flags and I have no problem with building with a PPC
> > toolchain and also with the native gcc on my development machine? I use
> > CUnit-2.1-3.
>
> Hi,
>
> Ubuntu 14.10:
> # gcc --version
> gcc (Ubuntu 4.9.1-16ubuntu6) 4.9.1
> Copyright (C) 2014 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions.  There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
>
> # dpkg -s libcunit1-dev
> Package: libcunit1-dev
> Status: install ok installed
> Priority: optional
> Section: libdevel
> Installed-Size: 285
> Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
> Architecture: amd64
> Source: cunit
> Version: 2.1-2.dfsg-1
> Depends: libcunit1 (= 2.1-2.dfsg-1)
> Suggests: libcunit1-doc (= 2.1-2.dfsg-1)
>
> Does *not* build!
>
>
> Ubuntu 14.04:
> # gcc --version
> gcc (Ubuntu 4.8.2-19ubuntu1) 4.8.2
> Copyright (C) 2013 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions.  There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
>
> # dpkg -s libcunit1-dev
> Package: libcunit1-dev
> Status: install ok installed
> Priority: optional
> Section: libdevel
> Installed-Size: 285
> Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
> Architecture: amd64
> Source: cunit
> Version: 2.1-2.dfsg-1
> Depends: libcunit1 (= 2.1-2.dfsg-1)
> Suggests: libcunit1-doc (= 2.1-2.dfsg-1)
>
> Does *not* build!
>
>
> Builds:
> cross compiling with linaro toolchain release 14.09 + CUnit version 2.1-3
>
> Do you use some 2.1-3 specific CUnit stuff?
>
> Cheers,
> Anders
>
>
> >
> > WARNING: braces {} are not necessary for any arm of this statement
> > #304: FILE: test/cunit/crypto/odp_crypto_test_async_inp.c:114:
> > +       if (compl_new == ODP_BUFFER_INVALID) {
> > [...]
> > +       } else {
> > [...]
> > If we remove the braces the test will not compile, it seems the CUnit
> > macros are the problem.
> > I'll shorten the lines over 80 characters.
> >
> > Alex
> >
> >
> > On 14 November 2014 10:23, Anders Roxell <anders.roxell@linaro.org>
> wrote:
> >
> > > On 2014-11-13 16:14, alexandru.badicioiu@linaro.org wrote:
> > > > From: Alexandru Badicioiu <alexandru.badicioiu@linaro.org>
> > > >
> > > > This patch adds a suite for sync and async inplace mode of crypto
> APIs.
> > > > Correctness of crypto operation output is verified with known test
> > > > vectors. Various options and functionalities like use session IV
> > > > or operation IV for ciphering are exercised for both modes.
> > > > For async mode there are options to use input packet buffer or a
> > > > separate buffer as the completion event and to set and retrieve the
> > > > context associated with an operation from the completion event.
> > > >
> > > > Signed-off-by: Alexandru Badicioiu <alexandru.badicioiu@linaro.org>
> > >
> > > I haven't had time to look into this patch will send feedback later
> > > today.
> > >
> > > one thing is it doesn't build:
> > >
> > > Making all in crypto
> > > make[3]: Entering directory
> > > '/home/anders/src/check-odp/odp/test/cunit/crypto'
> > >   CC       odp_crypto-odp_crypto_test_async_inp.o
> > > odp_crypto_test_async_inp.c:364:2: error: initialization discards
> ‘const’
> > > qualifier from pointer target type [-Werror]
> > >   {ASYNC_INP_ENC_ALG_3DES_CBC, test_async_enc_alg_3des_cbc },
> > >   ^
> > > odp_crypto_test_async_inp.c:365:2: error: initialization discards
> ‘const’
> > > qualifier from pointer target type [-Werror]
> > >   {ASYNC_INP_DEC_ALG_3DES_CBC, test_async_dec_alg_3des_cbc },
> > >   ^
> > > odp_crypto_test_async_inp.c:366:2: error: initialization discards
> ‘const’
> > > qualifier from pointer target type [-Werror]
> > >   {ASYNC_INP_ENC_ALG_3DES_CBC_OVR_IV,
> test_async_enc_alg_3des_cbc_ovr_iv },
> > >   ^
> > > odp_crypto_test_async_inp.c:367:2: error: initialization discards
> ‘const’
> > > qualifier from pointer target type [-Werror]
> > >   {ASYNC_INP_DEC_ALG_3DES_CBC_OVR_IV,
> test_async_dec_alg_3des_cbc_ovr_iv },
> > >   ^
> > > odp_crypto_test_async_inp.c:368:2: error: initialization discards
> ‘const’
> > > qualifier from pointer target type [-Werror]
> > >   {ASYNC_INP_ALG_HMAC_MD5, test_async_alg_hmac_md5 },
> > >   ^
> > > odp_crypto_test_async_inp.c:369:2: error: initialization discards
> ‘const’
> > > qualifier from pointer target type [-Werror]
> > >   {ASYNC_INP_ENC_ALG_3DES_CBC_COMPL_NEW,
> > > test_async_enc_alg_3des_cbc_compl_new },
> > >   ^
> > > cc1: all warnings being treated as errors
> > > Makefile:456: recipe for target
> 'odp_crypto-odp_crypto_test_async_inp.o'
> > > failed
> > > make[3]: *** [odp_crypto-odp_crypto_test_async_inp.o] Error 1
> > > make[3]: Leaving directory
> > > '/home/anders/src/check-odp/odp/test/cunit/crypto'
> > > Makefile:732: recipe for target 'all-recursive' failed
> > > make[2]: *** [all-recursive] Error 1
> > > Makefile:369: recipe for target 'all-recursive' failed
> > > make[1]: *** [all-recursive] Error 1
> > > Makefile:454: recipe for target 'all-recursive' failed
> > > make: *** [all-recursive] Error 1
> > > Making check in crypto
> > >
> > > Check patch compliains on this:
> > > WARNING: braces {} are not necessary for any arm of this statement
> > > #304: FILE: test/cunit/crypto/odp_crypto_test_async_inp.c:114:
> > > +       if (compl_new == ODP_BUFFER_INVALID) {
> > > [...]
> > > +       } else {
> > > [...]
> > >
> > > WARNING: line over 80 characters
> > > #556: FILE: test/cunit/crypto/odp_crypto_test_async_inp.c:366:
> > > +       {ASYNC_INP_ENC_ALG_3DES_CBC_OVR_IV,
> > > test_async_enc_alg_3des_cbc_ovr_iv },
> > >
> > > WARNING: line over 80 characters
> > > #557: FILE: test/cunit/crypto/odp_crypto_test_async_inp.c:367:
> > > +       {ASYNC_INP_DEC_ALG_3DES_CBC_OVR_IV,
> > > test_async_dec_alg_3des_cbc_ovr_iv },
> > >
> > > WARNING: line over 80 characters
> > > #559: FILE: test/cunit/crypto/odp_crypto_test_async_inp.c:369:
> > > +       {ASYNC_INP_ENC_ALG_3DES_CBC_COMPL_NEW,
> > > test_async_enc_alg_3des_cbc_compl_new },
> > >
> > >
> > > Cheers,
> > > Anders
> > >
>
> --
> Anders Roxell
> anders.roxell@linaro.org
> M: +46 709 71 42 85 | IRC: roxell
>
Maxim Uvarov Nov. 14, 2014, 12:59 p.m. | #10
On 11/14/2014 03:04 PM, Alexandru Badicioiu wrote:
> I have the same compilation line:
>
> powerpc-fsl_networking-linux-gcc 
> --sysroot=/dnyocto/yocto_common/git/sdk-1.5/build_p4080ds_release/tmp/sysroots/p4080ds 
> -DHAVE_CONFIG_H -I.    -pthread  -DODP_DEBUG_PRINT=1 -DODP_DEBUG=1 -W 
> -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes 
> -Wmissing-declarations -Wold-style-definition -Wpointer-arith 
> -Wcast-align -Wnested-externs -Wcast-qual -Wformat-nonliteral 
> -Wformat-security -Wundef -Wwrite-strings -I. 
> -I../../../platform/linux-generic/include/api 
> -I../../../platform/linux-generic/include/api 
> -I../../../helper/include 
> -I/var/lib/tftpboot/rootfs-e500mc-32bit/usr/local//include -g -O2 -MT 
> odp_crypto-odp_crypto_test_async_inp.o -MD -MP -MF 
> .deps/odp_crypto-odp_crypto_test_async_inp.Tpo -c -o 
> odp_crypto-odp_crypto_test_async_inp.o `test -f 
> 'odp_crypto_test_async_inp.c' || echo './'`odp_crypto_test_async_inp.c
>
>  but it seems that your compiler says that the initialization of 
> test_array_async array discards the const of ASYNC_INP_ENC_ALG_3DES_CBC:
>
> #define ASYNC_INP_ENC_ALG_3DES_CBC  "ENC_ALG_3DES_CBC"
>  CU_TestInfo test_array_async[] = {
>         {ASYNC_INP_ENC_ALG_3DES_CBC, enc_alg_3des_cbc },
>
> Could you please try adding const attribute to the array?
>  + const CU_TestInfo test_array_async[] = {
>         {ASYNC_INP_ENC_ALG_3DES_CBC, enc_alg_3des_cbc },
>
> Thanks,
> Alex

Alex that will not work. Cunit expects char*. While #define 
ASYNC_INP_ENC_ALG_3DES_CBC    "ENC_ALG_3DES_CBC"
is const char:

typedef struct CU_TestInfo {
     char       *pName;      /**< Test name. */
     CU_TestFunc pTestFunc;  /**< Test function. */
} CU_TestInfo;

I don't think cunit modifies that name. So it's mostly cunit problem 
then ours. Might be we can disable this warning for that
particular place.

Maxim.


>
> On 14 November 2014 13:42, Maxim Uvarov <maxim.uvarov@linaro.org 
> <mailto:maxim.uvarov@linaro.org>> wrote:
>
>     On 11/14/2014 12:49 PM, Alexandru Badicioiu wrote:
>
>         Hi,
>         for build errors - which compiler/toolchain do you use?
>
>
>     Alex, I see the same with:
>
>     COLLECT_GCC=gcc
>     COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.6/lto-wrapper
>     Target: x86_64-linux-gnu
>     Configured with: ../src/configure -v
>     --with-pkgversion='Ubuntu/Linaro 4.6.3-1ubuntu5'
>     --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs
>     --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr
>     --program-suffix=-4.6 --enable-shared --enable-linker-build-id
>     --with-system-zlib --libexecdir=/usr/lib
>     --without-included-gettext --enable-threads=posix
>     --with-gxx-include-dir=/usr/include/c++/4.6 --libdir=/usr/lib
>     --enable-nls --with-sysroot=/ --enable-clocale=gnu
>     --enable-libstdcxx-debug --enable-libstdcxx-time=yes
>     --enable-gnu-unique-object --enable-plugin --enable-objc-gc
>     --disable-werror --with-arch-32=i686 --with-tune=generic
>     --enable-checking=release --build=x86_64-linux-gnu
>     --host=x86_64-linux-gnu --target=x86_64-linux-gnu
>     Thread model: posix
>     gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)
>
>     gcc -DHAVE_CONFIG_H -I. -pthread -DODP_DEBUG_PRINT=1 -DODP_DEBUG=1
>     -W -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes
>     -Wmissing-declarations -Wold-style-definition -Wpointer-arith
>     -Wcast-align -Wnested-externs -Wcast-qual -Wformat-nonliteral
>     -Wformat-security -Wundef -Wwrite-strings -I.
>     -I../../../platform/linux-generic/include/api
>     -I../../../platform/linux-generic/include/api
>     -I../../../helper/include -I/include -g -O2 -MT
>     odp_crypto-odp_crypto_test_async_inp.o -MD -MP -MF
>     .deps/odp_crypto-odp_crypto_test_async_inp.Tpo -c -o
>     odp_crypto-odp_crypto_test_async_inp.o `test -f
>     'odp_crypto_test_async_inp.c' || echo './'`odp_crypto_test_async_inp.c
>     odp_crypto_test_async_inp.c:363:2: error: initialization discards
>     'const' qualifier from pointer target type [-Werror]
>     odp_crypto_test_async_inp.c:364:2: error: initialization discards
>     'const' qualifier from pointer target type [-Werror]
>     odp_crypto_test_async_inp.c:365:2: error: initialization discards
>     'const' qualifier from pointer target type [-Werror]
>     odp_crypto_test_async_inp.c:366:2: error: initialization discards
>     'const' qualifier from pointer target type [-Werror]
>     odp_crypto_test_async_inp.c:367:2: error: initialization discards
>     'const' qualifier from pointer target type [-Werror]
>     odp_crypto_test_async_inp.c:368:2: error: initialization discards
>     'const' qualifier from pointer target type [-Werror]
>     cc1: all warnings being treated as errors
>     make: *** [odp_crypto-odp_crypto_test_async_inp.o] Error 1
>
>     Maxim.
>
>
>         I did not modify in any way compilation flags and I have no
>         problem with building with a PPC toolchain and also with the
>         native gcc on my development machine? I use CUnit-2.1-3.
>
>         WARNING: braces {} are not necessary for any arm of this statement
>         #304: FILE: test/cunit/crypto/odp_crypto_test_async_inp.c:114:
>         + if (compl_new == ODP_BUFFER_INVALID) {
>         [...]
>         + } else {
>         [...]
>         If we remove the braces the test will not compile, it seems
>         the CUnit macros are the problem.
>         I'll shorten the lines over 80 characters.
>
>         Alex
>
>
>         On 14 November 2014 10:23, Anders Roxell
>         <anders.roxell@linaro.org <mailto:anders.roxell@linaro.org>
>         <mailto:anders.roxell@linaro.org
>         <mailto:anders.roxell@linaro.org>>> wrote:
>
>             On 2014-11-13 16:14, alexandru.badicioiu@linaro.org
>         <mailto:alexandru.badicioiu@linaro.org>
>             <mailto:alexandru.badicioiu@linaro.org
>         <mailto:alexandru.badicioiu@linaro.org>> wrote:
>             > From: Alexandru Badicioiu
>         <alexandru.badicioiu@linaro.org
>         <mailto:alexandru.badicioiu@linaro.org>
>             <mailto:alexandru.badicioiu@linaro.org
>         <mailto:alexandru.badicioiu@linaro.org>>>
>             >
>             > This patch adds a suite for sync and async inplace mode of
>             crypto APIs.
>             > Correctness of crypto operation output is verified with
>         known test
>             > vectors. Various options and functionalities like use
>         session IV
>             > or operation IV for ciphering are exercised for both modes.
>             > For async mode there are options to use input packet
>         buffer or a
>             > separate buffer as the completion event and to set and
>         retrieve the
>             > context associated with an operation from the completion
>         event.
>             >
>             > Signed-off-by: Alexandru Badicioiu
>             <alexandru.badicioiu@linaro.org
>         <mailto:alexandru.badicioiu@linaro.org>
>             <mailto:alexandru.badicioiu@linaro.org
>         <mailto:alexandru.badicioiu@linaro.org>>>
>
>
>             I haven't had time to look into this patch will send
>         feedback later
>             today.
>
>             one thing is it doesn't build:
>
>             Making all in crypto
>             make[3]: Entering directory
>             '/home/anders/src/check-odp/odp/test/cunit/crypto'
>             CC odp_crypto-odp_crypto_test_async_inp.o
>             odp_crypto_test_async_inp.c:364:2: error: initialization
>         discards
>             ‘const’ qualifier from pointer target type [-Werror]
>             {ASYNC_INP_ENC_ALG_3DES_CBC, test_async_enc_alg_3des_cbc },
>             ^
>             odp_crypto_test_async_inp.c:365:2: error: initialization
>         discards
>             ‘const’ qualifier from pointer target type [-Werror]
>             {ASYNC_INP_DEC_ALG_3DES_CBC, test_async_dec_alg_3des_cbc },
>             ^
>             odp_crypto_test_async_inp.c:366:2: error: initialization
>         discards
>             ‘const’ qualifier from pointer target type [-Werror]
>             {ASYNC_INP_ENC_ALG_3DES_CBC_OVR_IV,
>             test_async_enc_alg_3des_cbc_ovr_iv },
>             ^
>             odp_crypto_test_async_inp.c:367:2: error: initialization
>         discards
>             ‘const’ qualifier from pointer target type [-Werror]
>             {ASYNC_INP_DEC_ALG_3DES_CBC_OVR_IV,
>             test_async_dec_alg_3des_cbc_ovr_iv },
>             ^
>             odp_crypto_test_async_inp.c:368:2: error: initialization
>         discards
>             ‘const’ qualifier from pointer target type [-Werror]
>             {ASYNC_INP_ALG_HMAC_MD5, test_async_alg_hmac_md5 },
>             ^
>             odp_crypto_test_async_inp.c:369:2: error: initialization
>         discards
>             ‘const’ qualifier from pointer target type [-Werror]
>             {ASYNC_INP_ENC_ALG_3DES_CBC_COMPL_NEW,
>             test_async_enc_alg_3des_cbc_compl_new },
>             ^
>             cc1: all warnings being treated as errors
>             Makefile:456: recipe for target
>             'odp_crypto-odp_crypto_test_async_inp.o' failed
>             make[3]: *** [odp_crypto-odp_crypto_test_async_inp.o] Error 1
>             make[3]: Leaving directory
>             '/home/anders/src/check-odp/odp/test/cunit/crypto'
>             Makefile:732: recipe for target 'all-recursive' failed
>             make[2]: *** [all-recursive] Error 1
>             Makefile:369: recipe for target 'all-recursive' failed
>             make[1]: *** [all-recursive] Error 1
>             Makefile:454: recipe for target 'all-recursive' failed
>             make: *** [all-recursive] Error 1
>             Making check in crypto
>
>             Check patch compliains on this:
>             WARNING: braces {} are not necessary for any arm of this
>         statement
>             #304: FILE: test/cunit/crypto/odp_crypto_test_async_inp.c:114:
>             + if (compl_new == ODP_BUFFER_INVALID) {
>             [...]
>             + } else {
>             [...]
>
>             WARNING: line over 80 characters
>             #556: FILE: test/cunit/crypto/odp_crypto_test_async_inp.c:366:
>             + {ASYNC_INP_ENC_ALG_3DES_CBC_OVR_IV,
>             test_async_enc_alg_3des_cbc_ovr_iv },
>
>             WARNING: line over 80 characters
>             #557: FILE: test/cunit/crypto/odp_crypto_test_async_inp.c:367:
>             + {ASYNC_INP_DEC_ALG_3DES_CBC_OVR_IV,
>             test_async_dec_alg_3des_cbc_ovr_iv },
>
>             WARNING: line over 80 characters
>             #559: FILE: test/cunit/crypto/odp_crypto_test_async_inp.c:369:
>             + {ASYNC_INP_ENC_ALG_3DES_CBC_COMPL_NEW,
>             test_async_enc_alg_3des_cbc_compl_new },
>
>
>             Cheers,
>             Anders
>
>
>
>
>         _______________________________________________
>         lng-odp mailing list
>         lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org>
>         http://lists.linaro.org/mailman/listinfo/lng-odp
>
>
>
>     _______________________________________________
>     lng-odp mailing list
>     lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org>
>     http://lists.linaro.org/mailman/listinfo/lng-odp
>
>
Alexandru Badicioiu Nov. 14, 2014, 1:02 p.m. | #11
Maxim,
I see you have a different CUnit than me. This is from
 ~/CUnit-2.1-3/CUnit/Headers/TestDB.h:

/**
 *  Test case parameters structure.
 *  This data type is provided to assist CUnit users manage collections of
 *  tests and suites.  It is intended to be used to build arrays of test
case
 *  parameters that can be then be referred to in a CU_suite_info_t
variable.
 */
typedef struct CU_TestInfo {
        *const char  *pName; *     /**< Test name. */
        CU_TestFunc pTestFunc;  /**< Test function. */
} CU_TestInfo;


On 14 November 2014 14:59, Maxim Uvarov <maxim.uvarov@linaro.org> wrote:

> On 11/14/2014 03:04 PM, Alexandru Badicioiu wrote:
>
>> I have the same compilation line:
>>
>> powerpc-fsl_networking-linux-gcc --sysroot=/dnyocto/yocto_
>> common/git/sdk-1.5/build_p4080ds_release/tmp/sysroots/p4080ds
>> -DHAVE_CONFIG_H -I.    -pthread  -DODP_DEBUG_PRINT=1 -DODP_DEBUG=1 -W -Wall
>> -Werror -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations
>> -Wold-style-definition -Wpointer-arith -Wcast-align -Wnested-externs
>> -Wcast-qual -Wformat-nonliteral -Wformat-security -Wundef -Wwrite-strings
>> -I. -I../../../platform/linux-generic/include/api
>> -I../../../platform/linux-generic/include/api -I../../../helper/include
>> -I/var/lib/tftpboot/rootfs-e500mc-32bit/usr/local//include -g -O2 -MT
>> odp_crypto-odp_crypto_test_async_inp.o -MD -MP -MF
>> .deps/odp_crypto-odp_crypto_test_async_inp.Tpo -c -o
>> odp_crypto-odp_crypto_test_async_inp.o `test -f
>> 'odp_crypto_test_async_inp.c' || echo './'`odp_crypto_test_async_inp.c
>>
>>  but it seems that your compiler says that the initialization of
>> test_array_async array discards the const of ASYNC_INP_ENC_ALG_3DES_CBC:
>>
>> #define ASYNC_INP_ENC_ALG_3DES_CBC  "ENC_ALG_3DES_CBC"
>>  CU_TestInfo test_array_async[] = {
>>         {ASYNC_INP_ENC_ALG_3DES_CBC, enc_alg_3des_cbc },
>>
>> Could you please try adding const attribute to the array?
>>  + const CU_TestInfo test_array_async[] = {
>>         {ASYNC_INP_ENC_ALG_3DES_CBC, enc_alg_3des_cbc },
>>
>> Thanks,
>> Alex
>>
>
> Alex that will not work. Cunit expects char*. While #define
> ASYNC_INP_ENC_ALG_3DES_CBC    "ENC_ALG_3DES_CBC"
> is const char:
>
> typedef struct CU_TestInfo {
>     char       *pName;      /**< Test name. */
>     CU_TestFunc pTestFunc;  /**< Test function. */
> } CU_TestInfo;
>
> I don't think cunit modifies that name. So it's mostly cunit problem then
> ours. Might be we can disable this warning for that
> particular place.
>
> Maxim.
>
>
>
>> On 14 November 2014 13:42, Maxim Uvarov <maxim.uvarov@linaro.org <mailto:
>> maxim.uvarov@linaro.org>> wrote:
>>
>>     On 11/14/2014 12:49 PM, Alexandru Badicioiu wrote:
>>
>>         Hi,
>>         for build errors - which compiler/toolchain do you use?
>>
>>
>>     Alex, I see the same with:
>>
>>     COLLECT_GCC=gcc
>>     COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.6/lto-wrapper
>>     Target: x86_64-linux-gnu
>>     Configured with: ../src/configure -v
>>     --with-pkgversion='Ubuntu/Linaro 4.6.3-1ubuntu5'
>>     --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs
>>     --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr
>>     --program-suffix=-4.6 --enable-shared --enable-linker-build-id
>>     --with-system-zlib --libexecdir=/usr/lib
>>     --without-included-gettext --enable-threads=posix
>>     --with-gxx-include-dir=/usr/include/c++/4.6 --libdir=/usr/lib
>>     --enable-nls --with-sysroot=/ --enable-clocale=gnu
>>     --enable-libstdcxx-debug --enable-libstdcxx-time=yes
>>     --enable-gnu-unique-object --enable-plugin --enable-objc-gc
>>     --disable-werror --with-arch-32=i686 --with-tune=generic
>>     --enable-checking=release --build=x86_64-linux-gnu
>>     --host=x86_64-linux-gnu --target=x86_64-linux-gnu
>>     Thread model: posix
>>     gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)
>>
>>     gcc -DHAVE_CONFIG_H -I. -pthread -DODP_DEBUG_PRINT=1 -DODP_DEBUG=1
>>     -W -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes
>>     -Wmissing-declarations -Wold-style-definition -Wpointer-arith
>>     -Wcast-align -Wnested-externs -Wcast-qual -Wformat-nonliteral
>>     -Wformat-security -Wundef -Wwrite-strings -I.
>>     -I../../../platform/linux-generic/include/api
>>     -I../../../platform/linux-generic/include/api
>>     -I../../../helper/include -I/include -g -O2 -MT
>>     odp_crypto-odp_crypto_test_async_inp.o -MD -MP -MF
>>     .deps/odp_crypto-odp_crypto_test_async_inp.Tpo -c -o
>>     odp_crypto-odp_crypto_test_async_inp.o `test -f
>>     'odp_crypto_test_async_inp.c' || echo './'`odp_crypto_test_async_
>> inp.c
>>     odp_crypto_test_async_inp.c:363:2: error: initialization discards
>>     'const' qualifier from pointer target type [-Werror]
>>     odp_crypto_test_async_inp.c:364:2: error: initialization discards
>>     'const' qualifier from pointer target type [-Werror]
>>     odp_crypto_test_async_inp.c:365:2: error: initialization discards
>>     'const' qualifier from pointer target type [-Werror]
>>     odp_crypto_test_async_inp.c:366:2: error: initialization discards
>>     'const' qualifier from pointer target type [-Werror]
>>     odp_crypto_test_async_inp.c:367:2: error: initialization discards
>>     'const' qualifier from pointer target type [-Werror]
>>     odp_crypto_test_async_inp.c:368:2: error: initialization discards
>>     'const' qualifier from pointer target type [-Werror]
>>     cc1: all warnings being treated as errors
>>     make: *** [odp_crypto-odp_crypto_test_async_inp.o] Error 1
>>
>>     Maxim.
>>
>>
>>         I did not modify in any way compilation flags and I have no
>>         problem with building with a PPC toolchain and also with the
>>         native gcc on my development machine? I use CUnit-2.1-3.
>>
>>         WARNING: braces {} are not necessary for any arm of this statement
>>         #304: FILE: test/cunit/crypto/odp_crypto_test_async_inp.c:114:
>>         + if (compl_new == ODP_BUFFER_INVALID) {
>>         [...]
>>         + } else {
>>         [...]
>>         If we remove the braces the test will not compile, it seems
>>         the CUnit macros are the problem.
>>         I'll shorten the lines over 80 characters.
>>
>>         Alex
>>
>>
>>         On 14 November 2014 10:23, Anders Roxell
>>         <anders.roxell@linaro.org <mailto:anders.roxell@linaro.org>
>>         <mailto:anders.roxell@linaro.org
>>         <mailto:anders.roxell@linaro.org>>> wrote:
>>
>>             On 2014-11-13 16:14, alexandru.badicioiu@linaro.org
>>         <mailto:alexandru.badicioiu@linaro.org>
>>             <mailto:alexandru.badicioiu@linaro.org
>>         <mailto:alexandru.badicioiu@linaro.org>> wrote:
>>             > From: Alexandru Badicioiu
>>         <alexandru.badicioiu@linaro.org
>>         <mailto:alexandru.badicioiu@linaro.org>
>>             <mailto:alexandru.badicioiu@linaro.org
>>         <mailto:alexandru.badicioiu@linaro.org>>>
>>             >
>>             > This patch adds a suite for sync and async inplace mode of
>>             crypto APIs.
>>             > Correctness of crypto operation output is verified with
>>         known test
>>             > vectors. Various options and functionalities like use
>>         session IV
>>             > or operation IV for ciphering are exercised for both modes.
>>             > For async mode there are options to use input packet
>>         buffer or a
>>             > separate buffer as the completion event and to set and
>>         retrieve the
>>             > context associated with an operation from the completion
>>         event.
>>             >
>>             > Signed-off-by: Alexandru Badicioiu
>>             <alexandru.badicioiu@linaro.org
>>         <mailto:alexandru.badicioiu@linaro.org>
>>             <mailto:alexandru.badicioiu@linaro.org
>>
>>         <mailto:alexandru.badicioiu@linaro.org>>>
>>
>>
>>             I haven't had time to look into this patch will send
>>         feedback later
>>             today.
>>
>>             one thing is it doesn't build:
>>
>>             Making all in crypto
>>             make[3]: Entering directory
>>             '/home/anders/src/check-odp/odp/test/cunit/crypto'
>>             CC odp_crypto-odp_crypto_test_async_inp.o
>>             odp_crypto_test_async_inp.c:364:2: error: initialization
>>         discards
>>             ‘const’ qualifier from pointer target type [-Werror]
>>             {ASYNC_INP_ENC_ALG_3DES_CBC, test_async_enc_alg_3des_cbc },
>>             ^
>>             odp_crypto_test_async_inp.c:365:2: error: initialization
>>         discards
>>             ‘const’ qualifier from pointer target type [-Werror]
>>             {ASYNC_INP_DEC_ALG_3DES_CBC, test_async_dec_alg_3des_cbc },
>>             ^
>>             odp_crypto_test_async_inp.c:366:2: error: initialization
>>         discards
>>             ‘const’ qualifier from pointer target type [-Werror]
>>             {ASYNC_INP_ENC_ALG_3DES_CBC_OVR_IV,
>>             test_async_enc_alg_3des_cbc_ovr_iv },
>>             ^
>>             odp_crypto_test_async_inp.c:367:2: error: initialization
>>         discards
>>             ‘const’ qualifier from pointer target type [-Werror]
>>             {ASYNC_INP_DEC_ALG_3DES_CBC_OVR_IV,
>>             test_async_dec_alg_3des_cbc_ovr_iv },
>>             ^
>>             odp_crypto_test_async_inp.c:368:2: error: initialization
>>         discards
>>             ‘const’ qualifier from pointer target type [-Werror]
>>             {ASYNC_INP_ALG_HMAC_MD5, test_async_alg_hmac_md5 },
>>             ^
>>             odp_crypto_test_async_inp.c:369:2: error: initialization
>>         discards
>>             ‘const’ qualifier from pointer target type [-Werror]
>>             {ASYNC_INP_ENC_ALG_3DES_CBC_COMPL_NEW,
>>             test_async_enc_alg_3des_cbc_compl_new },
>>             ^
>>             cc1: all warnings being treated as errors
>>             Makefile:456: recipe for target
>>             'odp_crypto-odp_crypto_test_async_inp.o' failed
>>             make[3]: *** [odp_crypto-odp_crypto_test_async_inp.o] Error 1
>>             make[3]: Leaving directory
>>             '/home/anders/src/check-odp/odp/test/cunit/crypto'
>>             Makefile:732: recipe for target 'all-recursive' failed
>>             make[2]: *** [all-recursive] Error 1
>>             Makefile:369: recipe for target 'all-recursive' failed
>>             make[1]: *** [all-recursive] Error 1
>>             Makefile:454: recipe for target 'all-recursive' failed
>>             make: *** [all-recursive] Error 1
>>             Making check in crypto
>>
>>             Check patch compliains on this:
>>             WARNING: braces {} are not necessary for any arm of this
>>         statement
>>             #304: FILE: test/cunit/crypto/odp_crypto_
>> test_async_inp.c:114:
>>             + if (compl_new == ODP_BUFFER_INVALID) {
>>             [...]
>>             + } else {
>>             [...]
>>
>>             WARNING: line over 80 characters
>>             #556: FILE: test/cunit/crypto/odp_crypto_
>> test_async_inp.c:366:
>>             + {ASYNC_INP_ENC_ALG_3DES_CBC_OVR_IV,
>>             test_async_enc_alg_3des_cbc_ovr_iv },
>>
>>             WARNING: line over 80 characters
>>             #557: FILE: test/cunit/crypto/odp_crypto_
>> test_async_inp.c:367:
>>             + {ASYNC_INP_DEC_ALG_3DES_CBC_OVR_IV,
>>             test_async_dec_alg_3des_cbc_ovr_iv },
>>
>>             WARNING: line over 80 characters
>>             #559: FILE: test/cunit/crypto/odp_crypto_
>> test_async_inp.c:369:
>>             + {ASYNC_INP_ENC_ALG_3DES_CBC_COMPL_NEW,
>>             test_async_enc_alg_3des_cbc_compl_new },
>>
>>
>>             Cheers,
>>             Anders
>>
>>
>>
>>
>>         _______________________________________________
>>         lng-odp mailing list
>>         lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org>
>>         http://lists.linaro.org/mailman/listinfo/lng-odp
>>
>>
>>
>>     _______________________________________________
>>     lng-odp mailing list
>>     lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org>
>>     http://lists.linaro.org/mailman/listinfo/lng-odp
>>
>>
>>
>
Maxim Uvarov Nov. 14, 2014, 1:08 p.m. | #12
On 11/14/2014 03:48 PM, Alexandru Badicioiu wrote:
> I have no idea what is CUnit-2.1-3 specific stuff. Just download it 
> and build it.
>
> Alex
>

Mine is ubuntu Version: 2.1-0.dfsg-9.

So we need to add to ./configure check that 2.1.-3 is required.

Or you can malloc that names. I think it's better to switch to new 
version if code is fixed in cunit.

Maxim.


> On 14 November 2014 14:35, Anders Roxell <anders.roxell@linaro.org 
> <mailto:anders.roxell@linaro.org>> wrote:
>
>     On 2014-11-14 11:49, Alexandru Badicioiu wrote:
>     > Hi,
>     > for build errors - which compiler/toolchain do you use? I did
>     not modify in
>     > any way compilation flags and I have no problem with building
>     with a PPC
>     > toolchain and also with the native gcc on my development
>     machine? I use
>     > CUnit-2.1-3.
>
>     Hi,
>
>     Ubuntu 14.10:
>     # gcc --version
>     gcc (Ubuntu 4.9.1-16ubuntu6) 4.9.1
>     Copyright (C) 2014 Free Software Foundation, Inc.
>     This is free software; see the source for copying conditions.
>     There is NO
>     warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
>     PURPOSE.
>
>     # dpkg -s libcunit1-dev
>     Package: libcunit1-dev
>     Status: install ok installed
>     Priority: optional
>     Section: libdevel
>     Installed-Size: 285
>     Maintainer: Ubuntu Developers
>     <ubuntu-devel-discuss@lists.ubuntu.com
>     <mailto:ubuntu-devel-discuss@lists.ubuntu.com>>
>     Architecture: amd64
>     Source: cunit
>     Version: 2.1-2.dfsg-1
>     Depends: libcunit1 (= 2.1-2.dfsg-1)
>     Suggests: libcunit1-doc (= 2.1-2.dfsg-1)
>
>     Does *not* build!
>
>
>     Ubuntu 14.04:
>     # gcc --version
>     gcc (Ubuntu 4.8.2-19ubuntu1) 4.8.2
>     Copyright (C) 2013 Free Software Foundation, Inc.
>     This is free software; see the source for copying conditions.
>     There is NO
>     warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
>     PURPOSE.
>
>     # dpkg -s libcunit1-dev
>     Package: libcunit1-dev
>     Status: install ok installed
>     Priority: optional
>     Section: libdevel
>     Installed-Size: 285
>     Maintainer: Ubuntu Developers
>     <ubuntu-devel-discuss@lists.ubuntu.com
>     <mailto:ubuntu-devel-discuss@lists.ubuntu.com>>
>     Architecture: amd64
>     Source: cunit
>     Version: 2.1-2.dfsg-1
>     Depends: libcunit1 (= 2.1-2.dfsg-1)
>     Suggests: libcunit1-doc (= 2.1-2.dfsg-1)
>
>     Does *not* build!
>
>
>     Builds:
>     cross compiling with linaro toolchain release 14.09 + CUnit
>     version 2.1-3
>
>     Do you use some 2.1-3 specific CUnit stuff?
>
>     Cheers,
>     Anders
>
>
>     >
>     > WARNING: braces {} are not necessary for any arm of this statement
>     > #304: FILE: test/cunit/crypto/odp_crypto_test_async_inp.c:114:
>     > + if (compl_new == ODP_BUFFER_INVALID) {
>     > [...]
>     > + } else {
>     > [...]
>     > If we remove the braces the test will not compile, it seems the
>     CUnit
>     > macros are the problem.
>     > I'll shorten the lines over 80 characters.
>     >
>     > Alex
>     >
>     >
>     > On 14 November 2014 10:23, Anders Roxell
>     <anders.roxell@linaro.org <mailto:anders.roxell@linaro.org>> wrote:
>     >
>     > > On 2014-11-13 16:14, alexandru.badicioiu@linaro.org
>     <mailto:alexandru.badicioiu@linaro.org> wrote:
>     > > > From: Alexandru Badicioiu <alexandru.badicioiu@linaro.org
>     <mailto:alexandru.badicioiu@linaro.org>>
>     > > >
>     > > > This patch adds a suite for sync and async inplace mode of
>     crypto APIs.
>     > > > Correctness of crypto operation output is verified with
>     known test
>     > > > vectors. Various options and functionalities like use session IV
>     > > > or operation IV for ciphering are exercised for both modes.
>     > > > For async mode there are options to use input packet buffer or a
>     > > > separate buffer as the completion event and to set and
>     retrieve the
>     > > > context associated with an operation from the completion event.
>     > > >
>     > > > Signed-off-by: Alexandru Badicioiu
>     <alexandru.badicioiu@linaro.org
>     <mailto:alexandru.badicioiu@linaro.org>>
>     > >
>     > > I haven't had time to look into this patch will send feedback
>     later
>     > > today.
>     > >
>     > > one thing is it doesn't build:
>     > >
>     > > Making all in crypto
>     > > make[3]: Entering directory
>     > > '/home/anders/src/check-odp/odp/test/cunit/crypto'
>     > > CC odp_crypto-odp_crypto_test_async_inp.o
>     > > odp_crypto_test_async_inp.c:364:2: error: initialization
>     discards ‘const’
>     > > qualifier from pointer target type [-Werror]
>     > > {ASYNC_INP_ENC_ALG_3DES_CBC, test_async_enc_alg_3des_cbc },
>     > > ^
>     > > odp_crypto_test_async_inp.c:365:2: error: initialization
>     discards ‘const’
>     > > qualifier from pointer target type [-Werror]
>     > > {ASYNC_INP_DEC_ALG_3DES_CBC, test_async_dec_alg_3des_cbc },
>     > > ^
>     > > odp_crypto_test_async_inp.c:366:2: error: initialization
>     discards ‘const’
>     > > qualifier from pointer target type [-Werror]
>     > > {ASYNC_INP_ENC_ALG_3DES_CBC_OVR_IV,
>     test_async_enc_alg_3des_cbc_ovr_iv },
>     > > ^
>     > > odp_crypto_test_async_inp.c:367:2: error: initialization
>     discards ‘const’
>     > > qualifier from pointer target type [-Werror]
>     > > {ASYNC_INP_DEC_ALG_3DES_CBC_OVR_IV,
>     test_async_dec_alg_3des_cbc_ovr_iv },
>     > > ^
>     > > odp_crypto_test_async_inp.c:368:2: error: initialization
>     discards ‘const’
>     > > qualifier from pointer target type [-Werror]
>     > > {ASYNC_INP_ALG_HMAC_MD5, test_async_alg_hmac_md5 },
>     > > ^
>     > > odp_crypto_test_async_inp.c:369:2: error: initialization
>     discards ‘const’
>     > > qualifier from pointer target type [-Werror]
>     > > {ASYNC_INP_ENC_ALG_3DES_CBC_COMPL_NEW,
>     > > test_async_enc_alg_3des_cbc_compl_new },
>     > > ^
>     > > cc1: all warnings being treated as errors
>     > > Makefile:456: recipe for target
>     'odp_crypto-odp_crypto_test_async_inp.o'
>     > > failed
>     > > make[3]: *** [odp_crypto-odp_crypto_test_async_inp.o] Error 1
>     > > make[3]: Leaving directory
>     > > '/home/anders/src/check-odp/odp/test/cunit/crypto'
>     > > Makefile:732: recipe for target 'all-recursive' failed
>     > > make[2]: *** [all-recursive] Error 1
>     > > Makefile:369: recipe for target 'all-recursive' failed
>     > > make[1]: *** [all-recursive] Error 1
>     > > Makefile:454: recipe for target 'all-recursive' failed
>     > > make: *** [all-recursive] Error 1
>     > > Making check in crypto
>     > >
>     > > Check patch compliains on this:
>     > > WARNING: braces {} are not necessary for any arm of this statement
>     > > #304: FILE: test/cunit/crypto/odp_crypto_test_async_inp.c:114:
>     > > + if (compl_new == ODP_BUFFER_INVALID) {
>     > > [...]
>     > > + } else {
>     > > [...]
>     > >
>     > > WARNING: line over 80 characters
>     > > #556: FILE: test/cunit/crypto/odp_crypto_test_async_inp.c:366:
>     > > + {ASYNC_INP_ENC_ALG_3DES_CBC_OVR_IV,
>     > > test_async_enc_alg_3des_cbc_ovr_iv },
>     > >
>     > > WARNING: line over 80 characters
>     > > #557: FILE: test/cunit/crypto/odp_crypto_test_async_inp.c:367:
>     > > + {ASYNC_INP_DEC_ALG_3DES_CBC_OVR_IV,
>     > > test_async_dec_alg_3des_cbc_ovr_iv },
>     > >
>     > > WARNING: line over 80 characters
>     > > #559: FILE: test/cunit/crypto/odp_crypto_test_async_inp.c:369:
>     > > + {ASYNC_INP_ENC_ALG_3DES_CBC_COMPL_NEW,
>     > > test_async_enc_alg_3des_cbc_compl_new },
>     > >
>     > >
>     > > Cheers,
>     > > Anders
>     > >
>
>     --
>     Anders Roxell
>     anders.roxell@linaro.org <mailto:anders.roxell@linaro.org>
>     M: +46 709 71 42 85 <tel:%2B46%20709%2071%2042%2085> | IRC: roxell
>
>
>
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/lng-odp
Alexandru Badicioiu Nov. 14, 2014, 1:16 p.m. | #13
I was told that the CUnit version is 2.1-3, this is why I have used it.

Alex

On 14 November 2014 15:08, Maxim Uvarov <maxim.uvarov@linaro.org> wrote:

> On 11/14/2014 03:48 PM, Alexandru Badicioiu wrote:
>
>> I have no idea what is CUnit-2.1-3 specific stuff. Just download it and
>> build it.
>>
>> Alex
>>
>>
> Mine is ubuntu Version: 2.1-0.dfsg-9.
>
> So we need to add to ./configure check that 2.1.-3 is required.
>
> Or you can malloc that names. I think it's better to switch to new version
> if code is fixed in cunit.
>
> Maxim.
>
>
>  On 14 November 2014 14:35, Anders Roxell <anders.roxell@linaro.org
>> <mailto:anders.roxell@linaro.org>> wrote:
>>
>>     On 2014-11-14 11:49, Alexandru Badicioiu wrote:
>>     > Hi,
>>     > for build errors - which compiler/toolchain do you use? I did
>>     not modify in
>>     > any way compilation flags and I have no problem with building
>>     with a PPC
>>     > toolchain and also with the native gcc on my development
>>     machine? I use
>>     > CUnit-2.1-3.
>>
>>     Hi,
>>
>>     Ubuntu 14.10:
>>     # gcc --version
>>     gcc (Ubuntu 4.9.1-16ubuntu6) 4.9.1
>>     Copyright (C) 2014 Free Software Foundation, Inc.
>>     This is free software; see the source for copying conditions.
>>     There is NO
>>     warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
>>     PURPOSE.
>>
>>     # dpkg -s libcunit1-dev
>>     Package: libcunit1-dev
>>     Status: install ok installed
>>     Priority: optional
>>     Section: libdevel
>>     Installed-Size: 285
>>     Maintainer: Ubuntu Developers
>>     <ubuntu-devel-discuss@lists.ubuntu.com
>>     <mailto:ubuntu-devel-discuss@lists.ubuntu.com>>
>>     Architecture: amd64
>>     Source: cunit
>>     Version: 2.1-2.dfsg-1
>>     Depends: libcunit1 (= 2.1-2.dfsg-1)
>>     Suggests: libcunit1-doc (= 2.1-2.dfsg-1)
>>
>>     Does *not* build!
>>
>>
>>     Ubuntu 14.04:
>>     # gcc --version
>>     gcc (Ubuntu 4.8.2-19ubuntu1) 4.8.2
>>     Copyright (C) 2013 Free Software Foundation, Inc.
>>     This is free software; see the source for copying conditions.
>>     There is NO
>>     warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
>>     PURPOSE.
>>
>>     # dpkg -s libcunit1-dev
>>     Package: libcunit1-dev
>>     Status: install ok installed
>>     Priority: optional
>>     Section: libdevel
>>     Installed-Size: 285
>>     Maintainer: Ubuntu Developers
>>     <ubuntu-devel-discuss@lists.ubuntu.com
>>     <mailto:ubuntu-devel-discuss@lists.ubuntu.com>>
>>     Architecture: amd64
>>     Source: cunit
>>     Version: 2.1-2.dfsg-1
>>     Depends: libcunit1 (= 2.1-2.dfsg-1)
>>     Suggests: libcunit1-doc (= 2.1-2.dfsg-1)
>>
>>     Does *not* build!
>>
>>
>>     Builds:
>>     cross compiling with linaro toolchain release 14.09 + CUnit
>>     version 2.1-3
>>
>>     Do you use some 2.1-3 specific CUnit stuff?
>>
>>     Cheers,
>>     Anders
>>
>>
>>     >
>>     > WARNING: braces {} are not necessary for any arm of this statement
>>     > #304: FILE: test/cunit/crypto/odp_crypto_test_async_inp.c:114:
>>     > + if (compl_new == ODP_BUFFER_INVALID) {
>>     > [...]
>>     > + } else {
>>     > [...]
>>     > If we remove the braces the test will not compile, it seems the
>>     CUnit
>>     > macros are the problem.
>>     > I'll shorten the lines over 80 characters.
>>     >
>>     > Alex
>>     >
>>     >
>>     > On 14 November 2014 10:23, Anders Roxell
>>     <anders.roxell@linaro.org <mailto:anders.roxell@linaro.org>> wrote:
>>     >
>>     > > On 2014-11-13 16:14, alexandru.badicioiu@linaro.org
>>     <mailto:alexandru.badicioiu@linaro.org> wrote:
>>     > > > From: Alexandru Badicioiu <alexandru.badicioiu@linaro.org
>>     <mailto:alexandru.badicioiu@linaro.org>>
>>     > > >
>>     > > > This patch adds a suite for sync and async inplace mode of
>>     crypto APIs.
>>     > > > Correctness of crypto operation output is verified with
>>     known test
>>     > > > vectors. Various options and functionalities like use session IV
>>     > > > or operation IV for ciphering are exercised for both modes.
>>     > > > For async mode there are options to use input packet buffer or a
>>     > > > separate buffer as the completion event and to set and
>>     retrieve the
>>     > > > context associated with an operation from the completion event.
>>     > > >
>>     > > > Signed-off-by: Alexandru Badicioiu
>>     <alexandru.badicioiu@linaro.org
>>     <mailto:alexandru.badicioiu@linaro.org>>
>>
>>     > >
>>     > > I haven't had time to look into this patch will send feedback
>>     later
>>     > > today.
>>     > >
>>     > > one thing is it doesn't build:
>>     > >
>>     > > Making all in crypto
>>     > > make[3]: Entering directory
>>     > > '/home/anders/src/check-odp/odp/test/cunit/crypto'
>>     > > CC odp_crypto-odp_crypto_test_async_inp.o
>>     > > odp_crypto_test_async_inp.c:364:2: error: initialization
>>     discards ‘const’
>>     > > qualifier from pointer target type [-Werror]
>>     > > {ASYNC_INP_ENC_ALG_3DES_CBC, test_async_enc_alg_3des_cbc },
>>     > > ^
>>     > > odp_crypto_test_async_inp.c:365:2: error: initialization
>>     discards ‘const’
>>     > > qualifier from pointer target type [-Werror]
>>     > > {ASYNC_INP_DEC_ALG_3DES_CBC, test_async_dec_alg_3des_cbc },
>>     > > ^
>>     > > odp_crypto_test_async_inp.c:366:2: error: initialization
>>     discards ‘const’
>>     > > qualifier from pointer target type [-Werror]
>>     > > {ASYNC_INP_ENC_ALG_3DES_CBC_OVR_IV,
>>     test_async_enc_alg_3des_cbc_ovr_iv },
>>     > > ^
>>     > > odp_crypto_test_async_inp.c:367:2: error: initialization
>>     discards ‘const’
>>     > > qualifier from pointer target type [-Werror]
>>     > > {ASYNC_INP_DEC_ALG_3DES_CBC_OVR_IV,
>>     test_async_dec_alg_3des_cbc_ovr_iv },
>>     > > ^
>>     > > odp_crypto_test_async_inp.c:368:2: error: initialization
>>     discards ‘const’
>>     > > qualifier from pointer target type [-Werror]
>>     > > {ASYNC_INP_ALG_HMAC_MD5, test_async_alg_hmac_md5 },
>>     > > ^
>>     > > odp_crypto_test_async_inp.c:369:2: error: initialization
>>     discards ‘const’
>>     > > qualifier from pointer target type [-Werror]
>>     > > {ASYNC_INP_ENC_ALG_3DES_CBC_COMPL_NEW,
>>     > > test_async_enc_alg_3des_cbc_compl_new },
>>     > > ^
>>     > > cc1: all warnings being treated as errors
>>     > > Makefile:456: recipe for target
>>     'odp_crypto-odp_crypto_test_async_inp.o'
>>     > > failed
>>     > > make[3]: *** [odp_crypto-odp_crypto_test_async_inp.o] Error 1
>>     > > make[3]: Leaving directory
>>     > > '/home/anders/src/check-odp/odp/test/cunit/crypto'
>>     > > Makefile:732: recipe for target 'all-recursive' failed
>>     > > make[2]: *** [all-recursive] Error 1
>>     > > Makefile:369: recipe for target 'all-recursive' failed
>>     > > make[1]: *** [all-recursive] Error 1
>>     > > Makefile:454: recipe for target 'all-recursive' failed
>>     > > make: *** [all-recursive] Error 1
>>     > > Making check in crypto
>>     > >
>>     > > Check patch compliains on this:
>>     > > WARNING: braces {} are not necessary for any arm of this statement
>>     > > #304: FILE: test/cunit/crypto/odp_crypto_test_async_inp.c:114:
>>     > > + if (compl_new == ODP_BUFFER_INVALID) {
>>     > > [...]
>>     > > + } else {
>>     > > [...]
>>     > >
>>     > > WARNING: line over 80 characters
>>     > > #556: FILE: test/cunit/crypto/odp_crypto_test_async_inp.c:366:
>>     > > + {ASYNC_INP_ENC_ALG_3DES_CBC_OVR_IV,
>>     > > test_async_enc_alg_3des_cbc_ovr_iv },
>>     > >
>>     > > WARNING: line over 80 characters
>>     > > #557: FILE: test/cunit/crypto/odp_crypto_test_async_inp.c:367:
>>     > > + {ASYNC_INP_DEC_ALG_3DES_CBC_OVR_IV,
>>     > > test_async_dec_alg_3des_cbc_ovr_iv },
>>     > >
>>     > > WARNING: line over 80 characters
>>     > > #559: FILE: test/cunit/crypto/odp_crypto_test_async_inp.c:369:
>>     > > + {ASYNC_INP_ENC_ALG_3DES_CBC_COMPL_NEW,
>>     > > test_async_enc_alg_3des_cbc_compl_new },
>>     > >
>>     > >
>>     > > Cheers,
>>     > > Anders
>>     > >
>>
>>     --
>>     Anders Roxell
>>     anders.roxell@linaro.org <mailto:anders.roxell@linaro.org>
>>     M: +46 709 71 42 85 <tel:%2B46%20709%2071%2042%2085> | IRC: roxell
>>
>>
>>
>>
>> _______________________________________________
>> lng-odp mailing list
>> lng-odp@lists.linaro.org
>> http://lists.linaro.org/mailman/listinfo/lng-odp
>>
>
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/lng-odp
>
Anders Roxell Nov. 14, 2014, 6:21 p.m. | #14
On 2014-11-14 15:16, Alexandru Badicioiu wrote:
> I was told that the CUnit version is 2.1-3, this is why I have used it.

CI is on Ubuntu 14.04, and that uses CUnit 2.1-2, so it has to work
agains that version.

If it doesn't pass CI it should be fixed.

Cheers,
Anders

> 
> Alex
> 
> On 14 November 2014 15:08, Maxim Uvarov <maxim.uvarov@linaro.org> wrote:
> 
> > On 11/14/2014 03:48 PM, Alexandru Badicioiu wrote:
> >
> >> I have no idea what is CUnit-2.1-3 specific stuff. Just download it and
> >> build it.
> >>
> >> Alex
> >>
> >>
> > Mine is ubuntu Version: 2.1-0.dfsg-9.
> >
> > So we need to add to ./configure check that 2.1.-3 is required.
> >
> > Or you can malloc that names. I think it's better to switch to new version
> > if code is fixed in cunit.
> >
> > Maxim.
> >
> >
> >  On 14 November 2014 14:35, Anders Roxell <anders.roxell@linaro.org
> >> <mailto:anders.roxell@linaro.org>> wrote:
> >>
> >>     On 2014-11-14 11:49, Alexandru Badicioiu wrote:
> >>     > Hi,
> >>     > for build errors - which compiler/toolchain do you use? I did
> >>     not modify in
> >>     > any way compilation flags and I have no problem with building
> >>     with a PPC
> >>     > toolchain and also with the native gcc on my development
> >>     machine? I use
> >>     > CUnit-2.1-3.
> >>
> >>     Hi,
> >>
> >>     Ubuntu 14.10:
> >>     # gcc --version
> >>     gcc (Ubuntu 4.9.1-16ubuntu6) 4.9.1
> >>     Copyright (C) 2014 Free Software Foundation, Inc.
> >>     This is free software; see the source for copying conditions.
> >>     There is NO
> >>     warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
> >>     PURPOSE.
> >>
> >>     # dpkg -s libcunit1-dev
> >>     Package: libcunit1-dev
> >>     Status: install ok installed
> >>     Priority: optional
> >>     Section: libdevel
> >>     Installed-Size: 285
> >>     Maintainer: Ubuntu Developers
> >>     <ubuntu-devel-discuss@lists.ubuntu.com
> >>     <mailto:ubuntu-devel-discuss@lists.ubuntu.com>>
> >>     Architecture: amd64
> >>     Source: cunit
> >>     Version: 2.1-2.dfsg-1
> >>     Depends: libcunit1 (= 2.1-2.dfsg-1)
> >>     Suggests: libcunit1-doc (= 2.1-2.dfsg-1)
> >>
> >>     Does *not* build!
> >>
> >>
> >>     Ubuntu 14.04:
> >>     # gcc --version
> >>     gcc (Ubuntu 4.8.2-19ubuntu1) 4.8.2
> >>     Copyright (C) 2013 Free Software Foundation, Inc.
> >>     This is free software; see the source for copying conditions.
> >>     There is NO
> >>     warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
> >>     PURPOSE.
> >>
> >>     # dpkg -s libcunit1-dev
> >>     Package: libcunit1-dev
> >>     Status: install ok installed
> >>     Priority: optional
> >>     Section: libdevel
> >>     Installed-Size: 285
> >>     Maintainer: Ubuntu Developers
> >>     <ubuntu-devel-discuss@lists.ubuntu.com
> >>     <mailto:ubuntu-devel-discuss@lists.ubuntu.com>>
> >>     Architecture: amd64
> >>     Source: cunit
> >>     Version: 2.1-2.dfsg-1
> >>     Depends: libcunit1 (= 2.1-2.dfsg-1)
> >>     Suggests: libcunit1-doc (= 2.1-2.dfsg-1)
> >>
> >>     Does *not* build!
> >>
> >>
> >>     Builds:
> >>     cross compiling with linaro toolchain release 14.09 + CUnit
> >>     version 2.1-3
> >>
> >>     Do you use some 2.1-3 specific CUnit stuff?
> >>
> >>     Cheers,
> >>     Anders
> >>
> >>
> >>     >
> >>     > WARNING: braces {} are not necessary for any arm of this statement
> >>     > #304: FILE: test/cunit/crypto/odp_crypto_test_async_inp.c:114:
> >>     > + if (compl_new == ODP_BUFFER_INVALID) {
> >>     > [...]
> >>     > + } else {
> >>     > [...]
> >>     > If we remove the braces the test will not compile, it seems the
> >>     CUnit
> >>     > macros are the problem.
> >>     > I'll shorten the lines over 80 characters.
> >>     >
> >>     > Alex
> >>     >
> >>     >
> >>     > On 14 November 2014 10:23, Anders Roxell
> >>     <anders.roxell@linaro.org <mailto:anders.roxell@linaro.org>> wrote:
> >>     >
> >>     > > On 2014-11-13 16:14, alexandru.badicioiu@linaro.org
> >>     <mailto:alexandru.badicioiu@linaro.org> wrote:
> >>     > > > From: Alexandru Badicioiu <alexandru.badicioiu@linaro.org
> >>     <mailto:alexandru.badicioiu@linaro.org>>
> >>     > > >
> >>     > > > This patch adds a suite for sync and async inplace mode of
> >>     crypto APIs.
> >>     > > > Correctness of crypto operation output is verified with
> >>     known test
> >>     > > > vectors. Various options and functionalities like use session IV
> >>     > > > or operation IV for ciphering are exercised for both modes.
> >>     > > > For async mode there are options to use input packet buffer or a
> >>     > > > separate buffer as the completion event and to set and
> >>     retrieve the
> >>     > > > context associated with an operation from the completion event.
> >>     > > >
> >>     > > > Signed-off-by: Alexandru Badicioiu
> >>     <alexandru.badicioiu@linaro.org
> >>     <mailto:alexandru.badicioiu@linaro.org>>
> >>
> >>     > >
> >>     > > I haven't had time to look into this patch will send feedback
> >>     later
> >>     > > today.
> >>     > >
> >>     > > one thing is it doesn't build:
> >>     > >
> >>     > > Making all in crypto
> >>     > > make[3]: Entering directory
> >>     > > '/home/anders/src/check-odp/odp/test/cunit/crypto'
> >>     > > CC odp_crypto-odp_crypto_test_async_inp.o
> >>     > > odp_crypto_test_async_inp.c:364:2: error: initialization
> >>     discards ‘const’
> >>     > > qualifier from pointer target type [-Werror]
> >>     > > {ASYNC_INP_ENC_ALG_3DES_CBC, test_async_enc_alg_3des_cbc },
> >>     > > ^
> >>     > > odp_crypto_test_async_inp.c:365:2: error: initialization
> >>     discards ‘const’
> >>     > > qualifier from pointer target type [-Werror]
> >>     > > {ASYNC_INP_DEC_ALG_3DES_CBC, test_async_dec_alg_3des_cbc },
> >>     > > ^
> >>     > > odp_crypto_test_async_inp.c:366:2: error: initialization
> >>     discards ‘const’
> >>     > > qualifier from pointer target type [-Werror]
> >>     > > {ASYNC_INP_ENC_ALG_3DES_CBC_OVR_IV,
> >>     test_async_enc_alg_3des_cbc_ovr_iv },
> >>     > > ^
> >>     > > odp_crypto_test_async_inp.c:367:2: error: initialization
> >>     discards ‘const’
> >>     > > qualifier from pointer target type [-Werror]
> >>     > > {ASYNC_INP_DEC_ALG_3DES_CBC_OVR_IV,
> >>     test_async_dec_alg_3des_cbc_ovr_iv },
> >>     > > ^
> >>     > > odp_crypto_test_async_inp.c:368:2: error: initialization
> >>     discards ‘const’
> >>     > > qualifier from pointer target type [-Werror]
> >>     > > {ASYNC_INP_ALG_HMAC_MD5, test_async_alg_hmac_md5 },
> >>     > > ^
> >>     > > odp_crypto_test_async_inp.c:369:2: error: initialization
> >>     discards ‘const’
> >>     > > qualifier from pointer target type [-Werror]
> >>     > > {ASYNC_INP_ENC_ALG_3DES_CBC_COMPL_NEW,
> >>     > > test_async_enc_alg_3des_cbc_compl_new },
> >>     > > ^
> >>     > > cc1: all warnings being treated as errors
> >>     > > Makefile:456: recipe for target
> >>     'odp_crypto-odp_crypto_test_async_inp.o'
> >>     > > failed
> >>     > > make[3]: *** [odp_crypto-odp_crypto_test_async_inp.o] Error 1
> >>     > > make[3]: Leaving directory
> >>     > > '/home/anders/src/check-odp/odp/test/cunit/crypto'
> >>     > > Makefile:732: recipe for target 'all-recursive' failed
> >>     > > make[2]: *** [all-recursive] Error 1
> >>     > > Makefile:369: recipe for target 'all-recursive' failed
> >>     > > make[1]: *** [all-recursive] Error 1
> >>     > > Makefile:454: recipe for target 'all-recursive' failed
> >>     > > make: *** [all-recursive] Error 1
> >>     > > Making check in crypto
> >>     > >
> >>     > > Check patch compliains on this:
> >>     > > WARNING: braces {} are not necessary for any arm of this statement
> >>     > > #304: FILE: test/cunit/crypto/odp_crypto_test_async_inp.c:114:
> >>     > > + if (compl_new == ODP_BUFFER_INVALID) {
> >>     > > [...]
> >>     > > + } else {
> >>     > > [...]
> >>     > >
> >>     > > WARNING: line over 80 characters
> >>     > > #556: FILE: test/cunit/crypto/odp_crypto_test_async_inp.c:366:
> >>     > > + {ASYNC_INP_ENC_ALG_3DES_CBC_OVR_IV,
> >>     > > test_async_enc_alg_3des_cbc_ovr_iv },
> >>     > >
> >>     > > WARNING: line over 80 characters
> >>     > > #557: FILE: test/cunit/crypto/odp_crypto_test_async_inp.c:367:
> >>     > > + {ASYNC_INP_DEC_ALG_3DES_CBC_OVR_IV,
> >>     > > test_async_dec_alg_3des_cbc_ovr_iv },
> >>     > >
> >>     > > WARNING: line over 80 characters
> >>     > > #559: FILE: test/cunit/crypto/odp_crypto_test_async_inp.c:369:
> >>     > > + {ASYNC_INP_ENC_ALG_3DES_CBC_COMPL_NEW,
> >>     > > test_async_enc_alg_3des_cbc_compl_new },
> >>     > >
> >>     > >
> >>     > > Cheers,
> >>     > > Anders
> >>     > >
> >>
> >>     --
> >>     Anders Roxell
> >>     anders.roxell@linaro.org <mailto:anders.roxell@linaro.org>
> >>     M: +46 709 71 42 85 <tel:%2B46%20709%2071%2042%2085> | IRC: roxell
> >>
> >>
> >>
> >>
> >> _______________________________________________
> >> lng-odp mailing list
> >> lng-odp@lists.linaro.org
> >> http://lists.linaro.org/mailman/listinfo/lng-odp
> >>
> >
> >
> > _______________________________________________
> > lng-odp mailing list
> > lng-odp@lists.linaro.org
> > http://lists.linaro.org/mailman/listinfo/lng-odp
> >

> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/lng-odp
Mike Holmes Nov. 14, 2014, 6:29 p.m. | #15
On 14 November 2014 13:21, Anders Roxell <anders.roxell@linaro.org> wrote:

> On 2014-11-14 15:16, Alexandru Badicioiu wrote:
> > I was told that the CUnit version is 2.1-3, this is why I have used it.
>
> CI is on Ubuntu 14.04, and that uses CUnit 2.1-2, so it has to work
> agains that version.
>
> If it doesn't pass CI it should be fixed.
>

There are many distros, and many versions of cunit. The only rational thing
is to have the impartial CI suite version be the ultimate authority on what
is ok when the results differ.

I think we have probably been lax by not specifying the versions CI uses
more clearly, we can fix that too.

CI is 2.1-2 we should stick with that.

Mike



> Cheers,
> Anders
>
> >
> > Alex
> >
> > On 14 November 2014 15:08, Maxim Uvarov <maxim.uvarov@linaro.org> wrote:
> >
> > > On 11/14/2014 03:48 PM, Alexandru Badicioiu wrote:
> > >
> > >> I have no idea what is CUnit-2.1-3 specific stuff. Just download it
> and
> > >> build it.
> > >>
> > >> Alex
> > >>
> > >>
> > > Mine is ubuntu Version: 2.1-0.dfsg-9.
> > >
> > > So we need to add to ./configure check that 2.1.-3 is required.
> > >
> > > Or you can malloc that names. I think it's better to switch to new
> version
> > > if code is fixed in cunit.
> > >
> > > Maxim.
> > >
> > >
> > >  On 14 November 2014 14:35, Anders Roxell <anders.roxell@linaro.org
> > >> <mailto:anders.roxell@linaro.org>> wrote:
> > >>
> > >>     On 2014-11-14 11:49, Alexandru Badicioiu wrote:
> > >>     > Hi,
> > >>     > for build errors - which compiler/toolchain do you use? I did
> > >>     not modify in
> > >>     > any way compilation flags and I have no problem with building
> > >>     with a PPC
> > >>     > toolchain and also with the native gcc on my development
> > >>     machine? I use
> > >>     > CUnit-2.1-3.
> > >>
> > >>     Hi,
> > >>
> > >>     Ubuntu 14.10:
> > >>     # gcc --version
> > >>     gcc (Ubuntu 4.9.1-16ubuntu6) 4.9.1
> > >>     Copyright (C) 2014 Free Software Foundation, Inc.
> > >>     This is free software; see the source for copying conditions.
> > >>     There is NO
> > >>     warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
> > >>     PURPOSE.
> > >>
> > >>     # dpkg -s libcunit1-dev
> > >>     Package: libcunit1-dev
> > >>     Status: install ok installed
> > >>     Priority: optional
> > >>     Section: libdevel
> > >>     Installed-Size: 285
> > >>     Maintainer: Ubuntu Developers
> > >>     <ubuntu-devel-discuss@lists.ubuntu.com
> > >>     <mailto:ubuntu-devel-discuss@lists.ubuntu.com>>
> > >>     Architecture: amd64
> > >>     Source: cunit
> > >>     Version: 2.1-2.dfsg-1
> > >>     Depends: libcunit1 (= 2.1-2.dfsg-1)
> > >>     Suggests: libcunit1-doc (= 2.1-2.dfsg-1)
> > >>
> > >>     Does *not* build!
> > >>
> > >>
> > >>     Ubuntu 14.04:
> > >>     # gcc --version
> > >>     gcc (Ubuntu 4.8.2-19ubuntu1) 4.8.2
> > >>     Copyright (C) 2013 Free Software Foundation, Inc.
> > >>     This is free software; see the source for copying conditions.
> > >>     There is NO
> > >>     warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
> > >>     PURPOSE.
> > >>
> > >>     # dpkg -s libcunit1-dev
> > >>     Package: libcunit1-dev
> > >>     Status: install ok installed
> > >>     Priority: optional
> > >>     Section: libdevel
> > >>     Installed-Size: 285
> > >>     Maintainer: Ubuntu Developers
> > >>     <ubuntu-devel-discuss@lists.ubuntu.com
> > >>     <mailto:ubuntu-devel-discuss@lists.ubuntu.com>>
> > >>     Architecture: amd64
> > >>     Source: cunit
> > >>     Version: 2.1-2.dfsg-1
> > >>     Depends: libcunit1 (= 2.1-2.dfsg-1)
> > >>     Suggests: libcunit1-doc (= 2.1-2.dfsg-1)
> > >>
> > >>     Does *not* build!
> > >>
> > >>
> > >>     Builds:
> > >>     cross compiling with linaro toolchain release 14.09 + CUnit
> > >>     version 2.1-3
> > >>
> > >>     Do you use some 2.1-3 specific CUnit stuff?
> > >>
> > >>     Cheers,
> > >>     Anders
> > >>
> > >>
> > >>     >
> > >>     > WARNING: braces {} are not necessary for any arm of this
> statement
> > >>     > #304: FILE: test/cunit/crypto/odp_crypto_test_async_inp.c:114:
> > >>     > + if (compl_new == ODP_BUFFER_INVALID) {
> > >>     > [...]
> > >>     > + } else {
> > >>     > [...]
> > >>     > If we remove the braces the test will not compile, it seems the
> > >>     CUnit
> > >>     > macros are the problem.
> > >>     > I'll shorten the lines over 80 characters.
> > >>     >
> > >>     > Alex
> > >>     >
> > >>     >
> > >>     > On 14 November 2014 10:23, Anders Roxell
> > >>     <anders.roxell@linaro.org <mailto:anders.roxell@linaro.org>>
> wrote:
> > >>     >
> > >>     > > On 2014-11-13 16:14, alexandru.badicioiu@linaro.org
> > >>     <mailto:alexandru.badicioiu@linaro.org> wrote:
> > >>     > > > From: Alexandru Badicioiu <alexandru.badicioiu@linaro.org
> > >>     <mailto:alexandru.badicioiu@linaro.org>>
> > >>     > > >
> > >>     > > > This patch adds a suite for sync and async inplace mode of
> > >>     crypto APIs.
> > >>     > > > Correctness of crypto operation output is verified with
> > >>     known test
> > >>     > > > vectors. Various options and functionalities like use
> session IV
> > >>     > > > or operation IV for ciphering are exercised for both modes.
> > >>     > > > For async mode there are options to use input packet buffer
> or a
> > >>     > > > separate buffer as the completion event and to set and
> > >>     retrieve the
> > >>     > > > context associated with an operation from the completion
> event.
> > >>     > > >
> > >>     > > > Signed-off-by: Alexandru Badicioiu
> > >>     <alexandru.badicioiu@linaro.org
> > >>     <mailto:alexandru.badicioiu@linaro.org>>
> > >>
> > >>     > >
> > >>     > > I haven't had time to look into this patch will send feedback
> > >>     later
> > >>     > > today.
> > >>     > >
> > >>     > > one thing is it doesn't build:
> > >>     > >
> > >>     > > Making all in crypto
> > >>     > > make[3]: Entering directory
> > >>     > > '/home/anders/src/check-odp/odp/test/cunit/crypto'
> > >>     > > CC odp_crypto-odp_crypto_test_async_inp.o
> > >>     > > odp_crypto_test_async_inp.c:364:2: error: initialization
> > >>     discards ‘const’
> > >>     > > qualifier from pointer target type [-Werror]
> > >>     > > {ASYNC_INP_ENC_ALG_3DES_CBC, test_async_enc_alg_3des_cbc },
> > >>     > > ^
> > >>     > > odp_crypto_test_async_inp.c:365:2: error: initialization
> > >>     discards ‘const’
> > >>     > > qualifier from pointer target type [-Werror]
> > >>     > > {ASYNC_INP_DEC_ALG_3DES_CBC, test_async_dec_alg_3des_cbc },
> > >>     > > ^
> > >>     > > odp_crypto_test_async_inp.c:366:2: error: initialization
> > >>     discards ‘const’
> > >>     > > qualifier from pointer target type [-Werror]
> > >>     > > {ASYNC_INP_ENC_ALG_3DES_CBC_OVR_IV,
> > >>     test_async_enc_alg_3des_cbc_ovr_iv },
> > >>     > > ^
> > >>     > > odp_crypto_test_async_inp.c:367:2: error: initialization
> > >>     discards ‘const’
> > >>     > > qualifier from pointer target type [-Werror]
> > >>     > > {ASYNC_INP_DEC_ALG_3DES_CBC_OVR_IV,
> > >>     test_async_dec_alg_3des_cbc_ovr_iv },
> > >>     > > ^
> > >>     > > odp_crypto_test_async_inp.c:368:2: error: initialization
> > >>     discards ‘const’
> > >>     > > qualifier from pointer target type [-Werror]
> > >>     > > {ASYNC_INP_ALG_HMAC_MD5, test_async_alg_hmac_md5 },
> > >>     > > ^
> > >>     > > odp_crypto_test_async_inp.c:369:2: error: initialization
> > >>     discards ‘const’
> > >>     > > qualifier from pointer target type [-Werror]
> > >>     > > {ASYNC_INP_ENC_ALG_3DES_CBC_COMPL_NEW,
> > >>     > > test_async_enc_alg_3des_cbc_compl_new },
> > >>     > > ^
> > >>     > > cc1: all warnings being treated as errors
> > >>     > > Makefile:456: recipe for target
> > >>     'odp_crypto-odp_crypto_test_async_inp.o'
> > >>     > > failed
> > >>     > > make[3]: *** [odp_crypto-odp_crypto_test_async_inp.o] Error 1
> > >>     > > make[3]: Leaving directory
> > >>     > > '/home/anders/src/check-odp/odp/test/cunit/crypto'
> > >>     > > Makefile:732: recipe for target 'all-recursive' failed
> > >>     > > make[2]: *** [all-recursive] Error 1
> > >>     > > Makefile:369: recipe for target 'all-recursive' failed
> > >>     > > make[1]: *** [all-recursive] Error 1
> > >>     > > Makefile:454: recipe for target 'all-recursive' failed
> > >>     > > make: *** [all-recursive] Error 1
> > >>     > > Making check in crypto
> > >>     > >
> > >>     > > Check patch compliains on this:
> > >>     > > WARNING: braces {} are not necessary for any arm of this
> statement
> > >>     > > #304: FILE: test/cunit/crypto/odp_crypto_test_async_inp.c:114:
> > >>     > > + if (compl_new == ODP_BUFFER_INVALID) {
> > >>     > > [...]
> > >>     > > + } else {
> > >>     > > [...]
> > >>     > >
> > >>     > > WARNING: line over 80 characters
> > >>     > > #556: FILE: test/cunit/crypto/odp_crypto_test_async_inp.c:366:
> > >>     > > + {ASYNC_INP_ENC_ALG_3DES_CBC_OVR_IV,
> > >>     > > test_async_enc_alg_3des_cbc_ovr_iv },
> > >>     > >
> > >>     > > WARNING: line over 80 characters
> > >>     > > #557: FILE: test/cunit/crypto/odp_crypto_test_async_inp.c:367:
> > >>     > > + {ASYNC_INP_DEC_ALG_3DES_CBC_OVR_IV,
> > >>     > > test_async_dec_alg_3des_cbc_ovr_iv },
> > >>     > >
> > >>     > > WARNING: line over 80 characters
> > >>     > > #559: FILE: test/cunit/crypto/odp_crypto_test_async_inp.c:369:
> > >>     > > + {ASYNC_INP_ENC_ALG_3DES_CBC_COMPL_NEW,
> > >>     > > test_async_enc_alg_3des_cbc_compl_new },
> > >>     > >
> > >>     > >
> > >>     > > Cheers,
> > >>     > > Anders
> > >>     > >
> > >>
> > >>     --
> > >>     Anders Roxell
> > >>     anders.roxell@linaro.org <mailto:anders.roxell@linaro.org>
> > >>     M: +46 709 71 42 85 <tel:%2B46%20709%2071%2042%2085> | IRC:
> roxell
> > >>
> > >>
> > >>
> > >>
> > >> _______________________________________________
> > >> lng-odp mailing list
> > >> lng-odp@lists.linaro.org
> > >> http://lists.linaro.org/mailman/listinfo/lng-odp
> > >>
> > >
> > >
> > > _______________________________________________
> > > lng-odp mailing list
> > > lng-odp@lists.linaro.org
> > > http://lists.linaro.org/mailman/listinfo/lng-odp
> > >
>
> > _______________________________________________
> > lng-odp mailing list
> > lng-odp@lists.linaro.org
> > http://lists.linaro.org/mailman/listinfo/lng-odp
>
>
> --
> Anders Roxell
> anders.roxell@linaro.org
> M: +46 709 71 42 85 | IRC: roxell
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/lng-odp
>
Taras Kondratiuk Nov. 17, 2014, 8:45 a.m. | #16
On 11/14/2014 08:29 PM, Mike Holmes wrote:
>
>
> On 14 November 2014 13:21, Anders Roxell <anders.roxell@linaro.org
> <mailto:anders.roxell@linaro.org>> wrote:
>
>     On 2014-11-14 15:16, Alexandru Badicioiu wrote:
>     > I was told that the CUnit version is 2.1-3, this is why I have used it.
>
>     CI is on Ubuntu 14.04, and that uses CUnit 2.1-2, so it has to work
>     agains that version.
>
>     If it doesn't pass CI it should be fixed.
>
>
> There are many distros, and many versions of cunit. The only rational
> thing is to have the impartial CI suite version be the ultimate
> authority on what is ok when the results differ.
>
> I think we have probably been lax by not specifying the versions CI uses
> more clearly, we can fix that too.
>
> CI is 2.1-2 we should stick with that.

odp_check.sh script pulls 2.1-3 so I also took this version.
2.1-3 has backward incompatible changes in some API compared to 2.1-2.
Unfortunately I'm using these APIs.

Let's stick to 2.1-3. One argument to use it is fixed 'const char *'
issue.

Patch

diff --git a/configure.ac b/configure.ac
index fcd7279..616ea64 100644
--- a/configure.ac
+++ b/configure.ac
@@ -173,6 +173,7 @@  AC_CONFIG_FILES([Makefile
 		 test/Makefile
 		 test/api_test/Makefile
                  test/cunit/Makefile
+		 test/cunit/crypto/Makefile
 		 pkgconfig/libodp.pc])
 
 AC_SEARCH_LIBS([timer_create],[rt posix4])
diff --git a/test/cunit/Makefile.am b/test/cunit/Makefile.am
index 439e134..33e1a41 100644
--- a/test/cunit/Makefile.am
+++ b/test/cunit/Makefile.am
@@ -3,6 +3,8 @@  include $(top_srcdir)/test/Makefile.inc
 AM_CFLAGS += -I$(CUNIT_PATH)/include
 AM_LDFLAGS += -L$(CUNIT_PATH)/lib -static -lcunit
 
+SUBDIRS = crypto
+
 if ODP_CUNIT_ENABLED
 TESTS = ${bin_PROGRAMS}
 check_PROGRAMS = ${bin_PROGRAMS}
diff --git a/test/cunit/crypto/Makefile.am b/test/cunit/crypto/Makefile.am
new file mode 100644
index 0000000..d785602
--- /dev/null
+++ b/test/cunit/crypto/Makefile.am
@@ -0,0 +1,14 @@ 
+include $(top_srcdir)/test/Makefile.inc
+
+AM_CFLAGS += -I$(CUNIT_PATH)/include
+AM_LDFLAGS += -L$(CUNIT_PATH)/lib -static -lcunit
+
+if ODP_CUNIT_ENABLED
+bin_PROGRAMS = odp_crypto
+odp_crypto_CFLAGS = $(AM_CFLAGS)
+odp_crypto_LDFLAGS = $(AM_LDFLAGS)
+endif
+
+dist_odp_crypto_SOURCES = odp_crypto_test_async_inp.c \
+			  odp_crypto_test_sync_inp.c \
+			  odp_crypto_test.c
diff --git a/test/cunit/crypto/odp_crypto_test.c b/test/cunit/crypto/odp_crypto_test.c
new file mode 100644
index 0000000..4026be0
--- /dev/null
+++ b/test/cunit/crypto/odp_crypto_test.c
@@ -0,0 +1,100 @@ 
+/* Copyright (c) 2014, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier:	BSD-3-Clause
+ */
+
+#include <odp.h>
+#include "CUnit/Basic.h"
+#include "CUnit/TestDB.h"
+#include "odp_crypto_test_async_inp.h"
+#include "odp_crypto_test_sync_inp.h"
+
+#define SHM_PKT_POOL_SIZE      (512*2048*2)
+#define SHM_PKT_POOL_BUF_SIZE  (1024 * 32)
+
+#define SHM_COMPL_POOL_SIZE	(128*1024)
+#define SHM_COMPL_POOL_BUF_SIZE 128
+
+CU_SuiteInfo suites[] = {
+	{ ODP_CRYPTO_SYNC_INP , NULL, NULL, NULL, NULL, test_array_sync },
+	{ ODP_CRYPTO_ASYNC_INP , NULL, NULL, NULL, NULL, test_array_async },
+	CU_SUITE_INFO_NULL,
+};
+
+int main(void)
+{
+	odp_shm_t shm;
+	void *pool_base = NULL;
+	odp_buffer_pool_t pool;
+	odp_queue_t out_queue;
+
+	if (odp_init_global(NULL, NULL)) {
+		ODP_ERR("ODP global init failed.\n");
+		return -1;
+	}
+	odp_init_local();
+
+	shm = odp_shm_reserve("shm_packet_pool",
+			      SHM_PKT_POOL_SIZE,
+			      ODP_CACHE_LINE_SIZE, 0);
+
+	pool_base = odp_shm_addr(shm);
+	if (!pool_base) {
+		ODP_ERR("Packet pool allocation failed.\n");
+		return -1;
+	}
+
+	pool = odp_buffer_pool_create("packet_pool", pool_base,
+				      SHM_PKT_POOL_SIZE,
+				      SHM_PKT_POOL_BUF_SIZE,
+				      ODP_CACHE_LINE_SIZE,
+				      ODP_BUFFER_TYPE_PACKET);
+	if (pool == ODP_BUFFER_POOL_INVALID) {
+		ODP_ERR("Packet pool creation failed.\n");
+		return -1;
+	}
+	out_queue = odp_queue_create("crypto-out",
+				     ODP_QUEUE_TYPE_POLL, NULL);
+	if (out_queue == ODP_QUEUE_INVALID) {
+		ODP_ERR("Crypto outq creation failed.\n");
+		return -1;
+	}
+	shm = odp_shm_reserve("shm_compl_pool",
+			     SHM_COMPL_POOL_SIZE,
+			     ODP_CACHE_LINE_SIZE,
+			     ODP_SHM_SW_ONLY);
+	pool_base = odp_shm_addr(shm);
+	if (!pool_base) {
+		ODP_ERR("Completion pool allocation failed.\n");
+		return -1;
+	}
+	pool = odp_buffer_pool_create("compl_pool", pool_base,
+				      SHM_COMPL_POOL_SIZE,
+				      SHM_COMPL_POOL_BUF_SIZE,
+				      ODP_CACHE_LINE_SIZE,
+				      ODP_BUFFER_TYPE_RAW);
+	if (pool == ODP_BUFFER_POOL_INVALID) {
+		ODP_ERR("Completion pool creation failed.\n");
+		return -1;
+	}
+
+	printf("\tODP version: %s\n", odp_version_api_str());
+
+
+	/* initialize the CUnit test registry */
+	if (CUE_SUCCESS != CU_initialize_registry())
+		return CU_get_error();
+
+	/* register suites */
+	CU_register_suites(suites);
+	/* Run all tests using the CUnit Basic interface */
+	CU_basic_set_mode(CU_BRM_VERBOSE);
+	CU_basic_run_tests();
+	CU_cleanup_registry();
+
+	odp_term_local();
+	odp_term_global();
+
+	return CU_get_error();
+}
diff --git a/test/cunit/crypto/odp_crypto_test_async_inp.c b/test/cunit/crypto/odp_crypto_test_async_inp.c
new file mode 100644
index 0000000..dca44fd
--- /dev/null
+++ b/test/cunit/crypto/odp_crypto_test_async_inp.c
@@ -0,0 +1,371 @@ 
+/* Copyright (c) 2014, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier:	BSD-3-Clause
+ */
+
+#include <odp.h>
+#include <odp_crypto.h>
+#include "CUnit/Basic.h"
+#include "CUnit/TestDB.h"
+#include "test_vectors.h"
+
+/* Basic algorithm run function for async inplace mode.
+ * Creates a session from input parameters and runs one operation
+ * on input_vec. Checks the output of the crypto operation against
+ * output_vec. Operation completion event is dequeued polling the
+ * session output queue. Completion context pointer is retrieved
+ * and checked against the one set before the operation.
+ * Completion event can be a separate buffer or the input packet
+ * buffer can be used.
+ * */
+static void alg_test(enum odp_crypto_op op,
+		     enum odp_cipher_alg cipher_alg,
+		     odp_crypto_iv_t ses_iv,
+		     uint8_t *op_iv_ptr,
+		     odp_crypto_key_t cipher_key,
+		     enum odp_auth_alg auth_alg,
+		     odp_crypto_key_t auth_key,
+		     odp_buffer_t compl_new,
+		     uint8_t *input_vec,
+		     unsigned int input_vec_len,
+		     uint8_t *output_vec,
+		     unsigned int output_vec_len)
+{
+	odp_crypto_session_t session;
+	int rc;
+	enum odp_crypto_ses_create_err status;
+	bool posted;
+	odp_buffer_t compl_event;
+
+	odp_queue_t compl_queue = odp_queue_lookup("crypto-out");
+	CU_ASSERT(compl_queue != ODP_QUEUE_INVALID);
+	odp_buffer_pool_t pool = odp_buffer_pool_lookup("packet_pool");
+	CU_ASSERT(pool != ODP_BUFFER_POOL_INVALID);
+
+	/* Create a crypto session */
+	odp_crypto_session_params_t ses_params;
+	memset(&ses_params, 0, sizeof(ses_params));
+	ses_params.op = op;
+	ses_params.auth_cipher_text = false;
+	ses_params.pref_mode = ODP_CRYPTO_ASYNC;
+	ses_params.cipher_alg = cipher_alg;
+	ses_params.auth_alg = auth_alg;
+	ses_params.compl_queue = compl_queue;
+	ses_params.output_pool = pool;
+	ses_params.cipher_key = cipher_key;
+	ses_params.iv = ses_iv;
+	ses_params.auth_key = auth_key;
+
+	/* TEST : odp_crypto_session_create */
+	rc = odp_crypto_session_create(&ses_params, &session, &status);
+	CU_ASSERT(!rc);
+	CU_ASSERT(status == ODP_CRYPTO_SES_CREATE_ERR_NONE);
+
+	/* Prepare input data */
+	odp_buffer_t buf = odp_buffer_alloc(pool);
+	CU_ASSERT(buf != ODP_BUFFER_INVALID);
+	odp_packet_t pkt = odp_packet_from_buffer(buf);
+	CU_ASSERT(pkt != ODP_PACKET_INVALID);
+	uint8_t *data_addr = odp_packet_data(pkt);
+	memcpy(data_addr, input_vec, input_vec_len);
+	/* offsets are relative to buffer address (not packet data)
+	until https://bugs.linaro.org/show_bug.cgi?id=387 is fixed */
+	int data_off = data_addr - (uint8_t *)odp_buffer_addr(buf);
+
+	/* Prepare input/output params */
+	odp_crypto_op_params_t op_params;
+	memset(&op_params, 0, sizeof(op_params));
+	op_params.session = session;
+	op_params.pkt = pkt;
+	op_params.out_pkt = pkt;
+	if (cipher_alg != ODP_CIPHER_ALG_NULL &&
+	    auth_alg == ODP_AUTH_ALG_NULL) {
+		op_params.cipher_range.offset = data_off;
+		op_params.cipher_range.length = input_vec_len;
+		if (op_iv_ptr)
+			op_params.override_iv_ptr = op_iv_ptr;
+	} else if (cipher_alg == ODP_CIPHER_ALG_NULL &&
+		 auth_alg != ODP_AUTH_ALG_NULL) {
+		op_params.auth_range.offset = data_off;
+		op_params.auth_range.length = input_vec_len;
+		op_params.hash_result_offset = data_off;
+	} else {
+		CU_FAIL("%s : not implemented for combined alg mode\n");
+	}
+
+	/* TEST : odp_crypto_set_operation_compl_ctx */
+	/* TEST : odp_crypto_operation */
+	if (compl_new == ODP_BUFFER_INVALID) {
+		odp_crypto_set_operation_compl_ctx(buf, (void *)0xdeadbeef);
+		rc = odp_crypto_operation(&op_params, &posted, buf);
+	} else {
+		odp_crypto_set_operation_compl_ctx(compl_new,
+						   (void *)0xdeadbeef);
+		rc = odp_crypto_operation(&op_params, &posted, compl_new);
+	}
+	CU_ASSERT(posted);
+
+	/* Poll completion queue for results */
+	do {
+		compl_event = odp_queue_deq(compl_queue);
+	} while (compl_event == ODP_BUFFER_INVALID);
+
+	if (compl_new == ODP_BUFFER_INVALID) {
+		CU_ASSERT(compl_event == buf);
+	} else {
+		CU_ASSERT(compl_event == compl_new);
+	}
+
+	/* TEST : odp_crypto_get_operation_compl_status */
+	struct odp_crypto_compl_status auth_status, cipher_status;
+	odp_crypto_get_operation_compl_status(compl_event,
+					      &auth_status, &cipher_status);
+	CU_ASSERT(auth_status.alg_err == ODP_CRYPTO_ALG_ERR_NONE);
+	CU_ASSERT(auth_status.hw_err == ODP_CRYPTO_HW_ERR_NONE);
+	CU_ASSERT(cipher_status.alg_err == ODP_CRYPTO_ALG_ERR_NONE);
+	CU_ASSERT(cipher_status.hw_err == ODP_CRYPTO_HW_ERR_NONE);
+
+	/* TEST : odp_crypto_get_operation_compl_packet */
+	odp_packet_t out_pkt;
+	out_pkt = odp_crypto_get_operation_compl_packet(compl_event);
+	CU_ASSERT(out_pkt == pkt);
+
+	/* TEST : operation output was correct */
+	CU_ASSERT(!memcmp(data_addr, output_vec, output_vec_len));
+
+	/* TEST : we got back the context pointer */
+	void *ctx = odp_crypto_get_operation_compl_ctx(compl_event);
+	CU_ASSERT(ctx == (void *)0xdeadbeef);
+
+	odp_buffer_free(buf);
+}
+
+/* This test verifies the correctness of encode (plaintext -> ciphertext)
+ * operation for 3DES_CBC algorithm. IV for the operation is the session IV.
+ * In addition the test verifies if the implementation can use the
+ * packet buffer as completion event buffer.*/
+#define ASYNC_INP_ENC_ALG_3DES_CBC	"ENC_ALG_3DES_CBC"
+static void test_async_enc_alg_3des_cbc(void)
+{
+	odp_crypto_key_t cipher_key = { .data = NULL, .length = 0 },
+			 auth_key   = { .data = NULL, .length = 0 };
+	odp_crypto_iv_t iv;
+	unsigned int test_vec_num = (sizeof(tdes_cbc_reference_length)/
+				     sizeof(tdes_cbc_reference_length[0]));
+
+	unsigned int i;
+	for (i = 0; i < test_vec_num; i++) {
+		cipher_key.data = tdes_cbc_reference_key[i];
+		cipher_key.length = sizeof(tdes_cbc_reference_key[i]);
+		iv.data = tdes_cbc_reference_iv[i];
+		iv.length = sizeof(tdes_cbc_reference_iv[i]);
+
+		alg_test(ODP_CRYPTO_OP_ENCODE,
+			 ODP_CIPHER_ALG_3DES_CBC,
+			 iv,
+			 NULL,
+			 cipher_key,
+			 ODP_AUTH_ALG_NULL,
+			 auth_key,
+			 ODP_BUFFER_INVALID,
+			 tdes_cbc_reference_plaintext[i],
+			 tdes_cbc_reference_length[i],
+			 tdes_cbc_reference_ciphertext[i],
+			 tdes_cbc_reference_length[i]);
+	}
+}
+
+/* This test verifies the correctness of encode (plaintext -> ciphertext)
+ * operation for 3DES_CBC algorithm. IV for the operation is the operation IV.
+ * */
+#define ASYNC_INP_ENC_ALG_3DES_CBC_OVR_IV	"ENC_ALG_3DES_CBC_OVR_IV"
+static void test_async_enc_alg_3des_cbc_ovr_iv(void)
+{
+	odp_crypto_key_t cipher_key = { .data = NULL, .length = 0 },
+			 auth_key   = { .data = NULL, .length = 0 };
+	odp_crypto_iv_t iv = { .data = NULL, .length = TDES_CBC_IV_LEN };
+	unsigned int test_vec_num = (sizeof(tdes_cbc_reference_length)/
+				     sizeof(tdes_cbc_reference_length[0]));
+
+	unsigned int i;
+	for (i = 0; i < test_vec_num; i++) {
+		cipher_key.data = tdes_cbc_reference_key[i];
+		cipher_key.length = sizeof(tdes_cbc_reference_key[i]);
+
+		alg_test(ODP_CRYPTO_OP_ENCODE,
+			 ODP_CIPHER_ALG_3DES_CBC,
+			 iv,
+			 tdes_cbc_reference_iv[i],
+			 cipher_key,
+			 ODP_AUTH_ALG_NULL,
+			 auth_key,
+			 ODP_BUFFER_INVALID,
+			 tdes_cbc_reference_plaintext[i],
+			 tdes_cbc_reference_length[i],
+			 tdes_cbc_reference_ciphertext[i],
+			 tdes_cbc_reference_length[i]);
+	}
+}
+
+
+/* This test verifies the correctness of decode (ciphertext -> plaintext)
+ * operation for 3DES_CBC algorithm. IV for the operation is the session IV
+ * In addition the test verifies if the implementation can use the
+ * packet buffer as completion event buffer.
+ * */
+#define ASYNC_INP_DEC_ALG_3DES_CBC	 "DEC_ALG_3DES_CBC"
+static void test_async_dec_alg_3des_cbc(void)
+{
+	odp_crypto_key_t cipher_key = { .data = NULL, .length = 0 },
+			 auth_key   = { .data = NULL, .length = 0 };
+	odp_crypto_iv_t iv = { .data = NULL, .length = 0 };
+	unsigned int test_vec_num = (sizeof(tdes_cbc_reference_length)/
+				     sizeof(tdes_cbc_reference_length[0]));
+
+	unsigned int i;
+	for (i = 0; i < test_vec_num; i++) {
+		cipher_key.data = tdes_cbc_reference_key[i];
+		cipher_key.length = sizeof(tdes_cbc_reference_key[i]);
+		iv.data = tdes_cbc_reference_iv[i];
+		iv.length = sizeof(tdes_cbc_reference_iv[i]);
+
+		alg_test(ODP_CRYPTO_OP_DECODE,
+			 ODP_CIPHER_ALG_3DES_CBC,
+			 iv,
+			 NULL,
+			 cipher_key,
+			 ODP_AUTH_ALG_NULL,
+			 auth_key,
+			 ODP_BUFFER_INVALID,
+			 tdes_cbc_reference_ciphertext[i],
+			 tdes_cbc_reference_length[i],
+			 tdes_cbc_reference_plaintext[i],
+			 tdes_cbc_reference_length[i]);
+	}
+}
+
+/* This test verifies the correctness of decode (ciphertext -> plaintext)
+ * operation for 3DES_CBC algorithm. IV for the operation is the session IV
+ * In addition the test verifies if the implementation can use the
+ * packet buffer as completion event buffer.
+ * */
+#define ASYNC_INP_DEC_ALG_3DES_CBC_OVR_IV	 "DEC_ALG_3DES_CBC_OVR_IV"
+static void test_async_dec_alg_3des_cbc_ovr_iv(void)
+{
+	odp_crypto_key_t cipher_key = { .data = NULL, .length = 0 },
+			 auth_key   = { .data = NULL, .length = 0 };
+	odp_crypto_iv_t iv = { .data = NULL, .length = TDES_CBC_IV_LEN };
+	unsigned int test_vec_num = (sizeof(tdes_cbc_reference_length)/
+				     sizeof(tdes_cbc_reference_length[0]));
+
+	unsigned int i;
+	for (i = 0; i < test_vec_num; i++) {
+		cipher_key.data = tdes_cbc_reference_key[i];
+		cipher_key.length = sizeof(tdes_cbc_reference_key[i]);
+
+		alg_test(ODP_CRYPTO_OP_DECODE,
+			 ODP_CIPHER_ALG_3DES_CBC,
+			 iv,
+			 tdes_cbc_reference_iv[i],
+			 cipher_key,
+			 ODP_AUTH_ALG_NULL,
+			 auth_key,
+			 ODP_BUFFER_INVALID,
+			 tdes_cbc_reference_ciphertext[i],
+			 tdes_cbc_reference_length[i],
+			 tdes_cbc_reference_plaintext[i],
+			 tdes_cbc_reference_length[i]);
+	}
+}
+
+
+/* This test verifies the correctness of HMAC_MD5 digest operation.
+ * The output check length is truncated to 12 bytes (96 bits) as
+ * returned by the crypto operation API call.
+ * Note that hash digest is a one-way operation.
+ * In addition the test verifies if the implementation can use the
+ * packet buffer as completion event buffer.
+ * */
+#define ASYNC_INP_ALG_HMAC_MD5	      "ALG_HMAC_MD5"
+static void test_async_alg_hmac_md5(void)
+{
+	odp_crypto_key_t cipher_key = { .data = NULL, .length = 0 },
+			 auth_key   = { .data = NULL, .length = 0 };
+	odp_crypto_iv_t iv = { .data = NULL, .length = 0 };
+
+	unsigned int test_vec_num = (sizeof(hmac_md5_reference_length)/
+				     sizeof(hmac_md5_reference_length[0]));
+
+	unsigned int i;
+	for (i = 0; i < test_vec_num; i++) {
+		auth_key.data = hmac_md5_reference_key[i];
+		auth_key.length = sizeof(hmac_md5_reference_key[i]);
+
+		alg_test(ODP_CRYPTO_OP_ENCODE,
+			 ODP_CIPHER_ALG_NULL,
+			 iv,
+			 iv.data,
+			 cipher_key,
+			 ODP_AUTH_ALG_MD5_96,
+			 auth_key,
+			 ODP_BUFFER_INVALID,
+			 hmac_md5_reference_plaintext[i],
+			 hmac_md5_reference_length[i],
+			 hmac_md5_reference_digest[i],
+			 HMAC_MD5_96_CHECK_LEN);
+	}
+}
+
+/* This test verifies the correctness of encode (plaintext -> ciphertext)
+ * operation for 3DES_CBC algorithm. IV for the operation is the session IV.
+ * Uses a separate buffer for completion event
+ * */
+#define ASYNC_INP_ENC_ALG_3DES_CBC_COMPL_NEW	   "ENC_ALG_3DES_CBC_COMPL_NEW"
+static void test_async_enc_alg_3des_cbc_compl_new(void)
+{
+	odp_crypto_key_t cipher_key = { .data = NULL, .length = 0 },
+			 auth_key   = { .data = NULL, .length = 0 };
+	odp_crypto_iv_t iv;
+	unsigned int test_vec_num = (sizeof(tdes_cbc_reference_length)/
+				     sizeof(tdes_cbc_reference_length[0]));
+
+	odp_buffer_pool_t pool = odp_buffer_pool_lookup("compl_pool");
+	CU_ASSERT(pool != ODP_BUFFER_POOL_INVALID);
+
+	unsigned int i;
+	odp_buffer_t compl_new;
+	for (i = 0; i < test_vec_num; i++) {
+		compl_new = odp_buffer_alloc(pool);
+		CU_ASSERT(compl_new != ODP_BUFFER_INVALID);
+
+		cipher_key.data = tdes_cbc_reference_key[i];
+		cipher_key.length = sizeof(tdes_cbc_reference_key[i]);
+		iv.data = tdes_cbc_reference_iv[i];
+		iv.length = sizeof(tdes_cbc_reference_iv[i]);
+
+		alg_test(ODP_CRYPTO_OP_ENCODE,
+			 ODP_CIPHER_ALG_3DES_CBC,
+			 iv,
+			 NULL,
+			 cipher_key,
+			 ODP_AUTH_ALG_NULL,
+			 auth_key,
+			 compl_new,
+			 tdes_cbc_reference_plaintext[i],
+			 tdes_cbc_reference_length[i],
+			 tdes_cbc_reference_ciphertext[i],
+			 tdes_cbc_reference_length[i]);
+		odp_buffer_free(compl_new);
+	}
+}
+
+CU_TestInfo test_array_async[] = {
+	{ASYNC_INP_ENC_ALG_3DES_CBC, test_async_enc_alg_3des_cbc },
+	{ASYNC_INP_DEC_ALG_3DES_CBC, test_async_dec_alg_3des_cbc },
+	{ASYNC_INP_ENC_ALG_3DES_CBC_OVR_IV, test_async_enc_alg_3des_cbc_ovr_iv },
+	{ASYNC_INP_DEC_ALG_3DES_CBC_OVR_IV, test_async_dec_alg_3des_cbc_ovr_iv },
+	{ASYNC_INP_ALG_HMAC_MD5, test_async_alg_hmac_md5 },
+	{ASYNC_INP_ENC_ALG_3DES_CBC_COMPL_NEW, test_async_enc_alg_3des_cbc_compl_new },
+	CU_TEST_INFO_NULL,
+};
diff --git a/test/cunit/crypto/odp_crypto_test_async_inp.h b/test/cunit/crypto/odp_crypto_test_async_inp.h
new file mode 100644
index 0000000..ffad83c
--- /dev/null
+++ b/test/cunit/crypto/odp_crypto_test_async_inp.h
@@ -0,0 +1,17 @@ 
+/* Copyright (c) 2014, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier:	BSD-3-Clause
+ */
+#ifndef ODP_CRYPTO_TEST_ASYNC_INP_
+#define ODP_CRYPTO_TEST_ASYNC_INP_
+
+#include "CUnit/TestDB.h"
+
+/* Suite name */
+#define ODP_CRYPTO_ASYNC_INP	"odp_crypto_async_inp"
+
+/* Suite test array */
+CU_TestInfo test_array_async[1];
+
+#endif
diff --git a/test/cunit/crypto/odp_crypto_test_sync_inp.c b/test/cunit/crypto/odp_crypto_test_sync_inp.c
new file mode 100644
index 0000000..bc782b5
--- /dev/null
+++ b/test/cunit/crypto/odp_crypto_test_sync_inp.c
@@ -0,0 +1,260 @@ 
+#include <odp.h>
+#include <odp_crypto.h>
+#include "CUnit/Basic.h"
+#include "CUnit/TestDB.h"
+#include "test_vectors.h"
+
+/* Basic algorithm run function for sync inplace.
+ * Creates a session from input parameters and runs one operation
+ * on input_vec. Checks the output of the crypto operation against
+ * output_vec.
+ */
+static void alg_test(enum odp_crypto_op op,
+		     enum odp_cipher_alg cipher_alg,
+		     odp_crypto_iv_t ses_iv,
+		     uint8_t *op_iv_ptr,
+		     odp_crypto_key_t cipher_key,
+		     enum odp_auth_alg auth_alg,
+		     odp_crypto_key_t auth_key,
+		     uint8_t *input_vec,
+		     unsigned int input_vec_len,
+		     uint8_t *output_vec,
+		     unsigned int output_vec_len)
+{
+	odp_crypto_session_t session;
+	int rc;
+	enum odp_crypto_ses_create_err status;
+	bool posted;
+
+	odp_queue_t compl_queue = odp_queue_lookup("crypto-out");
+	CU_ASSERT(compl_queue != ODP_QUEUE_INVALID);
+	odp_buffer_pool_t pool = odp_buffer_pool_lookup("packet_pool");
+	CU_ASSERT(pool != ODP_BUFFER_POOL_INVALID);
+
+	/* Create a crypto session */
+	odp_crypto_session_params_t ses_params;
+	memset(&ses_params, 0, sizeof(ses_params));
+	ses_params.op = op;
+	ses_params.auth_cipher_text = false;
+	ses_params.pref_mode = ODP_CRYPTO_SYNC;
+	ses_params.cipher_alg = cipher_alg;
+	ses_params.auth_alg = auth_alg;
+	ses_params.compl_queue = ODP_QUEUE_INVALID;
+	ses_params.output_pool = pool;
+	ses_params.cipher_key = cipher_key;
+	ses_params.iv = ses_iv;
+	ses_params.auth_key = auth_key;
+
+	/* TEST : odp_crypto_session_create */
+	rc = odp_crypto_session_create(&ses_params, &session, &status);
+	CU_ASSERT(!rc);
+	CU_ASSERT(status == ODP_CRYPTO_SES_CREATE_ERR_NONE);
+
+	/* Prepare input data */
+	odp_buffer_t buf = odp_buffer_alloc(pool);
+	CU_ASSERT(buf != ODP_BUFFER_INVALID);
+	odp_packet_t pkt = odp_packet_from_buffer(buf);
+	CU_ASSERT(pkt != ODP_PACKET_INVALID);
+	uint8_t *data_addr = odp_packet_data(pkt);
+	memcpy(data_addr, input_vec, input_vec_len);
+	/* offsets are relative to buffer address (not packet data)
+	until https://bugs.linaro.org/show_bug.cgi?id=387 is fixed */
+	int data_off = data_addr - (uint8_t *)odp_buffer_addr(buf);
+
+	/* Prepare input/output params */
+	odp_crypto_op_params_t op_params;
+	memset(&op_params, 0, sizeof(op_params));
+	op_params.session = session;
+	op_params.pkt = pkt;
+	op_params.out_pkt = pkt;
+	if (cipher_alg != ODP_CIPHER_ALG_NULL &&
+	    auth_alg == ODP_AUTH_ALG_NULL) {
+		op_params.cipher_range.offset = data_off;
+		op_params.cipher_range.length = input_vec_len;
+		if (op_iv_ptr)
+			op_params.override_iv_ptr = op_iv_ptr;
+	} else if (cipher_alg == ODP_CIPHER_ALG_NULL &&
+		 auth_alg != ODP_AUTH_ALG_NULL) {
+		op_params.auth_range.offset = data_off;
+		op_params.auth_range.length = input_vec_len;
+		op_params.hash_result_offset = data_off;
+	} else {
+		CU_FAIL("%s : not implemented for combined alg mode\n");
+	}
+
+	/* TEST : odp_crypto_operation */
+	rc = odp_crypto_operation(&op_params, &posted, buf);
+	CU_ASSERT(!rc);
+	/* indication that the operation completed */
+	CU_ASSERT(!posted);
+
+	/* TEST : operation output was correct */
+	CU_ASSERT(!memcmp(data_addr, output_vec, output_vec_len));
+}
+
+#define SYNC_INP_ENC_ALG_3DES_CBC "ENC_ALG_3DES_CBC"
+static void test_sync_enc_alg_3des_cbc(void)
+{
+	odp_crypto_key_t cipher_key = { .data = NULL, .length = 0 },
+			 auth_key   = { .data = NULL, .length = 0 };
+	odp_crypto_iv_t iv;
+	unsigned int test_vec_num = (sizeof(tdes_cbc_reference_length)/
+				     sizeof(tdes_cbc_reference_length[0]));
+	unsigned int i;
+	for (i = 0; i < test_vec_num; i++) {
+		cipher_key.data = tdes_cbc_reference_key[i];
+		cipher_key.length = sizeof(tdes_cbc_reference_key[i]);
+		iv.data = tdes_cbc_reference_iv[i];
+		iv.length = sizeof(tdes_cbc_reference_iv[i]);
+
+		alg_test(ODP_CRYPTO_OP_ENCODE,
+			 ODP_CIPHER_ALG_3DES_CBC,
+			 iv,
+			 NULL,
+			 cipher_key,
+			 ODP_AUTH_ALG_NULL,
+			 auth_key,
+			 tdes_cbc_reference_plaintext[i],
+			 tdes_cbc_reference_length[i],
+			 tdes_cbc_reference_ciphertext[i],
+			 tdes_cbc_reference_length[i]);
+	}
+}
+
+/* This test verifies the correctness of decode (ciphertext -> plaintext)
+ * operation for 3DES_CBC algorithm. IV for the operation is the session IV
+ * */
+#define SYNC_INP_DEC_ALG_3DES_CBC	"DEC_ALG_3DES_CBC"
+static void test_sync_dec_alg_3des_cbc(void)
+{
+	odp_crypto_key_t cipher_key = { .data = NULL, .length = 0 },
+			 auth_key   = { .data = NULL, .length = 0 };
+	odp_crypto_iv_t iv = { .data = NULL, .length = 0 };
+	unsigned int test_vec_num = (sizeof(tdes_cbc_reference_length)/
+				     sizeof(tdes_cbc_reference_length[0]));
+
+	unsigned int i;
+	for (i = 0; i < test_vec_num; i++) {
+		cipher_key.data = tdes_cbc_reference_key[i];
+		cipher_key.length = sizeof(tdes_cbc_reference_key[i]);
+		iv.data = tdes_cbc_reference_iv[i];
+		iv.length = sizeof(tdes_cbc_reference_iv[i]);
+
+		alg_test(ODP_CRYPTO_OP_DECODE,
+			 ODP_CIPHER_ALG_3DES_CBC,
+			 iv,
+			 NULL,
+			 cipher_key,
+			 ODP_AUTH_ALG_NULL,
+			 auth_key,
+			 tdes_cbc_reference_ciphertext[i],
+			 tdes_cbc_reference_length[i],
+			 tdes_cbc_reference_plaintext[i],
+			 tdes_cbc_reference_length[i]);
+	}
+}
+
+/* This test verifies the correctness of HMAC_MD5 digest operation.
+ * The output check length is truncated to 12 bytes (96 bits) as
+ * returned by the crypto operation API call.
+ * Note that hash digest is a one-way operation.
+ * */
+#define SYNC_INP_ALG_HMAC_MD5	     "ALG_HMAC_MD5"
+static void test_sync_alg_hmac_md5(void)
+{
+	odp_crypto_key_t cipher_key = { .data = NULL, .length = 0 },
+			 auth_key   = { .data = NULL, .length = 0 };
+	odp_crypto_iv_t iv = { .data = NULL, .length = 0 };
+
+	unsigned int test_vec_num = (sizeof(hmac_md5_reference_length)/
+				     sizeof(hmac_md5_reference_length[0]));
+
+	unsigned int i;
+	for (i = 0; i < test_vec_num; i++) {
+		auth_key.data = hmac_md5_reference_key[i];
+		auth_key.length = sizeof(hmac_md5_reference_key[i]);
+
+		alg_test(ODP_CRYPTO_OP_ENCODE,
+			 ODP_CIPHER_ALG_NULL,
+			 iv,
+			 iv.data,
+			 cipher_key,
+			 ODP_AUTH_ALG_MD5_96,
+			 auth_key,
+			 hmac_md5_reference_plaintext[i],
+			 hmac_md5_reference_length[i],
+			 hmac_md5_reference_digest[i],
+			 HMAC_MD5_96_CHECK_LEN);
+	}
+}
+
+/* This test verifies the correctness of encode (plaintext -> ciphertext)
+ * operation for 3DES_CBC algorithm. IV for the operation is the operation IV.
+ * */
+#define SYNC_INP_ENC_ALG_3DES_CBC_OVR_IV       "ENC_ALG_3DES_CBC_OVR_IV"
+static void test_sync_enc_alg_3des_cbc_ovr_iv(void)
+{
+	odp_crypto_key_t cipher_key = { .data = NULL, .length = 0 },
+			 auth_key   = { .data = NULL, .length = 0 };
+	odp_crypto_iv_t iv = { .data = NULL, .length = TDES_CBC_IV_LEN };
+	unsigned int test_vec_num = (sizeof(tdes_cbc_reference_length)/
+				     sizeof(tdes_cbc_reference_length[0]));
+
+	unsigned int i;
+	for (i = 0; i < test_vec_num; i++) {
+		cipher_key.data = tdes_cbc_reference_key[i];
+		cipher_key.length = sizeof(tdes_cbc_reference_key[i]);
+
+		alg_test(ODP_CRYPTO_OP_ENCODE,
+			 ODP_CIPHER_ALG_3DES_CBC,
+			 iv,
+			 tdes_cbc_reference_iv[i],
+			 cipher_key,
+			 ODP_AUTH_ALG_NULL,
+			 auth_key,
+			 tdes_cbc_reference_plaintext[i],
+			 tdes_cbc_reference_length[i],
+			 tdes_cbc_reference_ciphertext[i],
+			 tdes_cbc_reference_length[i]);
+	}
+}
+
+/* This test verifies the correctness of decode (ciphertext -> plaintext)
+ * operation for 3DES_CBC algorithm. IV for the operation is the session IV.
+ * */
+#define SYNC_INP_DEC_ALG_3DES_CBC_OVR_IV	"DEC_ALG_3DES_CBC_OVR_IV"
+static void test_sync_dec_alg_3des_cbc_ovr_iv(void)
+{
+	odp_crypto_key_t cipher_key = { .data = NULL, .length = 0 },
+			 auth_key   = { .data = NULL, .length = 0 };
+	odp_crypto_iv_t iv = { .data = NULL, .length = TDES_CBC_IV_LEN };
+	unsigned int test_vec_num = (sizeof(tdes_cbc_reference_length)/
+				     sizeof(tdes_cbc_reference_length[0]));
+
+	unsigned int i;
+	for (i = 0; i < test_vec_num; i++) {
+		cipher_key.data = tdes_cbc_reference_key[i];
+		cipher_key.length = sizeof(tdes_cbc_reference_key[i]);
+
+		alg_test(ODP_CRYPTO_OP_DECODE,
+			 ODP_CIPHER_ALG_3DES_CBC,
+			 iv,
+			 tdes_cbc_reference_iv[i],
+			 cipher_key,
+			 ODP_AUTH_ALG_NULL,
+			 auth_key,
+			 tdes_cbc_reference_ciphertext[i],
+			 tdes_cbc_reference_length[i],
+			 tdes_cbc_reference_plaintext[i],
+			 tdes_cbc_reference_length[i]);
+	}
+}
+
+CU_TestInfo test_array_sync[] = {
+	{SYNC_INP_ENC_ALG_3DES_CBC, test_sync_enc_alg_3des_cbc },
+	{SYNC_INP_DEC_ALG_3DES_CBC, test_sync_dec_alg_3des_cbc },
+	{SYNC_INP_ENC_ALG_3DES_CBC_OVR_IV, test_sync_enc_alg_3des_cbc_ovr_iv },
+	{SYNC_INP_DEC_ALG_3DES_CBC_OVR_IV, test_sync_dec_alg_3des_cbc_ovr_iv },
+	{SYNC_INP_ALG_HMAC_MD5, test_sync_alg_hmac_md5 },
+	CU_TEST_INFO_NULL,
+};
diff --git a/test/cunit/crypto/odp_crypto_test_sync_inp.h b/test/cunit/crypto/odp_crypto_test_sync_inp.h
new file mode 100644
index 0000000..6a8511d
--- /dev/null
+++ b/test/cunit/crypto/odp_crypto_test_sync_inp.h
@@ -0,0 +1,17 @@ 
+/* Copyright (c) 2014, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier:	BSD-3-Clause
+ */
+#ifndef ODP_CRYPTO_TEST_SYNC_INP_
+#define ODP_CRYPTO_TEST_SYNC_INP_
+
+#include "CUnit/TestDB.h"
+
+/* Suite name */
+#define ODP_CRYPTO_SYNC_INP    "odp_crypto_sync_inp"
+
+/* Suite test array */
+CU_TestInfo test_array_sync[1];
+
+#endif
diff --git a/test/cunit/crypto/test_vectors.h b/test/cunit/crypto/test_vectors.h
new file mode 100644
index 0000000..c151952
--- /dev/null
+++ b/test/cunit/crypto/test_vectors.h
@@ -0,0 +1,94 @@ 
+/* Copyright (c) 2014, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier:	BSD-3-Clause
+ */
+
+
+/* TDES-CBC reference vectors, according to
+ * "http://csrc.nist.gov/groups/STM/cavp/documents/des/DESMMT.pdf"
+ */
+
+#define TDES_CBC_KEY_LEN	24	/* key length(in bytes) for tdes-cbc */
+#define TDES_CBC_IV_LEN		8	/* IV length(in bytes) for tdes-cbc */
+#define TDES_CBC_MAX_DATA_LEN	16	/* max. plain text length(in bytes) */
+
+static uint8_t tdes_cbc_reference_key[][TDES_CBC_KEY_LEN] = {
+	{0x62, 0x7f, 0x46, 0x0e, 0x08, 0x10, 0x4a, 0x10, 0x43, 0xcd, 0x26, 0x5d,
+	 0x58, 0x40, 0xea, 0xf1, 0x31, 0x3e, 0xdf, 0x97, 0xdf, 0x2a, 0x8a, 0x8c,
+	 },
+
+	{0x37, 0xae, 0x5e, 0xbf, 0x46, 0xdf, 0xf2, 0xdc, 0x07, 0x54, 0xb9, 0x4f,
+	 0x31, 0xcb, 0xb3, 0x85, 0x5e, 0x7f, 0xd3, 0x6d, 0xc8, 0x70, 0xbf, 0xae}
+};
+
+static uint8_t tdes_cbc_reference_iv[][TDES_CBC_IV_LEN] = {
+	{0x8e, 0x29, 0xf7, 0x5e, 0xa7, 0x7e, 0x54, 0x75},
+
+	{0x3d, 0x1d, 0xe3, 0xcc, 0x13, 0x2e, 0x3b, 0x65}
+};
+
+/** length in bytes */
+static uint32_t tdes_cbc_reference_length[] = { 8, 16 };
+
+static uint8_t tdes_cbc_reference_plaintext[][TDES_CBC_MAX_DATA_LEN] = {
+	{0x32, 0x6a, 0x49, 0x4c, 0xd3, 0x3f, 0xe7, 0x56},
+
+	{0x84, 0x40, 0x1f, 0x78, 0xfe, 0x6c, 0x10, 0x87, 0x6d, 0x8e, 0xa2, 0x30,
+	 0x94, 0xea, 0x53, 0x09}
+};
+
+static uint8_t tdes_cbc_reference_ciphertext[][TDES_CBC_MAX_DATA_LEN] = {
+	{0xb2, 0x2b, 0x8d, 0x66, 0xde, 0x97, 0x06, 0x92},
+
+	{0x7b, 0x1f, 0x7c, 0x7e, 0x3b, 0x1c, 0x94, 0x8e, 0xbd, 0x04, 0xa7, 0x5f,
+	 0xfb, 0xa7, 0xd2, 0xf5}
+};
+
+
+/* HMAC-MD5 test vectors  - RFC2104 */
+#define HMAC_MD5_KEY_LEN	16
+#define HMAC_MD5_MAX_DATA_LEN	128
+#define HMAC_MD5_DIGEST_LEN	16
+#define HMAC_MD5_96_CHECK_LEN	12
+
+static uint8_t hmac_md5_reference_key[][HMAC_MD5_KEY_LEN] = {
+	{ 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b,
+	  0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b } ,
+
+	/* "Jefe" */
+	{ 0x4a, 0x65, 0x66, 0x65 },
+
+	{ 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
+	  0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa }
+};
+
+static uint32_t hmac_md5_reference_length[] = { 8, 28, 50 };
+
+static uint8_t hmac_md5_reference_plaintext[][HMAC_MD5_MAX_DATA_LEN] = {
+	/* "Hi There" */
+	{ 0x48, 0x69, 0x20, 0x54, 0x68, 0x65, 0x72, 0x65},
+
+	/* what do ya want for nothing?*/
+	{ 0x77, 0x68, 0x61, 0x74, 0x20, 0x64, 0x6f, 0x20,
+	  0x79, 0x61, 0x20, 0x77, 0x61, 0x6e, 0x74, 0x20,
+	  0x66, 0x6f, 0x72, 0x20, 0x6e, 0x6f, 0x74, 0x68,
+	  0x69, 0x6e, 0x67, 0x3f },
+
+	{ 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
+	  0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
+	  0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
+	  0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
+	  0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd }
+};
+
+static uint8_t hmac_md5_reference_digest[][HMAC_MD5_DIGEST_LEN] = {
+	{ 0x92, 0x94, 0x72, 0x7a, 0x36, 0x38, 0xbb, 0x1c,
+	  0x13, 0xf4, 0x8e, 0xf8, 0x15, 0x8b, 0xfc, 0x9d },
+
+	{ 0x75, 0x0c, 0x78, 0x3e, 0x6a, 0xb0, 0xb5, 0x03,
+	  0xea, 0xa8, 0x6e, 0x31, 0x0a, 0x5d, 0xb7, 0x38 },
+
+	{ 0x56, 0xbe, 0x34, 0x52, 0x1d, 0x14, 0x4c, 0x88,
+	  0xdb, 0xb8, 0xc7, 0x33, 0xf0, 0xe8, 0xb3, 0xf6 }
+};