This is done by three algorithms:
first: PBKDF2 to get the PMK from ESSID and PSK (on all versions WPA1, WPA2, WPA2 keyversion 3)
PMK = PBKDF2(HMAC−SHA1, passphrase, ssid, 4096, 256)
second: HMAC to get the PTK from PMK, MAC_AP, MAC_CLIENT, ANONCE and SNONCE
HMAC-SHA1 to get the PTK (WPA1 and WPA2)
HMAC-SHA256 to get the PTK (WPA2 keyversion 3)
third: (HMAC or CMAC) to get the MIC (from PTK and entire EAPOL_CLIENT message [M2])
HMAC-MD5 to get the MIC (WPA1)
HMAC-SHA1 to get the MIC (WPA2)
CMAC AEC-128CBC toe get the MIC (WPA2 key version 3))
After this, the calculated MIC is compared to the MIC in field 3 of the hash line. If it matches, the PSK is correct.
first: PBKDF2 to get the PMK from ESSID and PSK (on all versions WPA1, WPA2, WPA2 keyversion 3)
PMK = PBKDF2(HMAC−SHA1, passphrase, ssid, 4096, 256)
second: HMAC to get the PTK from PMK, MAC_AP, MAC_CLIENT, ANONCE and SNONCE
HMAC-SHA1 to get the PTK (WPA1 and WPA2)
HMAC-SHA256 to get the PTK (WPA2 keyversion 3)
third: (HMAC or CMAC) to get the MIC (from PTK and entire EAPOL_CLIENT message [M2])
HMAC-MD5 to get the MIC (WPA1)
HMAC-SHA1 to get the MIC (WPA2)
CMAC AEC-128CBC toe get the MIC (WPA2 key version 3))
After this, the calculated MIC is compared to the MIC in field 3 of the hash line. If it matches, the PSK is correct.