Beosil's crypto code used by permission.
