otp-hash.c revision 4081894c16e50f37639d9826ebca4394b398c35e
/*
* OTP hash generaion.
*
* Copyright (c) 2006 Andrey Panin <pazke@donpac.ru>
*
* This software is released under the MIT license.
*/
#include "lib.h"
#include "md4.h"
#include "md5.h"
#include "sha1.h"
#include "otp.h"
struct digest {
const char *name;
};
struct digest_context {
union {
struct md4_context md4_ctx;
struct md5_context md5_ctx;
} ctx;
};
{
}
{
}
/*
* Sometimes I simply can't look at code generated by gcc.
*/
{
asm("xchgb %b0, %h0\n"
"rorl $16, %0\n"
"xchgb %b0, %h0\n"
:"=q" (val)
: "0" (val));
#else
#endif
return val;
}
{
}
};
#undef F
const char *digest_name(unsigned int algo)
{
}
int digest_find(const char *name)
{
int i;
for (i = 0; i < N_DIGESTS; i++)
return i;
return -1;
}
{
return 0;
}
{
}
{
}
{
}
{
struct digest_context ctx;
while (step-- > 0) {
}
}
unsigned char *result)
{
struct digest_context ctx;
}