Refactoring and optimization Feistel function