diff --git a/backends/twitter/libtwitcurl/HMAC_SHA1.cpp b/backends/twitter/libtwitcurl/HMAC_SHA1.cpp index 5382782e610612e3d9d029e18f533044c8e06508..9ed68144e2ab8f5b27787bbd30d1383b2366dcbc 100644 --- a/backends/twitter/libtwitcurl/HMAC_SHA1.cpp +++ b/backends/twitter/libtwitcurl/HMAC_SHA1.cpp @@ -1,64 +1,64 @@ -//****************************************************************************** -//* HMAC_SHA1.cpp : Implementation of HMAC SHA1 algorithm -//* Comfort to RFC 2104 -//* -//****************************************************************************** -#include "HMAC_SHA1.h" -#include -#include - - -void CHMAC_SHA1::HMAC_SHA1(BYTE *text, int text_len, BYTE *key, int key_len, BYTE *digest) -{ - memset(SHA1_Key, 0, SHA1_BLOCK_SIZE); - - /* repeated 64 times for values in ipad and opad */ - memset(m_ipad, 0x36, sizeof(m_ipad)); - memset(m_opad, 0x5c, sizeof(m_opad)); - - /* STEP 1 */ - if (key_len > SHA1_BLOCK_SIZE) - { - CSHA1::Reset(); - CSHA1::Update((UINT_8 *)key, key_len); - CSHA1::Final(); - - CSHA1::GetHash((UINT_8 *)SHA1_Key); - } - else - memcpy(SHA1_Key, key, key_len); - - /* STEP 2 */ - for (size_t i=0; i +#include + + +void CHMAC_SHA1::HMAC_SHA1(BYTE *text, int text_len, BYTE *key, int key_len, BYTE *digest) +{ + memset(SHA1_Key, 0, SHA1_BLOCK_SIZE); + + /* repeated 64 times for values in ipad and opad */ + memset(m_ipad, 0x36, sizeof(m_ipad)); + memset(m_opad, 0x5c, sizeof(m_opad)); + + /* STEP 1 */ + if (key_len > SHA1_BLOCK_SIZE) + { + CSHA1::Reset(); + CSHA1::Update((UINT_8 *)key, key_len); + CSHA1::Final(); + + CSHA1::GetHash((UINT_8 *)SHA1_Key); + } + else + memcpy(SHA1_Key, key, key_len); + + /* STEP 2 */ + for (size_t i=0; i