sha256 computability class
Is it correct to say that since the SHA256 function domain is finite we can build a DFA that calculates this function (i.e. trivially a giant lookup table)?


Theoretically, yes, that's correct. It would require a lookup table of  $2^{2^{64}}$ entries, roughly, encoded as a DFA.

To be more picky, it depends on the notion of "DFA calculating a partial function". In particular, on what we require the DFA to do outside the domain of the function.

If we require non-termination, as we do for TMs, then a DFA can never implement a non-total function since it can not diverge. So, no DFA can compute SHA256.

If we instead only require to reach an "error" state outside the domain (or no requirement at all), then a DFA can compute SHA256.

I'd lean towards the latter interpretation, but here we need indeed to be a little careful with words.


  Furthermore, if we eliminate the limitation on the length of the input, is it correct to say that SHA256 function belongs to the class of $\mathcal{PR}$ primitive recursive functions?


That's correct.

As a general "cannon" result, if an algorithm $A$ has a complexity function which is bounded above by some $\mathcal{PR}$ function $f$, then $A$ implements a function which belongs to $\mathcal{PR}$.

This is because in $\mathcal{PR}$ we can realize the single-step function for TM, mapping a TM configuration to its next one. Then we can recurse on the single-stepping function $f(n)$ times, and read the result in the final configuration.

Corollary: $TIME(O(2^{2^{2^{2^n}}})) \subseteq \mathcal{PR}$.

The unlimited SHA256 surely falls in that obscene time bound.