mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-20 13:23:51 -07:00
emv_rocacheck
This commit is contained in:
parent
9804526dca
commit
ab41b4a991
3 changed files with 4 additions and 4 deletions
|
@ -25,6 +25,7 @@
|
||||||
#include "cmdmain.h"
|
#include "cmdmain.h"
|
||||||
#include "emvcore.h"
|
#include "emvcore.h"
|
||||||
#include "apduinfo.h"
|
#include "apduinfo.h"
|
||||||
|
#include "emv_roca.h"
|
||||||
|
|
||||||
int CmdEMV(const char *Cmd);
|
int CmdEMV(const char *Cmd);
|
||||||
|
|
||||||
|
|
|
@ -73,7 +73,7 @@ mbedtls_mpi_uint mpi_get_uint(const mbedtls_mpi *X) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool emv_rocacheck(char *modulus) {
|
bool emv_rocacheck(const unsigned char *buf, size_t buflen) {
|
||||||
|
|
||||||
mbedtls_mpi *t_modulus = NULL;
|
mbedtls_mpi *t_modulus = NULL;
|
||||||
mbedtls_mpi_init(t_modulus);
|
mbedtls_mpi_init(t_modulus);
|
||||||
|
@ -82,8 +82,7 @@ bool emv_rocacheck(char *modulus) {
|
||||||
|
|
||||||
rocacheck_init();
|
rocacheck_init();
|
||||||
|
|
||||||
//
|
MBEDTLS_MPI_CHK( mbedtls_mpi_read_binary(t_modulus, buf, buflen) );
|
||||||
MBEDTLS_MPI_CHK( mbedtls_mpi_read_string(t_modulus, 10, modulus) );
|
|
||||||
|
|
||||||
|
|
||||||
for (int i = 0; i < ROCA_PRINTS_LENGTH; i++) {
|
for (int i = 0; i < ROCA_PRINTS_LENGTH; i++) {
|
||||||
|
|
|
@ -35,7 +35,7 @@ void rocacheck_init(void);
|
||||||
void rocacheck_cleanup(void);
|
void rocacheck_cleanup(void);
|
||||||
int bitand_is_zero( mbedtls_mpi* a, mbedtls_mpi* b );
|
int bitand_is_zero( mbedtls_mpi* a, mbedtls_mpi* b );
|
||||||
|
|
||||||
extern bool emv_rocacheck( char *modulus );
|
extern bool emv_rocacheck( const unsigned char *buf, size_t buflen );
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue