Updated algorithm, test vectors. Improved key interfaces.