Cipher routines from FreeBSD
