Created
April 28, 2017 18:30
-
-
Save etodanik/ea51b8061ad88b62666bbbe941edd4aa to your computer and use it in GitHub Desktop.
getDecryptedChar() function for Shabak Challenge Part 2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
uint8_t getDecryptedChar(uint8_t c, uint8_t operationCode, uint8_t operationParameter) { | |
switch (operationCode) { | |
case Xor: | |
return c ^ operationParameter; | |
break; | |
case Add: | |
return c + operationParameter; | |
break; | |
case Subtract: | |
return c - operationParameter; | |
break; | |
default: | |
cout << "Invalid operation code: " << operationCode << endl; | |
break; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment