mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 22:03:42 -07:00
mpi_get_uint
This commit is contained in:
parent
88d42a1af5
commit
b1145ba577
1 changed files with 10 additions and 1 deletions
|
@ -64,6 +64,15 @@ int bitand_is_zero( mbedtls_mpi* a, mbedtls_mpi* b ) {
|
|||
}
|
||||
|
||||
|
||||
mbedtls_mpi_uint mpi_get_uint(const mbedtls_mpi *X) {
|
||||
|
||||
if (X->n == 1) {
|
||||
return X->p[0];
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool emv_rocacheck(char *modulus) {
|
||||
|
||||
mbedtls_mpi *t_modulus = NULL;
|
||||
|
@ -93,7 +102,7 @@ bool emv_rocacheck(char *modulus) {
|
|||
|
||||
MBEDTLS_MPI_CHK( mbedtls_mpi_mod_mpi(t_temp, t_modulus, t_prime) );
|
||||
|
||||
MBEDTLS_MPI_CHK( mbedtls_mpi_shift_l(g_one, t_temp) );
|
||||
MBEDTLS_MPI_CHK( mbedtls_mpi_shift_l(g_one, mpi_get_uint(t_temp)) );
|
||||
|
||||
if (bitand_is_zero(t_temp, g_prints[i])) {
|
||||
PrintAndLogEx(FAILED, "No fingerprint found\n");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue