Add test to the crypto service (and also fix some bugs...)

Signed-off-by: Clement Escoffier <clement.escoffier@gmail.com>