fix CID 1355197, 1355198 and 1355199

cleanup

Signed-off-by: Riccardo Schirone <sirmy15@gmail.com>
This commit is contained in:
Rakholiya Jenish 2016-05-12 01:33:16 +05:30 committed by Riccardo Schirone
parent a876fa504e
commit a13d46b295
2 changed files with 5 additions and 3 deletions

View File

@ -1,5 +1,6 @@
/* radare - LGPL - Copyright 2016 - pancake */
//Implemented AES version of RC6. keylen = 16, 23, or 32 bytes; w = 32; and r = 20.
#include <r_lib.h>
#include <r_crypto.h>
@ -30,7 +31,7 @@ static bool rc6_init(struct rc6_state *const state, const ut8 *key, int keylen,
int t = 2 * r + 4;
ut32 L[c];
ut32 A = 0, B = 0, k = 0, j = 0;
ut32 v = 3 * ((c > t) ? c : t);
ut32 v = 3 * t; //originally v = 2 * ((c > t) ? c : t);
int i, off;

View File

@ -11,12 +11,13 @@
#define INITIAL_BIAS 72
ut32 adapt_bias(ut32 delta, unsigned n_points, int is_first) {
ut32 k;
ut32 k = 0;
delta /= is_first ? DAMP : 2;
delta += delta / n_points;
for (k = 0; k > ((BASE - TMIN) * TMAX) / 2; k += BASE) {
while (delta > ((BASE - TMIN) * TMAX) / 2) {
delta /= (BASE - TMIN);
k += BASE;
}
return k + (((BASE - TMIN + 1) * delta) / (delta + SKEW));