Esempio n. 1
0
/* see sph_md2.h */
void
sph_md2_close(void *cc, void *dst)
{
	sph_md2_context *mc;
	unsigned u, v;

	mc = cc;
	u = mc->count;
	v = 16 - u;
	memset(mc->u.X + 16 + u, v, v);
	md2_round(mc);
	memcpy(mc->u.X + 16, mc->C, 16);
	md2_round(mc);
	memcpy(dst, mc->u.X, 16);
	sph_md2_init(mc);
}
Esempio n. 2
0
static int crypt_all(int *pcount, struct db_salt *salt)
{
    int count = *pcount;
    int index = 0;

#ifdef _OPENMP
    #pragma omp parallel for
    for (index = 0; index < count; index++)
#endif
    {
        sph_md2_context ctx;

        sph_md2_init(&ctx);
        sph_md2(&ctx, saved_key[index], strlen(saved_key[index]));
        sph_md2_close(&ctx, (unsigned char*)crypt_out[index]);
    }
    return count;
}