projects
/
proxmark3-svn
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #304 from pwpiwi/fix_nethunter
[proxmark3-svn]
/
common
/
crapto1
/
crypto1.c
diff --git
a/common/crapto1/crypto1.c
b/common/crapto1/crypto1.c
index a3f64a9f36a4fec38922f59cf76d63869a752529..19b71cbb1f455ef605104be7d1177721c3502b46 100644
(file)
--- a/
common/crapto1/crypto1.c
+++ b/
common/crapto1/crypto1.c
@@
-18,12
+18,14
@@
Copyright (C) 2008-2008 bla <blapost@gmail.com>
*/
#include "crapto1.h"
Copyright (C) 2008-2008 bla <blapost@gmail.com>
*/
#include "crapto1.h"
+
#include <stdlib.h>
#include <stdlib.h>
+#include "parity.h"
#define SWAPENDIAN(x)\
(x = (x >> 8 & 0xff00ff) | (x & 0xff00ff) << 8, x = x >> 16 | x << 16)
#define SWAPENDIAN(x)\
(x = (x >> 8 & 0xff00ff) | (x & 0xff00ff) << 8, x = x >> 16 | x << 16)
-#if defined(__arm__) && !defined(__linux__) && !defined(_WIN32)
// bare metal ARM
lacks malloc()/free()
+#if defined(__arm__) && !defined(__linux__) && !defined(_WIN32)
&& !defined(__APPLE__) // bare metal ARM Proxmark
lacks malloc()/free()
void crypto1_create(struct Crypto1State *s, uint64_t key)
{
int i;
void crypto1_create(struct Crypto1State *s, uint64_t key)
{
int i;
@@
-73,7
+75,7
@@
uint8_t crypto1_bit(struct Crypto1State *s, uint8_t in, int is_encrypted)
feedin ^= !!in;
feedin ^= LF_POLY_ODD & s->odd;
feedin ^= LF_POLY_EVEN & s->even;
feedin ^= !!in;
feedin ^= LF_POLY_ODD & s->odd;
feedin ^= LF_POLY_EVEN & s->even;
- s->even = s->even << 1 |
parity
(feedin);
+ s->even = s->even << 1 |
evenparity32
(feedin);
t = s->odd, s->odd = s->even, s->even = t;
t = s->odd, s->odd = s->even, s->even = t;
Impressum
,
Datenschutz