mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 22:03:42 -07:00
added mpi print
This commit is contained in:
parent
f1cd108b1a
commit
05814fbe75
1 changed files with 10 additions and 0 deletions
|
@ -73,6 +73,15 @@ mbedtls_mpi_uint mpi_get_uint(const mbedtls_mpi *X) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void print_mpi(const char *msg, int radix, const mbedtls_mpi *X) {
|
||||||
|
|
||||||
|
char Xchar[400] = {0};
|
||||||
|
size_t len = 0;
|
||||||
|
|
||||||
|
mbedtls_mpi_write_string(X, radix, Xchar, sizeof(Xchar), &len);
|
||||||
|
printf("%s[%d] %s\n", msg, len, Xchar);
|
||||||
|
}
|
||||||
|
|
||||||
bool emv_rocacheck(const unsigned char *buf, size_t buflen) {
|
bool emv_rocacheck(const unsigned char *buf, size_t buflen) {
|
||||||
|
|
||||||
mbedtls_mpi t_modulus;
|
mbedtls_mpi t_modulus;
|
||||||
|
@ -83,6 +92,7 @@ bool emv_rocacheck(const unsigned char *buf, size_t buflen) {
|
||||||
rocacheck_init();
|
rocacheck_init();
|
||||||
|
|
||||||
MBEDTLS_MPI_CHK( mbedtls_mpi_read_binary(&t_modulus, buf, buflen) );
|
MBEDTLS_MPI_CHK( mbedtls_mpi_read_binary(&t_modulus, buf, buflen) );
|
||||||
|
print_mpi("--t_modulus:", 16, &t_modulus);
|
||||||
|
|
||||||
|
|
||||||
for (int i = 0; i < ROCA_PRINTS_LENGTH; i++) {
|
for (int i = 0; i < ROCA_PRINTS_LENGTH; i++) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue