New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The implemented ROR and ROL algorithms are actually Shift (Right | Left) #10408
Comments
why do you expect this? the help message states it clearly
| wor [val] >>= shift right
| wol [val] <<= shift left
shift != rotate
i would do worr and woll to implement the <<< and >>> bit rotation.
can u send a PR implementing this? it’s already done for ESIL
… On 19 Jun 2018, at 13:48, Itay Cohen ***@***.***> wrote:
Using woD ror ... or woD rol ... performs logical shifts <https://en.wikipedia.org/wiki/Logical_shift> and not circular shifts <https://en.wikipedia.org/wiki/Circular_shift>.
i.e it's not the equivalent of the ROR and ROL instructions.
The current implementation <https://github.com/radare/radare2/blob/ef233e2bd5b7eaa5d75fe075881a98b1be0a4c39/libr/crypto/p/crypto_ror.c#L23> is simply a shift:
static void ror_crypt(struct ror_state *const state, const ut8 *inbuf, ut8 *outbuf, int buflen) {
int i;
for (i = 0; i < buflen; i++) {
outbuf[i] = inbuf[i] >> state->key[i%state->key_size];
}
}
While we expect something similar to this:
static void ror_crypt(struct ror_state *const state, const ut8 *inbuf, ut8 *outbuf, int buflen) {
int i;
for (i = 0; i < buflen; i++) {
outbuf[i] = (inbuf[i] << key[i % state->key_size]) | (inbuf[i] >> (32 - key[i % state->key_size]));
}
}
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub <#10408>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AA3-lv0kINizzj3QicsCFATAxYha5bhfks5t-OT6gaJpZM4UtWlT>.
|
I'm not talking about
It is saying "ror" and "rol" which stands for Rotate Right|Left. |
right this is wrong. can you send a PR fixing libr/crypto/p/crypto_ror.c ?
… On 19 Jun 2018, at 14:56, Itay Cohen ***@***.***> wrote:
I'm not talking about wor and wol but on woD:
[0x00000000]> woD
Usage: woD [algo] [key] [IV]
Currently supported hashes:
md5
...
...
...
Available Encoders/Decoders:
base64
...
...
Currently supported crypto algos:
...
...
ror <-------
rol <-------
rot
...
...
It is saying "ror" and "rol" which stands for Rotate Right|Left.
Also, the function's name is ror_crypt and not "shift_right_crypt" or something...
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub <#10408 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AA3-lpqkIDagDgTDkr4KjhakDut17GQTks5t-PUMgaJpZM4UtWlT>.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Using
woD ror ...
orwoD rol ...
performs logical shifts and not circular shifts.i.e it's not the equivalent of the
ROR
andROL
instructions.The current implementation is simply a shift:
While we expect something similar to this:
The text was updated successfully, but these errors were encountered: