Hi,

As per RFC5246 - the TLS1.2 uses SHA256, SHA384 MAC.
I would appreciate any pointers on how the PRF is implemented for TLS1.2.

E.g. For TLS1.0, TLS1.1 - the HMAC-SHA1 is implemented as below. And SHA-1 uses 
20bytes at a time.
How many bytes SHA256 uses at a time?

// First initialize the input and output to 0x36 and 0x5C respectively
        for (i = 0; i < 64; i++) {
                k_ipad[i] ^= 0x36;
                k_opad[i] ^= 0x5C;
        }

        /* SHA1(key XOR ipad, text);    */
        SHA1_Init(&context);
        SHA1_Update(&context, k_ipad, 64);
        SHA1_Update(&context, text, text_len);
        SHA1_Final(outbuf, &context);

        /* SHA1(key XOR opad, SHA1(key XOR ipad, text))*/
        SHA1_Init(&context);
        SHA1_Update(&context, k_opad, 64);
        SHA1_Update(&context, outbuf, 20);
        SHA1_Final(outbuf, &context);

Could someone please advice how is HMAC-SHA256 implemented? 

--
Thanks,
Nilesh
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           majord...@openssl.org

Reply via email to