@classmethod<EOL><INDENT>def hkdf(self, chaining_key, input_key_material, dhlen=<NUM_LIT:64>):<DEDENT>
if len(chaining_key) != self.HASHLEN:<EOL><INDENT>raise HashError("<STR_LIT>")<EOL><DEDENT>if len(input_key_material) not in (<NUM_LIT:0>, <NUM_LIT:32>, dhlen):<EOL><INDENT>raise HashError("<STR_LIT>")<EOL><DEDENT>temp_key = self.hmac_hash(chaining_key, input_key_material)<EOL>output1 = self.hmac_hash(temp_key, b'<STR_LIT>')<EOL>output2 = self.hmac_hash(temp_key, output1 + b'<STR_LIT>')<EOL>return output1, output2<EOL>
Hash-based key derivation function

        Takes a ``chaining_key'' byte sequence of len HASHLEN, and an
        ``input_key_material'' byte sequence with length either zero
        bytes, 32 bytes or dhlen bytes.

        Returns two byte sequences of length HASHLEN