dtls: extract cipher comparison into a own functions

Move the comparison of the used cipher into a inline function. This
makes it easier to deactivate the code when one of these ciphers is not
used at compile time.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
dtls: inline init_cipher()

This functions was called once only.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
dtls: extract check for client auth

Add functions is_ecdsa_client_auth_supported() which checks if the
application code requests client auth.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
tests: make functions for dtls test static

These functions are not used outside the file, make them static.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
dtls: add build config option for ecc and psk

This makes it possible to build tinyDTLS without ECDHE_ECDHA or without
PSK support. Especially the ECDHE_ECDSA cipher needs some more code and
also extends the handshake struct by some 100 bytes. On constrained
devices one might just want tiynDTLS with PSK support or just with
ECDHE_ECDSA support.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
dtls: update some code documentation

This adds some new and updates some old code documentation.

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