Cryptography

PyHmac

The hmac module for keyed message authentication. compare_digest is the only constant-time comparison helper — using ordinary == for MAC comparison is a timing-attack sink.

1 sanitizer

Sanitizers

.compare_digest()Sanitizer
#
Signature
hmac.compare_digest(a, b) -> bool

Constant-time comparison. Sanitizer for signature verification flows.

tracks:return

Other Methods

.new()Neutral
#
Signature
hmac.new(key: bytes, msg: bytes = None, digestmod='') -> HMAC

Creates an HMAC instance. Neutral.

Fully-Qualified Names

FQNField
hmacfqns[0]

Wrong FQN → 0 findings. Verify with: change fqns to garbage → must produce 0 results.

Import

rule.py
from codepathfinder.go_rule import PyHmac