import hmac
import hashlib


def hmac_hash256(key: bytes, msg: bytes) -> bytes:
    """Return bytes of hmac using hash256."""
    h = hmac.new(key, msg, digestmod=hashlib.sha256)
    return h.digest()