ecc: fix code on 16Bit CPU

On a 16 Bit CPU a int as the default type for numbers is a 16 bit int.
Here a 32 bit number is needed every time.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
ecc: use memcmp(), memset() and memcpy()

Use these functions where appropriate.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
ecc: fix test for ecc_ecdsa_validate()

ecc_ecdsa_validate() now returns 0 on success, fix the test.

This was missing in this commit:
commit d4ed8f0537485cb3bc7f5720a5bba66e69dd530e
Author: Hauke Mehrtens <hauke@hauke-m.de>
Date:   Mon Jul 22 14:54:49 2013 +0200

    ecc: make signature check return negative number in error case.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
ecc: add tests for contiki

Make it possible to build the ecc tests on contiki.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
dtls: do not use record header data in handshake processing

The reference to the record header is not used for processing the
handshake messages, remove it.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
dtls: do not queue new packages at front

The netq_insert_node() function wants to place a package that should be
send as last package at the beginning, because the while loop runs to
the last package and then it calls next, which will result in p = NULL.
In this case the package will be added at the beginning.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
dtls: increase DTLS max package size to 200 bytes

For the ecdh server key exchange we need more space

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
dtls_time: use 32 bit int for time

On a 16 bit system a 16 bit int would be used for the time and this is
too small. In cooja on a wismote target I had an overflow every some
minutes.

32bit for the time should work for some years.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
dtls: start next retransmission after time from now

When the retransmission is not done directly when the timeout was over
but sometime alter, because the system was blocked by an other thread,
then the next retransmission time was calculated base on the
established time the current retransmission should have happened and
not the time it actually happened. Now this is based on the current
time and there at least the timeout seconds between each retransmission.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>