common validator for client and server config

- reusable validator for cipher, kex and mac
- use it for client and server config