More refactoring of internal cipher API.
9 files changed