Resolved error bits/byte during elaboration of KDF function and now the code works