Reorganize scrypt function implementations.