mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-14 18:48:13 -07:00
client: fix mix of spaces & tabs
This commit is contained in:
parent
112411042f
commit
0d9223a547
197 changed files with 49383 additions and 49383 deletions
|
@ -26,154 +26,154 @@ static struct crypto_backend *crypto_backend;
|
|||
|
||||
static bool crypto_init(void)
|
||||
{
|
||||
if (crypto_backend)
|
||||
return true;
|
||||
if (crypto_backend)
|
||||
return true;
|
||||
|
||||
crypto_backend = crypto_polarssl_init();
|
||||
crypto_backend = crypto_polarssl_init();
|
||||
|
||||
if (!crypto_backend)
|
||||
return false;
|
||||
if (!crypto_backend)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
struct crypto_hash *crypto_hash_open(enum crypto_algo_hash hash)
|
||||
{
|
||||
struct crypto_hash *ch;
|
||||
struct crypto_hash *ch;
|
||||
|
||||
if (!crypto_init())
|
||||
return NULL;
|
||||
if (!crypto_init())
|
||||
return NULL;
|
||||
|
||||
ch = crypto_backend->hash_open(hash);
|
||||
if (ch)
|
||||
ch->algo = hash;
|
||||
ch = crypto_backend->hash_open(hash);
|
||||
if (ch)
|
||||
ch->algo = hash;
|
||||
|
||||
return ch;
|
||||
return ch;
|
||||
}
|
||||
|
||||
void crypto_hash_close(struct crypto_hash *ch)
|
||||
{
|
||||
ch->close(ch);
|
||||
ch->close(ch);
|
||||
}
|
||||
|
||||
void crypto_hash_write(struct crypto_hash *ch, const unsigned char *buf, size_t len)
|
||||
{
|
||||
ch->write(ch, buf, len);
|
||||
ch->write(ch, buf, len);
|
||||
}
|
||||
|
||||
unsigned char *crypto_hash_read(struct crypto_hash *ch)
|
||||
{
|
||||
return ch->read(ch);
|
||||
return ch->read(ch);
|
||||
}
|
||||
|
||||
size_t crypto_hash_get_size(const struct crypto_hash *ch)
|
||||
{
|
||||
return ch->get_size(ch);
|
||||
return ch->get_size(ch);
|
||||
}
|
||||
|
||||
struct crypto_pk *crypto_pk_open(enum crypto_algo_pk pk, ...)
|
||||
{
|
||||
struct crypto_pk *cp;
|
||||
va_list vl;
|
||||
struct crypto_pk *cp;
|
||||
va_list vl;
|
||||
|
||||
if (!crypto_init())
|
||||
return NULL;
|
||||
if (!crypto_init())
|
||||
return NULL;
|
||||
|
||||
va_start(vl, pk);
|
||||
cp = crypto_backend->pk_open(pk, vl);
|
||||
va_end(vl);
|
||||
va_start(vl, pk);
|
||||
cp = crypto_backend->pk_open(pk, vl);
|
||||
va_end(vl);
|
||||
|
||||
if (cp)
|
||||
cp->algo = pk;
|
||||
if (cp)
|
||||
cp->algo = pk;
|
||||
|
||||
return cp;
|
||||
return cp;
|
||||
}
|
||||
|
||||
struct crypto_pk *crypto_pk_open_priv(enum crypto_algo_pk pk, ...)
|
||||
{
|
||||
struct crypto_pk *cp;
|
||||
va_list vl;
|
||||
struct crypto_pk *cp;
|
||||
va_list vl;
|
||||
|
||||
if (!crypto_init())
|
||||
return NULL;
|
||||
if (!crypto_init())
|
||||
return NULL;
|
||||
|
||||
if (!crypto_backend->pk_open_priv)
|
||||
return NULL;
|
||||
if (!crypto_backend->pk_open_priv)
|
||||
return NULL;
|
||||
|
||||
va_start(vl, pk);
|
||||
cp = crypto_backend->pk_open_priv(pk, vl);
|
||||
va_end(vl);
|
||||
va_start(vl, pk);
|
||||
cp = crypto_backend->pk_open_priv(pk, vl);
|
||||
va_end(vl);
|
||||
|
||||
if (cp)
|
||||
cp->algo = pk;
|
||||
if (cp)
|
||||
cp->algo = pk;
|
||||
|
||||
return cp;
|
||||
return cp;
|
||||
}
|
||||
|
||||
struct crypto_pk *crypto_pk_genkey(enum crypto_algo_pk pk, ...)
|
||||
{
|
||||
struct crypto_pk *cp;
|
||||
va_list vl;
|
||||
struct crypto_pk *cp;
|
||||
va_list vl;
|
||||
|
||||
if (!crypto_init())
|
||||
return NULL;
|
||||
if (!crypto_init())
|
||||
return NULL;
|
||||
|
||||
if (!crypto_backend->pk_genkey)
|
||||
return NULL;
|
||||
if (!crypto_backend->pk_genkey)
|
||||
return NULL;
|
||||
|
||||
va_start(vl, pk);
|
||||
cp = crypto_backend->pk_genkey(pk, vl);
|
||||
va_end(vl);
|
||||
va_start(vl, pk);
|
||||
cp = crypto_backend->pk_genkey(pk, vl);
|
||||
va_end(vl);
|
||||
|
||||
if (cp)
|
||||
cp->algo = pk;
|
||||
if (cp)
|
||||
cp->algo = pk;
|
||||
|
||||
return cp;
|
||||
return cp;
|
||||
}
|
||||
|
||||
void crypto_pk_close(struct crypto_pk *cp)
|
||||
{
|
||||
cp->close(cp);
|
||||
cp->close(cp);
|
||||
}
|
||||
|
||||
unsigned char *crypto_pk_encrypt(const struct crypto_pk *cp, const unsigned char *buf, size_t len, size_t *clen)
|
||||
{
|
||||
return cp->encrypt(cp, buf, len, clen);
|
||||
return cp->encrypt(cp, buf, len, clen);
|
||||
}
|
||||
|
||||
unsigned char *crypto_pk_decrypt(const struct crypto_pk *cp, const unsigned char *buf, size_t len, size_t *clen)
|
||||
{
|
||||
if (!cp->decrypt) {
|
||||
*clen = 0;
|
||||
if (!cp->decrypt) {
|
||||
*clen = 0;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return cp->decrypt(cp, buf, len, clen);
|
||||
return cp->decrypt(cp, buf, len, clen);
|
||||
}
|
||||
|
||||
enum crypto_algo_pk crypto_pk_get_algo(const struct crypto_pk *cp)
|
||||
{
|
||||
if (!cp)
|
||||
return PK_INVALID;
|
||||
if (!cp)
|
||||
return PK_INVALID;
|
||||
|
||||
return cp->algo;
|
||||
return cp->algo;
|
||||
}
|
||||
|
||||
size_t crypto_pk_get_nbits(const struct crypto_pk *cp)
|
||||
{
|
||||
if (!cp->get_nbits)
|
||||
return 0;
|
||||
if (!cp->get_nbits)
|
||||
return 0;
|
||||
|
||||
return cp->get_nbits(cp);
|
||||
return cp->get_nbits(cp);
|
||||
}
|
||||
|
||||
unsigned char *crypto_pk_get_parameter(const struct crypto_pk *cp, unsigned param, size_t *plen)
|
||||
{
|
||||
*plen = 0;
|
||||
*plen = 0;
|
||||
|
||||
if (!cp->get_parameter)
|
||||
return NULL;
|
||||
if (!cp->get_parameter)
|
||||
return NULL;
|
||||
|
||||
return cp->get_parameter(cp, param, plen);
|
||||
return cp->get_parameter(cp, param, plen);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue