2010-09-08 00:17 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* src/rtl/sha1.c
* src/rtl/sha1.h
* src/rtl/hbsha1hm.c
* src/rtl/sha2.c
* src/rtl/sha2.h
* src/rtl/hbsha2hm.c
* src/rtl/sha1hmac.c
* src/rtl/sha1hmac.h
* src/rtl/hbsha1.c
* src/rtl/sha2hmac.c
* src/rtl/sha2hmac.h
* src/rtl/hbsha2.c
! Renamed internal SHA functions to have hb_ prefix to
avoid colliding with other tools, like OpenSSL.
* utils/hbmk2/hbmk2.prg
! Typos in comment.
This commit is contained in:
@@ -16,6 +16,25 @@
|
||||
The license applies to all entries newer than 2009-04-28.
|
||||
*/
|
||||
|
||||
2010-09-08 00:17 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
|
||||
* src/rtl/sha1.c
|
||||
* src/rtl/sha1.h
|
||||
* src/rtl/hbsha1hm.c
|
||||
* src/rtl/sha2.c
|
||||
* src/rtl/sha2.h
|
||||
* src/rtl/hbsha2hm.c
|
||||
* src/rtl/sha1hmac.c
|
||||
* src/rtl/sha1hmac.h
|
||||
* src/rtl/hbsha1.c
|
||||
* src/rtl/sha2hmac.c
|
||||
* src/rtl/sha2hmac.h
|
||||
* src/rtl/hbsha2.c
|
||||
! Renamed internal SHA functions to have hb_ prefix to
|
||||
avoid colliding with other tools, like OpenSSL.
|
||||
|
||||
* utils/hbmk2/hbmk2.prg
|
||||
! Typos in comment.
|
||||
|
||||
2010-09-07 09:30 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com)
|
||||
* contrib/hbqt/qtcore/hbqt_hbslots.cpp
|
||||
! Minor typo.
|
||||
@@ -30,8 +49,8 @@
|
||||
* contrib/hbide/idemisc.prg
|
||||
* contrib/hbide/ideprojmanager.prg
|
||||
+ Implemented: first error reported by hbMK2 when a project is built,
|
||||
is made visible in the "Output Console" after compile/link cycle is
|
||||
finished. This facilitates to track errors instantly without naviaging
|
||||
is made visible in the "Output Console" after compile/link cycle is
|
||||
finished. This facilitates to track errors instantly without naviaging
|
||||
the contents of output console.
|
||||
|
||||
2010-09-07 09:16 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
|
||||
@@ -70,9 +89,9 @@
|
||||
2010-09-07 00:10 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
|
||||
* src/compiler/hbcomp.c
|
||||
! Revisiting non-*nix stdout/stderr usage in compiler.
|
||||
From now on the Clipper (and old MS-DOS/Windows tool)
|
||||
compatible behavior is only maintained for MS-DOS Harbour
|
||||
builds, for the rest error messages are output to stderr,
|
||||
From now on the Clipper (and old MS-DOS/Windows tool)
|
||||
compatible behavior is only maintained for MS-DOS Harbour
|
||||
builds, for the rest error messages are output to stderr,
|
||||
regular msgs are output to stdout.
|
||||
|
||||
2010-09-06 23:44 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
|
||||
@@ -106,12 +125,12 @@
|
||||
! One of the main-menu prompt constructed differently.
|
||||
|
||||
* contrib/hbide/hbqreportsmanager.prg
|
||||
+ HbqReportsManager() class is split in two to manage graphic objects
|
||||
+ HbqReportsManager() class is split in two to manage graphic objects
|
||||
more efficiently.
|
||||
|
||||
+ Implemented: Reports Manager - all graphics items drawn on .prg levels.
|
||||
|
||||
This implementation has cleans all c++ code responsible to draw
|
||||
This implementation has cleans all c++ code responsible to draw
|
||||
graphics primitives, and hance greatly reducing the c++ dependancy.
|
||||
More c++ => prg conversion is on the cards.
|
||||
|
||||
@@ -131,12 +150,12 @@
|
||||
|
||||
2010-09-03 21:19 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com)
|
||||
* contrib/hbqt/utils/hbqtgen.prg
|
||||
+ Implemented: QIcon() as a parameter now can be supplied as
|
||||
+ Implemented: QIcon() as a parameter now can be supplied as
|
||||
filename, resource name, or constructed QIcon() as pointer.
|
||||
Notified at HMG forums.
|
||||
|
||||
Since begining QIcon is passed as a string only. I do not
|
||||
remember why I did it like that but it was very limiting,
|
||||
Since begining QIcon is passed as a string only. I do not
|
||||
remember why I did it like that but it was very limiting,
|
||||
though it solved our purpose well.
|
||||
|
||||
* contrib/hbqt/qtgui/g/QAbstractButton.cpp
|
||||
@@ -164,11 +183,11 @@
|
||||
|
||||
2010-09-03 19:03 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com)
|
||||
* contrib/hbide/hbqreportsmanager.prg
|
||||
! More c++ => .prg.
|
||||
! More c++ => .prg.
|
||||
|
||||
2010-09-02 19:11 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com)
|
||||
* contrib/hbide/hbqreportsmanager.prg
|
||||
! c++ => .prg.
|
||||
! c++ => .prg.
|
||||
|
||||
2010-09-01 18:45 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com)
|
||||
+ contrib/hbqt/qtgui/doc/en/class_qdoublevalidator.txt
|
||||
@@ -203,11 +222,11 @@
|
||||
2010-08-31 14:06 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com)
|
||||
* contrib/hbxbp/xbpparthandler.prg
|
||||
* contrib/hbxbp/xbpwindow.prg
|
||||
! :status() more synchronized.
|
||||
! :status() more synchronized.
|
||||
NIL => Not initialized.
|
||||
XBP_STAT_INIT => Object is initialized.
|
||||
XBP_STAT_CREATE => Object creation is successful.
|
||||
XBP_STAT_FAILURE => Object creation is either failed or
|
||||
XBP_STAT_FAILURE => Object creation is either failed or
|
||||
object is destroyed.
|
||||
|
||||
2010-08-31 13:55 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com)
|
||||
@@ -328,7 +347,7 @@
|
||||
* utils/hbmk2/hbmk2.prg
|
||||
+ Switched .po files to UTF-8.
|
||||
+ Set svn:mime-type accordingly.
|
||||
; NOTE: Make sure to use UTF-8 aware editor to edit these files
|
||||
; NOTE: Make sure to use UTF-8 aware editor to edit these files
|
||||
from now on. These are the first UTF-8 files in hb repo.
|
||||
|
||||
* INSTALL
|
||||
@@ -342,7 +361,7 @@
|
||||
* contrib/hbqt/qtgui/hbqt_hbqgraphicsitem.cpp
|
||||
* contrib/hbqt/qtgui/hbqt_hbqgraphicsscene.cpp
|
||||
* contrib/hbide/hbqreportsmanager.prg
|
||||
+ Advanced: Report's save/load artifacts.
|
||||
+ Advanced: Report's save/load artifacts.
|
||||
+ Context-menu on scene areas where no item is under cursor.
|
||||
+ ObjectsTree without any item highlighted if no item is visible selected in the scene.
|
||||
|
||||
@@ -363,7 +382,7 @@
|
||||
2010-08-27 15:49 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
|
||||
* src/rtl/hbi18n2.prg
|
||||
* utils/hbmk2/hbmk2.prg
|
||||
+ UTF8 BOM logic contained in core. Should fix it for all
|
||||
+ UTF8 BOM logic contained in core. Should fix it for all
|
||||
cases in hbmk2 and hbi18n.
|
||||
|
||||
2010-08-27 15:33 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
|
||||
@@ -388,7 +407,7 @@
|
||||
* contrib/hbide/ideprojmanager.prg
|
||||
* contrib/hbide/ideshortcuts.prg
|
||||
* contrib/hbide/idethemes.prg
|
||||
! 2nd round of Slots/Events reforms.
|
||||
! 2nd round of Slots/Events reforms.
|
||||
Still some margin of regression is possible. Please report.
|
||||
|
||||
* contrib/hbqt/qtgui/THbQtUI.prg
|
||||
@@ -403,11 +422,11 @@
|
||||
* contrib/hbqt/qtcore/g/TQObject.prg
|
||||
* contrib/hbqt/qtcore/qth/QObject.qth
|
||||
* contrib/hbqt/qtgui/THbQtUI.prg
|
||||
|
||||
|
||||
* contrib/hbxbp/xbpbrowse.prg
|
||||
* contrib/hbxbp/xbpdialog.prg
|
||||
* contrib/hbxbp/xbpwindow.prg
|
||||
|
||||
|
||||
% First regression fix - ::connect() was defined in more classes than required.
|
||||
|
||||
2010-08-26 18:15 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com)
|
||||
@@ -467,7 +486,7 @@
|
||||
* contrib/hbxbp/xbptreeview.prg
|
||||
* contrib/hbxbp/xbpwindow.prg
|
||||
+ Adopted to latest Slots/Events protocol.
|
||||
|
||||
|
||||
WARNING: regression is highly possible, please report any errors.
|
||||
|
||||
2010-08-27 00:40 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
|
||||
@@ -516,8 +535,8 @@
|
||||
2010-08-25 15:48 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com)
|
||||
* contrib/hbqt/qtcore/hbqt_misc.prg
|
||||
+ Implemented: object local "Slots" and "Events" management.
|
||||
Now no need to setup slots and events variable. These are
|
||||
automatically created on demand.
|
||||
Now no need to setup slots and events variable. These are
|
||||
automatically created on demand.
|
||||
|
||||
EVENTS:
|
||||
oWnd := QMainWindow():new()
|
||||
@@ -551,7 +570,7 @@
|
||||
Also made this class totally independant to hbIDE engine.
|
||||
This opens up the way to shift it to hbQT itself.
|
||||
The only limitation is images. We need a way to include
|
||||
a minimal set of images in hbQT ( if it makes sense ) so that
|
||||
a minimal set of images in hbQT ( if it makes sense ) so that
|
||||
this component be invoked from any application just by supplying
|
||||
a parent to host it, just like a COM component.
|
||||
|
||||
@@ -577,7 +596,7 @@
|
||||
* contrib/hbide/idereportsmanager.prg
|
||||
+ Implemented: ideReports Manager:
|
||||
+ Landscape and Portrait page orientation at design time.
|
||||
+ Context-menu basics for objects on the page - scheduled
|
||||
+ Context-menu basics for objects on the page - scheduled
|
||||
to be expanded per type of object.
|
||||
|
||||
2010-08-25 16:24 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
|
||||
@@ -590,13 +609,13 @@
|
||||
|
||||
2010-08-25 15:57 UTC+0300 Mindaugas Kavaliauskas (dbtopas/at/dbtopas.lt)
|
||||
* harbour/contrib/sddmy/sddmy.c
|
||||
* extended RDDINFO( RDDI_CONNECT, ) to support all parameters of MySql
|
||||
* extended RDDINFO( RDDI_CONNECT, ) to support all parameters of MySql
|
||||
connect, i.e. port, unix socket name, and client flags were added.
|
||||
|
||||
2010-08-25 09:44 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
|
||||
* package/mpkg_win_nightly.bat
|
||||
+ Upload logs even if build failed.
|
||||
; NOTE: On current build machine mingw suffers transient "segmentation
|
||||
; NOTE: On current build machine mingw suffers transient "segmentation
|
||||
fault" failures. It may be a sign of hardware or OS problem.
|
||||
This means missing nightly binaries for no apparent reason.
|
||||
|
||||
@@ -616,21 +635,21 @@
|
||||
|
||||
* contrib/hbide/idemisc.prg
|
||||
* contrib/hbide/idereportsmanager.prg
|
||||
+ Implemented: ideReports Manager:
|
||||
+ Implemented: ideReports Manager:
|
||||
* "Objects" tree now showsup type of object icon.
|
||||
|
||||
* Rotate selected object clock wise and anti-clock wise.
|
||||
Currently it is 10 deg per click. Later an interface
|
||||
Currently it is 10 deg per click. Later an interface
|
||||
to rotate precisely to be introduced.
|
||||
|
||||
Rotated objects keep the exact aspect ratio. This is
|
||||
Rotated objects keep the exact aspect ratio. This is
|
||||
testified on barcode which reads the correct string
|
||||
after 90, 180, 270 and 360 deg rotation.
|
||||
|
||||
* Atarted API to separate this component from direct calls
|
||||
* Atarted API to separate this component from direct calls
|
||||
to hbIDE to gather various info from the application.
|
||||
Right now these are the images which now call app_image()
|
||||
instead of hbide_image(). app_image() function will
|
||||
instead of hbide_image(). app_image() function will
|
||||
reside in application so that this class be linked with
|
||||
application independently of hbIDE.
|
||||
|
||||
@@ -643,18 +662,18 @@
|
||||
* contrib/hbqt/qtgui/qth/HBQGraphicsItem.qth
|
||||
* contrib/hbide/idereportsmanager.prg
|
||||
+ Implemented: ideReport Designer:
|
||||
* Barcode 3of9 - the code belongs to someone I have no
|
||||
idea now. Please speak out who he is so that I post
|
||||
* Barcode 3of9 - the code belongs to someone I have no
|
||||
idea now. Please speak out who he is so that I post
|
||||
due credit to him. I had adopted this code for Vouch32
|
||||
family of libraries many years back. Now adopted to
|
||||
hbQT + hbIDE.
|
||||
family of libraries many years back. Now adopted to
|
||||
hbQT + hbIDE.
|
||||
|
||||
* Simple bar-chart.
|
||||
|
||||
Both above implementations are quick ones and I see a
|
||||
lot of avenues for improvement which are scheduled to
|
||||
* Simple bar-chart.
|
||||
|
||||
Both above implementations are quick ones and I see a
|
||||
lot of avenues for improvement which are scheduled to
|
||||
be addressed later.
|
||||
|
||||
|
||||
2010-08-24 11:16 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
|
||||
* harbour/contrib/hbwin/olecore.c
|
||||
! added missing call to Release() method in __OleGetActiveObject()
|
||||
|
||||
@@ -59,7 +59,7 @@ HB_FUNC( HB_SHA1 )
|
||||
sha1_byte digest[ SHA1_DIGEST_LENGTH ];
|
||||
SHA_CTX ctx;
|
||||
|
||||
SHA1_Init( &ctx );
|
||||
hb_SHA1_Init( &ctx );
|
||||
|
||||
#if HB_SIZE_MAX > UINT_MAX
|
||||
{
|
||||
@@ -82,16 +82,16 @@ HB_FUNC( HB_SHA1 )
|
||||
nCount = 0;
|
||||
}
|
||||
|
||||
SHA1_Update( &ctx, buffer + nDone, uiChunk );
|
||||
hb_SHA1_Update( &ctx, buffer + nDone, uiChunk );
|
||||
|
||||
nDone += ( HB_SIZE ) uiChunk;
|
||||
}
|
||||
}
|
||||
#else
|
||||
SHA1_Update( &ctx, hb_parcx( 1 ), hb_parclen( 1 ) );
|
||||
hb_SHA1_Update( &ctx, hb_parcx( 1 ), hb_parclen( 1 ) );
|
||||
#endif
|
||||
|
||||
SHA1_Final( digest, &ctx );
|
||||
hb_SHA1_Final( digest, &ctx );
|
||||
|
||||
if( ! hb_parl( 2 ) )
|
||||
{
|
||||
|
||||
@@ -59,7 +59,7 @@ HB_FUNC( HB_HMAC_SHA1 )
|
||||
unsigned char mac[ HMAC_SHA1_DIGEST_LENGTH ];
|
||||
HMAC_SHA1_CTX ctx;
|
||||
|
||||
HMAC_SHA1_Init( &ctx );
|
||||
hb_HMAC_SHA1_Init( &ctx );
|
||||
#if HB_SIZE_MAX > UINT_MAX
|
||||
{
|
||||
const char * buffer = hb_parcx( 2 );
|
||||
@@ -81,17 +81,17 @@ HB_FUNC( HB_HMAC_SHA1 )
|
||||
nCount = 0;
|
||||
}
|
||||
|
||||
HMAC_SHA1_UpdateKey( &ctx, buffer + nDone, uiChunk );
|
||||
hb_HMAC_SHA1_UpdateKey( &ctx, buffer + nDone, uiChunk );
|
||||
|
||||
nDone += ( HB_SIZE ) uiChunk;
|
||||
}
|
||||
}
|
||||
#else
|
||||
HMAC_SHA1_UpdateKey( &ctx, hb_parcx( 2 ), hb_parclen( 2 ) );
|
||||
hb_HMAC_SHA1_UpdateKey( &ctx, hb_parcx( 2 ), hb_parclen( 2 ) );
|
||||
#endif
|
||||
HMAC_SHA1_EndKey( &ctx );
|
||||
hb_HMAC_SHA1_EndKey( &ctx );
|
||||
|
||||
HMAC_SHA1_StartMessage( &ctx );
|
||||
hb_HMAC_SHA1_StartMessage( &ctx );
|
||||
#if HB_SIZE_MAX > UINT_MAX
|
||||
{
|
||||
const char * buffer = hb_parcx( 1 );
|
||||
@@ -113,16 +113,16 @@ HB_FUNC( HB_HMAC_SHA1 )
|
||||
nCount = 0;
|
||||
}
|
||||
|
||||
HMAC_SHA1_UpdateMessage( &ctx, buffer + nDone, uiChunk );
|
||||
hb_HMAC_SHA1_UpdateMessage( &ctx, buffer + nDone, uiChunk );
|
||||
|
||||
nDone += ( HB_SIZE ) uiChunk;
|
||||
}
|
||||
}
|
||||
#else
|
||||
HMAC_SHA1_UpdateMessage( &ctx, hb_parcx( 1 ), hb_parclen( 1 ) );
|
||||
hb_HMAC_SHA1_UpdateMessage( &ctx, hb_parcx( 1 ), hb_parclen( 1 ) );
|
||||
#endif
|
||||
HMAC_SHA1_EndMessage( mac, &ctx );
|
||||
HMAC_SHA1_Done( &ctx );
|
||||
hb_HMAC_SHA1_EndMessage( mac, &ctx );
|
||||
hb_HMAC_SHA1_Done( &ctx );
|
||||
|
||||
if( ! hb_parl( 3 ) )
|
||||
{
|
||||
|
||||
@@ -59,7 +59,7 @@ HB_FUNC( HB_SHA224 )
|
||||
unsigned char digest[ SHA224_DIGEST_SIZE ];
|
||||
sha224_ctx ctx;
|
||||
|
||||
sha224_init( &ctx );
|
||||
hb_sha224_init( &ctx );
|
||||
#if HB_SIZE_MAX > UINT_MAX
|
||||
{
|
||||
const char * buffer = hb_parcx( 1 );
|
||||
@@ -81,15 +81,15 @@ HB_FUNC( HB_SHA224 )
|
||||
nCount = 0;
|
||||
}
|
||||
|
||||
sha224_update( &ctx, buffer + nDone, uiChunk );
|
||||
hb_sha224_update( &ctx, buffer + nDone, uiChunk );
|
||||
|
||||
nDone += ( HB_SIZE ) uiChunk;
|
||||
}
|
||||
}
|
||||
#else
|
||||
sha224_update( &ctx, hb_parcx( 1 ), hb_parclen( 1 ) );
|
||||
hb_sha224_update( &ctx, hb_parcx( 1 ), hb_parclen( 1 ) );
|
||||
#endif
|
||||
sha224_final( &ctx, digest );
|
||||
hb_sha224_final( &ctx, digest );
|
||||
|
||||
if( ! hb_parl( 2 ) )
|
||||
{
|
||||
@@ -106,7 +106,7 @@ HB_FUNC( HB_SHA256 )
|
||||
unsigned char digest[ SHA256_DIGEST_SIZE ];
|
||||
sha256_ctx ctx;
|
||||
|
||||
sha256_init( &ctx );
|
||||
hb_sha256_init( &ctx );
|
||||
#if HB_SIZE_MAX > UINT_MAX
|
||||
{
|
||||
const char * buffer = hb_parcx( 1 );
|
||||
@@ -128,15 +128,15 @@ HB_FUNC( HB_SHA256 )
|
||||
nCount = 0;
|
||||
}
|
||||
|
||||
sha256_update( &ctx, buffer + nDone, uiChunk );
|
||||
hb_sha256_update( &ctx, buffer + nDone, uiChunk );
|
||||
|
||||
nDone += ( HB_SIZE ) uiChunk;
|
||||
}
|
||||
}
|
||||
#else
|
||||
sha256_update( &ctx, hb_parcx( 1 ), hb_parclen( 1 ) );
|
||||
hb_sha256_update( &ctx, hb_parcx( 1 ), hb_parclen( 1 ) );
|
||||
#endif
|
||||
sha256_final( &ctx, digest );
|
||||
hb_sha256_final( &ctx, digest );
|
||||
|
||||
if( ! hb_parl( 2 ) )
|
||||
{
|
||||
@@ -153,7 +153,7 @@ HB_FUNC( HB_SHA384 )
|
||||
unsigned char digest[ SHA384_DIGEST_SIZE ];
|
||||
sha384_ctx ctx;
|
||||
|
||||
sha384_init( &ctx );
|
||||
hb_sha384_init( &ctx );
|
||||
#if HB_SIZE_MAX > UINT_MAX
|
||||
{
|
||||
const char * buffer = hb_parcx( 1 );
|
||||
@@ -175,15 +175,15 @@ HB_FUNC( HB_SHA384 )
|
||||
nCount = 0;
|
||||
}
|
||||
|
||||
sha384_update( &ctx, buffer + nDone, uiChunk );
|
||||
hb_sha384_update( &ctx, buffer + nDone, uiChunk );
|
||||
|
||||
nDone += ( HB_SIZE ) uiChunk;
|
||||
}
|
||||
}
|
||||
#else
|
||||
sha384_update( &ctx, hb_parcx( 1 ), hb_parclen( 1 ) );
|
||||
hb_sha384_update( &ctx, hb_parcx( 1 ), hb_parclen( 1 ) );
|
||||
#endif
|
||||
sha384_final( &ctx, digest );
|
||||
hb_sha384_final( &ctx, digest );
|
||||
|
||||
if( ! hb_parl( 2 ) )
|
||||
{
|
||||
@@ -200,7 +200,7 @@ HB_FUNC( HB_SHA512 )
|
||||
unsigned char digest[ SHA512_DIGEST_SIZE ];
|
||||
sha512_ctx ctx;
|
||||
|
||||
sha512_init( &ctx );
|
||||
hb_sha512_init( &ctx );
|
||||
#if HB_SIZE_MAX > UINT_MAX
|
||||
{
|
||||
const char * buffer = hb_parcx( 1 );
|
||||
@@ -222,15 +222,15 @@ HB_FUNC( HB_SHA512 )
|
||||
nCount = 0;
|
||||
}
|
||||
|
||||
sha512_update( &ctx, buffer + nDone, uiChunk );
|
||||
hb_sha512_update( &ctx, buffer + nDone, uiChunk );
|
||||
|
||||
nDone += ( HB_SIZE ) uiChunk;
|
||||
}
|
||||
}
|
||||
#else
|
||||
sha512_update( &ctx, hb_parcx( 1 ), hb_parclen( 1 ) );
|
||||
hb_sha512_update( &ctx, hb_parcx( 1 ), hb_parclen( 1 ) );
|
||||
#endif
|
||||
sha512_final( &ctx, digest );
|
||||
hb_sha512_final( &ctx, digest );
|
||||
|
||||
if( ! hb_parl( 2 ) )
|
||||
{
|
||||
|
||||
@@ -59,7 +59,7 @@ HB_FUNC( HB_HMAC_SHA224 )
|
||||
unsigned char mac[ SHA224_DIGEST_SIZE ];
|
||||
hmac_sha224_ctx ctx;
|
||||
|
||||
hmac_sha224_init( &ctx, hb_parcx( 2 ), ( unsigned int ) hb_parclen( 2 ) );
|
||||
hb_hmac_sha224_init( &ctx, hb_parcx( 2 ), ( unsigned int ) hb_parclen( 2 ) );
|
||||
#if HB_SIZE_MAX > UINT_MAX
|
||||
{
|
||||
const char * buffer = hb_parcx( 1 );
|
||||
@@ -81,15 +81,15 @@ HB_FUNC( HB_HMAC_SHA224 )
|
||||
nCount = 0;
|
||||
}
|
||||
|
||||
hmac_sha224_update( &ctx, buffer + nDone, uiChunk );
|
||||
hb_hmac_sha224_update( &ctx, buffer + nDone, uiChunk );
|
||||
|
||||
nDone += ( HB_SIZE ) uiChunk;
|
||||
}
|
||||
}
|
||||
#else
|
||||
hmac_sha224_update( &ctx, hb_parcx( 1 ), hb_parclen( 1 ) );
|
||||
hb_hmac_sha224_update( &ctx, hb_parcx( 1 ), hb_parclen( 1 ) );
|
||||
#endif
|
||||
hmac_sha224_final( &ctx, mac, HB_SIZEOFARRAY( mac ) );
|
||||
hb_hmac_sha224_final( &ctx, mac, HB_SIZEOFARRAY( mac ) );
|
||||
|
||||
if( ! hb_parl( 3 ) )
|
||||
{
|
||||
@@ -106,7 +106,7 @@ HB_FUNC( HB_HMAC_SHA256 )
|
||||
unsigned char mac[ SHA256_DIGEST_SIZE ];
|
||||
hmac_sha256_ctx ctx;
|
||||
|
||||
hmac_sha256_init( &ctx, hb_parcx( 2 ), ( unsigned int ) hb_parclen( 2 ) );
|
||||
hb_hmac_sha256_init( &ctx, hb_parcx( 2 ), ( unsigned int ) hb_parclen( 2 ) );
|
||||
#if HB_SIZE_MAX > UINT_MAX
|
||||
{
|
||||
const char * buffer = hb_parcx( 1 );
|
||||
@@ -128,15 +128,15 @@ HB_FUNC( HB_HMAC_SHA256 )
|
||||
nCount = 0;
|
||||
}
|
||||
|
||||
hmac_sha256_update( &ctx, buffer + nDone, uiChunk );
|
||||
hb_hmac_sha256_update( &ctx, buffer + nDone, uiChunk );
|
||||
|
||||
nDone += ( HB_SIZE ) uiChunk;
|
||||
}
|
||||
}
|
||||
#else
|
||||
hmac_sha256_update( &ctx, hb_parcx( 1 ), hb_parclen( 1 ) );
|
||||
hb_hmac_sha256_update( &ctx, hb_parcx( 1 ), hb_parclen( 1 ) );
|
||||
#endif
|
||||
hmac_sha256_final( &ctx, mac, HB_SIZEOFARRAY( mac ) );
|
||||
hb_hmac_sha256_final( &ctx, mac, HB_SIZEOFARRAY( mac ) );
|
||||
|
||||
if( ! hb_parl( 3 ) )
|
||||
{
|
||||
@@ -153,7 +153,7 @@ HB_FUNC( HB_HMAC_SHA384 )
|
||||
unsigned char mac[ SHA384_DIGEST_SIZE ];
|
||||
hmac_sha384_ctx ctx;
|
||||
|
||||
hmac_sha384_init( &ctx, hb_parcx( 2 ), ( unsigned int ) hb_parclen( 2 ) );
|
||||
hb_hmac_sha384_init( &ctx, hb_parcx( 2 ), ( unsigned int ) hb_parclen( 2 ) );
|
||||
#if HB_SIZE_MAX > UINT_MAX
|
||||
{
|
||||
const char * buffer = hb_parcx( 1 );
|
||||
@@ -175,15 +175,15 @@ HB_FUNC( HB_HMAC_SHA384 )
|
||||
nCount = 0;
|
||||
}
|
||||
|
||||
hmac_sha384_update( &ctx, buffer + nDone, uiChunk );
|
||||
hb_hmac_sha384_update( &ctx, buffer + nDone, uiChunk );
|
||||
|
||||
nDone += ( HB_SIZE ) uiChunk;
|
||||
}
|
||||
}
|
||||
#else
|
||||
hmac_sha384_update( &ctx, hb_parcx( 1 ), hb_parclen( 1 ) );
|
||||
hb_hmac_sha384_update( &ctx, hb_parcx( 1 ), hb_parclen( 1 ) );
|
||||
#endif
|
||||
hmac_sha384_final( &ctx, mac, HB_SIZEOFARRAY( mac ) );
|
||||
hb_hmac_sha384_final( &ctx, mac, HB_SIZEOFARRAY( mac ) );
|
||||
|
||||
if( ! hb_parl( 3 ) )
|
||||
{
|
||||
@@ -200,7 +200,7 @@ HB_FUNC( HB_HMAC_SHA512 )
|
||||
unsigned char mac[ SHA512_DIGEST_SIZE ];
|
||||
hmac_sha512_ctx ctx;
|
||||
|
||||
hmac_sha512_init( &ctx, hb_parcx( 2 ), ( unsigned int ) hb_parclen( 2 ) );
|
||||
hb_hmac_sha512_init( &ctx, hb_parcx( 2 ), ( unsigned int ) hb_parclen( 2 ) );
|
||||
#if HB_SIZE_MAX > UINT_MAX
|
||||
{
|
||||
const char * buffer = hb_parcx( 1 );
|
||||
@@ -222,15 +222,15 @@ HB_FUNC( HB_HMAC_SHA512 )
|
||||
nCount = 0;
|
||||
}
|
||||
|
||||
hmac_sha512_update( &ctx, buffer + nDone, uiChunk );
|
||||
hb_hmac_sha512_update( &ctx, buffer + nDone, uiChunk );
|
||||
|
||||
nDone += ( HB_SIZE ) uiChunk;
|
||||
}
|
||||
}
|
||||
#else
|
||||
hmac_sha512_update( &ctx, hb_parcx( 1 ), hb_parclen( 1 ) );
|
||||
hb_hmac_sha512_update( &ctx, hb_parcx( 1 ), hb_parclen( 1 ) );
|
||||
#endif
|
||||
hmac_sha512_final( &ctx, mac, HB_SIZEOFARRAY( mac ) );
|
||||
hb_hmac_sha512_final( &ctx, mac, HB_SIZEOFARRAY( mac ) );
|
||||
|
||||
if( ! hb_parl( 3 ) )
|
||||
{
|
||||
|
||||
@@ -111,7 +111,7 @@ static void SHA1_Transform(sha1_quadbyte state[5], const sha1_byte buffer[64]) {
|
||||
|
||||
|
||||
/* SHA1_Init - Initialize new context */
|
||||
void SHA1_Init(SHA_CTX* context) {
|
||||
void hb_SHA1_Init(SHA_CTX* context) {
|
||||
/* SHA1 initialization constants */
|
||||
context->state[0] = 0x67452301;
|
||||
context->state[1] = 0xEFCDAB89;
|
||||
@@ -122,7 +122,7 @@ void SHA1_Init(SHA_CTX* context) {
|
||||
}
|
||||
|
||||
/* Run your data through this. */
|
||||
void SHA1_Update(SHA_CTX *context, const void *datav, unsigned int len) {
|
||||
void hb_SHA1_Update(SHA_CTX *context, const void *datav, unsigned int len) {
|
||||
const sha1_byte * data = ( const sha1_byte * ) datav;
|
||||
unsigned int i, j;
|
||||
|
||||
@@ -143,7 +143,7 @@ void SHA1_Update(SHA_CTX *context, const void *datav, unsigned int len) {
|
||||
|
||||
|
||||
/* Add padding and return the message digest. */
|
||||
void SHA1_Final(sha1_byte digest[SHA1_DIGEST_LENGTH], SHA_CTX *context) {
|
||||
void hb_SHA1_Final(sha1_byte digest[SHA1_DIGEST_LENGTH], SHA_CTX *context) {
|
||||
sha1_quadbyte i;
|
||||
sha1_byte finalcount[8];
|
||||
|
||||
@@ -151,12 +151,12 @@ void SHA1_Final(sha1_byte digest[SHA1_DIGEST_LENGTH], SHA_CTX *context) {
|
||||
finalcount[i] = (sha1_byte)((context->count[(i >= 4 ? 0 : 1)]
|
||||
>> ((3-(i & 3)) * 8) ) & 255); /* Endian independent */
|
||||
}
|
||||
SHA1_Update(context, (sha1_byte *)"\x80", 1);
|
||||
hb_SHA1_Update(context, (sha1_byte *)"\x80", 1);
|
||||
while ((context->count[0] & 504) != 448) {
|
||||
SHA1_Update(context, (sha1_byte *)"\0", 1);
|
||||
hb_SHA1_Update(context, (sha1_byte *)"\0", 1);
|
||||
}
|
||||
/* Should cause a SHA1_Transform() */
|
||||
SHA1_Update(context, finalcount, 8);
|
||||
hb_SHA1_Update(context, finalcount, 8);
|
||||
for (i = 0; i < SHA1_DIGEST_LENGTH; i++) {
|
||||
digest[i] = (sha1_byte)
|
||||
((context->state[i>>2] >> ((3-(i & 3)) * 8) ) & 255);
|
||||
|
||||
@@ -66,13 +66,13 @@ typedef struct _SHA_CTX {
|
||||
} SHA_CTX;
|
||||
|
||||
#ifndef NOPROTO
|
||||
void SHA1_Init(SHA_CTX *context);
|
||||
void SHA1_Update(SHA_CTX *context, const void *data, unsigned int len);
|
||||
void SHA1_Final(sha1_byte digest[SHA1_DIGEST_LENGTH], SHA_CTX* context);
|
||||
void hb_SHA1_Init(SHA_CTX *context);
|
||||
void hb_SHA1_Update(SHA_CTX *context, const void *data, unsigned int len);
|
||||
void hb_SHA1_Final(sha1_byte digest[SHA1_DIGEST_LENGTH], SHA_CTX* context);
|
||||
#else
|
||||
void SHA1_Init();
|
||||
void SHA1_Update();
|
||||
void SHA1_Final();
|
||||
void hb_SHA1_Init();
|
||||
void hb_SHA1_Update();
|
||||
void hb_SHA1_Final();
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -72,7 +72,7 @@ extern "C" {
|
||||
#define OPAD_BYTE 0x5c
|
||||
#define ZERO_BYTE 0x00
|
||||
|
||||
void HMAC_SHA1_Init(HMAC_SHA1_CTX *ctx) {
|
||||
void hb_HMAC_SHA1_Init(HMAC_SHA1_CTX *ctx) {
|
||||
memset(&(ctx->key[0]), ZERO_BYTE, HMAC_SHA1_BLOCK_LENGTH);
|
||||
memset(&(ctx->ipad[0]), IPAD_BYTE, HMAC_SHA1_BLOCK_LENGTH);
|
||||
memset(&(ctx->opad[0]), OPAD_BYTE, HMAC_SHA1_BLOCK_LENGTH);
|
||||
@@ -80,7 +80,7 @@ void HMAC_SHA1_Init(HMAC_SHA1_CTX *ctx) {
|
||||
ctx->hashkey = 0;
|
||||
}
|
||||
|
||||
void HMAC_SHA1_UpdateKey(HMAC_SHA1_CTX *ctx, const void *key, unsigned int keylen) {
|
||||
void hb_HMAC_SHA1_UpdateKey(HMAC_SHA1_CTX *ctx, const void *key, unsigned int keylen) {
|
||||
|
||||
/* Do we have anything to work with? If not, return right away. */
|
||||
if (keylen < 1)
|
||||
@@ -107,11 +107,11 @@ void HMAC_SHA1_UpdateKey(HMAC_SHA1_CTX *ctx, const void *key, unsigned int keyle
|
||||
ctx->hashkey = 1;
|
||||
|
||||
/* Init. the hash beastie... */
|
||||
SHA1_Init(&ctx->shactx);
|
||||
hb_SHA1_Init(&ctx->shactx);
|
||||
|
||||
/* If there's any previous key data, use it */
|
||||
if (ctx->keylen > 0) {
|
||||
SHA1_Update(&ctx->shactx, &(ctx->key[0]), ctx->keylen);
|
||||
hb_SHA1_Update(&ctx->shactx, &(ctx->key[0]), ctx->keylen);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -121,7 +121,7 @@ void HMAC_SHA1_UpdateKey(HMAC_SHA1_CTX *ctx, const void *key, unsigned int keyle
|
||||
ctx->keylen = HMAC_SHA1_DIGEST_LENGTH;
|
||||
}
|
||||
/* Now feed the latest key data to the has monster */
|
||||
SHA1_Update(&ctx->shactx, key, keylen);
|
||||
hb_SHA1_Update(&ctx->shactx, key, keylen);
|
||||
} else {
|
||||
/*
|
||||
* Key data length hasn't yet exceeded the hash
|
||||
@@ -134,7 +134,7 @@ void HMAC_SHA1_UpdateKey(HMAC_SHA1_CTX *ctx, const void *key, unsigned int keyle
|
||||
}
|
||||
}
|
||||
|
||||
void HMAC_SHA1_EndKey(HMAC_SHA1_CTX *ctx) {
|
||||
void hb_HMAC_SHA1_EndKey(HMAC_SHA1_CTX *ctx) {
|
||||
unsigned char *ipad, *opad, *key;
|
||||
unsigned int i;
|
||||
|
||||
@@ -142,7 +142,7 @@ void HMAC_SHA1_EndKey(HMAC_SHA1_CTX *ctx) {
|
||||
if (ctx->hashkey) {
|
||||
memset(&(ctx->key[0]), ZERO_BYTE, HMAC_SHA1_BLOCK_LENGTH);
|
||||
/* Yes, so finish up and copy the key data */
|
||||
SHA1_Final(&(ctx->key[0]), &ctx->shactx);
|
||||
hb_SHA1_Final(&(ctx->key[0]), &ctx->shactx);
|
||||
/* ctx->keylen was already set correctly */
|
||||
}
|
||||
/* Pad the key if necessary with zero bytes */
|
||||
@@ -162,27 +162,27 @@ void HMAC_SHA1_EndKey(HMAC_SHA1_CTX *ctx) {
|
||||
}
|
||||
}
|
||||
|
||||
void HMAC_SHA1_StartMessage(HMAC_SHA1_CTX *ctx) {
|
||||
SHA1_Init(&ctx->shactx);
|
||||
SHA1_Update(&ctx->shactx, &(ctx->ipad[0]), HMAC_SHA1_BLOCK_LENGTH);
|
||||
void hb_HMAC_SHA1_StartMessage(HMAC_SHA1_CTX *ctx) {
|
||||
hb_SHA1_Init(&ctx->shactx);
|
||||
hb_SHA1_Update(&ctx->shactx, &(ctx->ipad[0]), HMAC_SHA1_BLOCK_LENGTH);
|
||||
}
|
||||
|
||||
void HMAC_SHA1_UpdateMessage(HMAC_SHA1_CTX *ctx, const void *data, unsigned int datalen) {
|
||||
SHA1_Update(&ctx->shactx, data, datalen);
|
||||
void hb_HMAC_SHA1_UpdateMessage(HMAC_SHA1_CTX *ctx, const void *data, unsigned int datalen) {
|
||||
hb_SHA1_Update(&ctx->shactx, data, datalen);
|
||||
}
|
||||
|
||||
void HMAC_SHA1_EndMessage(unsigned char *out, HMAC_SHA1_CTX *ctx) {
|
||||
void hb_HMAC_SHA1_EndMessage(unsigned char *out, HMAC_SHA1_CTX *ctx) {
|
||||
unsigned char buf[HMAC_SHA1_DIGEST_LENGTH];
|
||||
SHA_CTX *c = &ctx->shactx;
|
||||
|
||||
SHA1_Final(&(buf[0]), c);
|
||||
SHA1_Init(c);
|
||||
SHA1_Update(c, &(ctx->opad[0]), HMAC_SHA1_BLOCK_LENGTH);
|
||||
SHA1_Update(c, buf, HMAC_SHA1_DIGEST_LENGTH);
|
||||
SHA1_Final(out, c);
|
||||
hb_SHA1_Final(&(buf[0]), c);
|
||||
hb_SHA1_Init(c);
|
||||
hb_SHA1_Update(c, &(ctx->opad[0]), HMAC_SHA1_BLOCK_LENGTH);
|
||||
hb_SHA1_Update(c, buf, HMAC_SHA1_DIGEST_LENGTH);
|
||||
hb_SHA1_Final(out, c);
|
||||
}
|
||||
|
||||
void HMAC_SHA1_Done(HMAC_SHA1_CTX *ctx) {
|
||||
void hb_HMAC_SHA1_Done(HMAC_SHA1_CTX *ctx) {
|
||||
/* Just to be safe, toast all context data */
|
||||
memset(&(ctx->ipad[0]), ZERO_BYTE, HMAC_SHA1_BLOCK_LENGTH);
|
||||
memset(&(ctx->ipad[0]), ZERO_BYTE, HMAC_SHA1_BLOCK_LENGTH);
|
||||
|
||||
@@ -72,21 +72,21 @@ typedef struct _HMAC_SHA1_CTX {
|
||||
} HMAC_SHA1_CTX;
|
||||
|
||||
#ifndef NOPROTO
|
||||
void HMAC_SHA1_Init(HMAC_SHA1_CTX *ctx);
|
||||
void HMAC_SHA1_UpdateKey(HMAC_SHA1_CTX *ctx, const void *key, unsigned int keylen);
|
||||
void HMAC_SHA1_EndKey(HMAC_SHA1_CTX *ctx);
|
||||
void HMAC_SHA1_StartMessage(HMAC_SHA1_CTX *ctx);
|
||||
void HMAC_SHA1_UpdateMessage(HMAC_SHA1_CTX *ctx, const void *data, unsigned int datalen);
|
||||
void HMAC_SHA1_EndMessage(unsigned char *out, HMAC_SHA1_CTX *ctx);
|
||||
void HMAC_SHA1_Done(HMAC_SHA1_CTX *ctx);
|
||||
void hb_HMAC_SHA1_Init(HMAC_SHA1_CTX *ctx);
|
||||
void hb_HMAC_SHA1_UpdateKey(HMAC_SHA1_CTX *ctx, const void *key, unsigned int keylen);
|
||||
void hb_HMAC_SHA1_EndKey(HMAC_SHA1_CTX *ctx);
|
||||
void hb_HMAC_SHA1_StartMessage(HMAC_SHA1_CTX *ctx);
|
||||
void hb_HMAC_SHA1_UpdateMessage(HMAC_SHA1_CTX *ctx, const void *data, unsigned int datalen);
|
||||
void hb_HMAC_SHA1_EndMessage(unsigned char *out, HMAC_SHA1_CTX *ctx);
|
||||
void hb_HMAC_SHA1_Done(HMAC_SHA1_CTX *ctx);
|
||||
#else
|
||||
void HMAC_SHA1_Init();
|
||||
void HMAC_SHA1_UpdateKey();
|
||||
void HMAC_SHA1_EndKey();
|
||||
void HMAC_SHA1_StartMessage();
|
||||
void HMAC_SHA1_UpdateMessage();
|
||||
void HMAC_SHA1_EndMessage();
|
||||
void HMAC_SHA1_Done();
|
||||
void hb_HMAC_SHA1_Init();
|
||||
void hb_HMAC_SHA1_UpdateKey();
|
||||
void hb_HMAC_SHA1_EndKey();
|
||||
void hb_HMAC_SHA1_StartMessage();
|
||||
void hb_HMAC_SHA1_UpdateMessage();
|
||||
void hb_HMAC_SHA1_EndMessage();
|
||||
void hb_HMAC_SHA1_Done();
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -340,16 +340,16 @@ void sha256_transf(sha256_ctx *ctx, const unsigned char *message,
|
||||
}
|
||||
}
|
||||
|
||||
void sha256(const void *message, unsigned int len, unsigned char *digest)
|
||||
void hb_sha256(const void *message, unsigned int len, unsigned char *digest)
|
||||
{
|
||||
sha256_ctx ctx;
|
||||
|
||||
sha256_init(&ctx);
|
||||
sha256_update(&ctx, message, len);
|
||||
sha256_final(&ctx, digest);
|
||||
hb_sha256_init(&ctx);
|
||||
hb_sha256_update(&ctx, message, len);
|
||||
hb_sha256_final(&ctx, digest);
|
||||
}
|
||||
|
||||
void sha256_init(sha256_ctx *ctx)
|
||||
void hb_sha256_init(sha256_ctx *ctx)
|
||||
{
|
||||
#ifndef UNROLL_LOOPS
|
||||
int i;
|
||||
@@ -367,7 +367,7 @@ void sha256_init(sha256_ctx *ctx)
|
||||
ctx->tot_len = 0;
|
||||
}
|
||||
|
||||
void sha256_update(sha256_ctx *ctx, const void *messagev,
|
||||
void hb_sha256_update(sha256_ctx *ctx, const void *messagev,
|
||||
unsigned int len)
|
||||
{
|
||||
const unsigned char * message = ( const unsigned char * ) messagev;
|
||||
@@ -402,7 +402,7 @@ void sha256_update(sha256_ctx *ctx, const void *messagev,
|
||||
ctx->tot_len += (block_nb + 1) << 6;
|
||||
}
|
||||
|
||||
void sha256_final(sha256_ctx *ctx, unsigned char *digest)
|
||||
void hb_sha256_final(sha256_ctx *ctx, unsigned char *digest)
|
||||
{
|
||||
unsigned int block_nb;
|
||||
unsigned int pm_len;
|
||||
@@ -537,17 +537,17 @@ void sha512_transf(sha512_ctx *ctx, const unsigned char *message,
|
||||
}
|
||||
}
|
||||
|
||||
void sha512(const void *message, unsigned int len,
|
||||
void hb_sha512(const void *message, unsigned int len,
|
||||
unsigned char *digest)
|
||||
{
|
||||
sha512_ctx ctx;
|
||||
|
||||
sha512_init(&ctx);
|
||||
sha512_update(&ctx, message, len);
|
||||
sha512_final(&ctx, digest);
|
||||
hb_sha512_init(&ctx);
|
||||
hb_sha512_update(&ctx, message, len);
|
||||
hb_sha512_final(&ctx, digest);
|
||||
}
|
||||
|
||||
void sha512_init(sha512_ctx *ctx)
|
||||
void hb_sha512_init(sha512_ctx *ctx)
|
||||
{
|
||||
#ifndef UNROLL_LOOPS
|
||||
int i;
|
||||
@@ -565,7 +565,7 @@ void sha512_init(sha512_ctx *ctx)
|
||||
ctx->tot_len = 0;
|
||||
}
|
||||
|
||||
void sha512_update(sha512_ctx *ctx, const void *messagev,
|
||||
void hb_sha512_update(sha512_ctx *ctx, const void *messagev,
|
||||
unsigned int len)
|
||||
{
|
||||
const unsigned char * message = ( const unsigned char * ) messagev;
|
||||
@@ -600,7 +600,7 @@ void sha512_update(sha512_ctx *ctx, const void *messagev,
|
||||
ctx->tot_len += (block_nb + 1) << 7;
|
||||
}
|
||||
|
||||
void sha512_final(sha512_ctx *ctx, unsigned char *digest)
|
||||
void hb_sha512_final(sha512_ctx *ctx, unsigned char *digest)
|
||||
{
|
||||
unsigned int block_nb;
|
||||
unsigned int pm_len;
|
||||
@@ -640,17 +640,17 @@ void sha512_final(sha512_ctx *ctx, unsigned char *digest)
|
||||
|
||||
/* SHA-384 functions */
|
||||
|
||||
void sha384(const void *message, unsigned int len,
|
||||
void hb_sha384(const void *message, unsigned int len,
|
||||
unsigned char *digest)
|
||||
{
|
||||
sha384_ctx ctx;
|
||||
|
||||
sha384_init(&ctx);
|
||||
sha384_update(&ctx, message, len);
|
||||
sha384_final(&ctx, digest);
|
||||
hb_sha384_init(&ctx);
|
||||
hb_sha384_update(&ctx, message, len);
|
||||
hb_sha384_final(&ctx, digest);
|
||||
}
|
||||
|
||||
void sha384_init(sha384_ctx *ctx)
|
||||
void hb_sha384_init(sha384_ctx *ctx)
|
||||
{
|
||||
#ifndef UNROLL_LOOPS
|
||||
int i;
|
||||
@@ -668,7 +668,7 @@ void sha384_init(sha384_ctx *ctx)
|
||||
ctx->tot_len = 0;
|
||||
}
|
||||
|
||||
void sha384_update(sha384_ctx *ctx, const void *messagev,
|
||||
void hb_sha384_update(sha384_ctx *ctx, const void *messagev,
|
||||
unsigned int len)
|
||||
{
|
||||
const unsigned char * message = ( const unsigned char * ) messagev;
|
||||
@@ -703,7 +703,7 @@ void sha384_update(sha384_ctx *ctx, const void *messagev,
|
||||
ctx->tot_len += (block_nb + 1) << 7;
|
||||
}
|
||||
|
||||
void sha384_final(sha384_ctx *ctx, unsigned char *digest)
|
||||
void hb_sha384_final(sha384_ctx *ctx, unsigned char *digest)
|
||||
{
|
||||
unsigned int block_nb;
|
||||
unsigned int pm_len;
|
||||
@@ -741,17 +741,17 @@ void sha384_final(sha384_ctx *ctx, unsigned char *digest)
|
||||
|
||||
/* SHA-224 functions */
|
||||
|
||||
void sha224(const void *message, unsigned int len,
|
||||
void hb_sha224(const void *message, unsigned int len,
|
||||
unsigned char *digest)
|
||||
{
|
||||
sha224_ctx ctx;
|
||||
|
||||
sha224_init(&ctx);
|
||||
sha224_update(&ctx, message, len);
|
||||
sha224_final(&ctx, digest);
|
||||
hb_sha224_init(&ctx);
|
||||
hb_sha224_update(&ctx, message, len);
|
||||
hb_sha224_final(&ctx, digest);
|
||||
}
|
||||
|
||||
void sha224_init(sha224_ctx *ctx)
|
||||
void hb_sha224_init(sha224_ctx *ctx)
|
||||
{
|
||||
#ifndef UNROLL_LOOPS
|
||||
int i;
|
||||
@@ -769,7 +769,7 @@ void sha224_init(sha224_ctx *ctx)
|
||||
ctx->tot_len = 0;
|
||||
}
|
||||
|
||||
void sha224_update(sha224_ctx *ctx, const void *messagev,
|
||||
void hb_sha224_update(sha224_ctx *ctx, const void *messagev,
|
||||
unsigned int len)
|
||||
{
|
||||
const unsigned char * message = ( const unsigned char * ) messagev;
|
||||
@@ -804,7 +804,7 @@ void sha224_update(sha224_ctx *ctx, const void *messagev,
|
||||
ctx->tot_len += (block_nb + 1) << 6;
|
||||
}
|
||||
|
||||
void sha224_final(sha224_ctx *ctx, unsigned char *digest)
|
||||
void hb_sha224_final(sha224_ctx *ctx, unsigned char *digest)
|
||||
{
|
||||
unsigned int block_nb;
|
||||
unsigned int pm_len;
|
||||
|
||||
@@ -80,33 +80,33 @@ typedef struct {
|
||||
typedef sha512_ctx sha384_ctx;
|
||||
typedef sha256_ctx sha224_ctx;
|
||||
|
||||
void sha224_init(sha224_ctx *ctx);
|
||||
void sha224_update(sha224_ctx *ctx, const void *message,
|
||||
unsigned int len);
|
||||
void sha224_final(sha224_ctx *ctx, unsigned char *digest);
|
||||
void sha224(const void *message, unsigned int len,
|
||||
unsigned char *digest);
|
||||
void hb_sha224_init(sha224_ctx *ctx);
|
||||
void hb_sha224_update(sha224_ctx *ctx, const void *message,
|
||||
unsigned int len);
|
||||
void hb_sha224_final(sha224_ctx *ctx, unsigned char *digest);
|
||||
void hb_sha224(const void *message, unsigned int len,
|
||||
unsigned char *digest);
|
||||
|
||||
void sha256_init(sha256_ctx * ctx);
|
||||
void sha256_update(sha256_ctx *ctx, const void *message,
|
||||
unsigned int len);
|
||||
void sha256_final(sha256_ctx *ctx, unsigned char *digest);
|
||||
void sha256(const void *message, unsigned int len,
|
||||
unsigned char *digest);
|
||||
void hb_sha256_init(sha256_ctx * ctx);
|
||||
void hb_sha256_update(sha256_ctx *ctx, const void *message,
|
||||
unsigned int len);
|
||||
void hb_sha256_final(sha256_ctx *ctx, unsigned char *digest);
|
||||
void hb_sha256(const void *message, unsigned int len,
|
||||
unsigned char *digest);
|
||||
|
||||
void sha384_init(sha384_ctx *ctx);
|
||||
void sha384_update(sha384_ctx *ctx, const void *message,
|
||||
unsigned int len);
|
||||
void sha384_final(sha384_ctx *ctx, unsigned char *digest);
|
||||
void sha384(const void *message, unsigned int len,
|
||||
unsigned char *digest);
|
||||
void hb_sha384_init(sha384_ctx *ctx);
|
||||
void hb_sha384_update(sha384_ctx *ctx, const void *message,
|
||||
unsigned int len);
|
||||
void hb_sha384_final(sha384_ctx *ctx, unsigned char *digest);
|
||||
void hb_sha384(const void *message, unsigned int len,
|
||||
unsigned char *digest);
|
||||
|
||||
void sha512_init(sha512_ctx *ctx);
|
||||
void sha512_update(sha512_ctx *ctx, const void *message,
|
||||
unsigned int len);
|
||||
void sha512_final(sha512_ctx *ctx, unsigned char *digest);
|
||||
void sha512(const void *message, unsigned int len,
|
||||
unsigned char *digest);
|
||||
void hb_sha512_init(sha512_ctx *ctx);
|
||||
void hb_sha512_update(sha512_ctx *ctx, const void *message,
|
||||
unsigned int len);
|
||||
void hb_sha512_final(sha512_ctx *ctx, unsigned char *digest);
|
||||
void hb_sha512(const void *message, unsigned int len,
|
||||
unsigned char *digest);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
|
||||
/* HMAC-SHA-224 functions */
|
||||
|
||||
void hmac_sha224_init(hmac_sha224_ctx *ctx, const void *keyv,
|
||||
void hb_hmac_sha224_init(hmac_sha224_ctx *ctx, const void *keyv,
|
||||
unsigned int key_size)
|
||||
{
|
||||
unsigned int fill;
|
||||
@@ -59,7 +59,7 @@ void hmac_sha224_init(hmac_sha224_ctx *ctx, const void *keyv,
|
||||
if (key_size > SHA224_BLOCK_SIZE){
|
||||
key_used = key_temp;
|
||||
num = SHA224_DIGEST_SIZE;
|
||||
sha224(key, key_size, key_used);
|
||||
hb_sha224(key, key_size, key_used);
|
||||
} else { /* key_size > SHA224_BLOCK_SIZE */
|
||||
key_used = ( unsigned char * ) key;
|
||||
num = key_size;
|
||||
@@ -75,11 +75,11 @@ void hmac_sha224_init(hmac_sha224_ctx *ctx, const void *keyv,
|
||||
ctx->block_opad[i] = key_used[i] ^ 0x5c;
|
||||
}
|
||||
|
||||
sha224_init(&ctx->ctx_inside);
|
||||
sha224_update(&ctx->ctx_inside, ctx->block_ipad, SHA224_BLOCK_SIZE);
|
||||
hb_sha224_init(&ctx->ctx_inside);
|
||||
hb_sha224_update(&ctx->ctx_inside, ctx->block_ipad, SHA224_BLOCK_SIZE);
|
||||
|
||||
sha224_init(&ctx->ctx_outside);
|
||||
sha224_update(&ctx->ctx_outside, ctx->block_opad,
|
||||
hb_sha224_init(&ctx->ctx_outside);
|
||||
hb_sha224_update(&ctx->ctx_outside, ctx->block_opad,
|
||||
SHA224_BLOCK_SIZE);
|
||||
|
||||
/* for hmac_reinit */
|
||||
@@ -89,7 +89,7 @@ void hmac_sha224_init(hmac_sha224_ctx *ctx, const void *keyv,
|
||||
sizeof(sha224_ctx));
|
||||
}
|
||||
|
||||
void hmac_sha224_reinit(hmac_sha224_ctx *ctx)
|
||||
void hb_hmac_sha224_reinit(hmac_sha224_ctx *ctx)
|
||||
{
|
||||
memcpy(&ctx->ctx_inside, &ctx->ctx_inside_reinit,
|
||||
sizeof(sha224_ctx));
|
||||
@@ -97,38 +97,38 @@ void hmac_sha224_reinit(hmac_sha224_ctx *ctx)
|
||||
sizeof(sha224_ctx));
|
||||
}
|
||||
|
||||
void hmac_sha224_update(hmac_sha224_ctx *ctx, const void *message,
|
||||
void hb_hmac_sha224_update(hmac_sha224_ctx *ctx, const void *message,
|
||||
unsigned int message_len)
|
||||
{
|
||||
sha224_update(&ctx->ctx_inside, message, message_len);
|
||||
hb_sha224_update(&ctx->ctx_inside, message, message_len);
|
||||
}
|
||||
|
||||
void hmac_sha224_final(hmac_sha224_ctx *ctx, unsigned char *mac,
|
||||
void hb_hmac_sha224_final(hmac_sha224_ctx *ctx, unsigned char *mac,
|
||||
unsigned int mac_size)
|
||||
{
|
||||
unsigned char digest_inside[SHA224_DIGEST_SIZE];
|
||||
unsigned char mac_temp[SHA224_DIGEST_SIZE];
|
||||
|
||||
sha224_final(&ctx->ctx_inside, digest_inside);
|
||||
sha224_update(&ctx->ctx_outside, digest_inside, SHA224_DIGEST_SIZE);
|
||||
sha224_final(&ctx->ctx_outside, mac_temp);
|
||||
hb_sha224_final(&ctx->ctx_inside, digest_inside);
|
||||
hb_sha224_update(&ctx->ctx_outside, digest_inside, SHA224_DIGEST_SIZE);
|
||||
hb_sha224_final(&ctx->ctx_outside, mac_temp);
|
||||
memcpy(mac, mac_temp, mac_size);
|
||||
}
|
||||
|
||||
void hmac_sha224(const void *key, unsigned int key_size,
|
||||
void hb_hmac_sha224(const void *key, unsigned int key_size,
|
||||
const void *message, unsigned int message_len,
|
||||
unsigned char *mac, unsigned mac_size)
|
||||
{
|
||||
hmac_sha224_ctx ctx;
|
||||
|
||||
hmac_sha224_init(&ctx, key, key_size);
|
||||
hmac_sha224_update(&ctx, message, message_len);
|
||||
hmac_sha224_final(&ctx, mac, mac_size);
|
||||
hb_hmac_sha224_init(&ctx, key, key_size);
|
||||
hb_hmac_sha224_update(&ctx, message, message_len);
|
||||
hb_hmac_sha224_final(&ctx, mac, mac_size);
|
||||
}
|
||||
|
||||
/* HMAC-SHA-256 functions */
|
||||
|
||||
void hmac_sha256_init(hmac_sha256_ctx *ctx, const void *keyv,
|
||||
void hb_hmac_sha256_init(hmac_sha256_ctx *ctx, const void *keyv,
|
||||
unsigned int key_size)
|
||||
{
|
||||
unsigned int fill;
|
||||
@@ -146,7 +146,7 @@ void hmac_sha256_init(hmac_sha256_ctx *ctx, const void *keyv,
|
||||
if (key_size > SHA256_BLOCK_SIZE){
|
||||
key_used = key_temp;
|
||||
num = SHA256_DIGEST_SIZE;
|
||||
sha256(key, key_size, key_used);
|
||||
hb_sha256(key, key_size, key_used);
|
||||
} else { /* key_size > SHA256_BLOCK_SIZE */
|
||||
key_used = ( unsigned char * ) key;
|
||||
num = key_size;
|
||||
@@ -162,11 +162,11 @@ void hmac_sha256_init(hmac_sha256_ctx *ctx, const void *keyv,
|
||||
ctx->block_opad[i] = key_used[i] ^ 0x5c;
|
||||
}
|
||||
|
||||
sha256_init(&ctx->ctx_inside);
|
||||
sha256_update(&ctx->ctx_inside, ctx->block_ipad, SHA256_BLOCK_SIZE);
|
||||
hb_sha256_init(&ctx->ctx_inside);
|
||||
hb_sha256_update(&ctx->ctx_inside, ctx->block_ipad, SHA256_BLOCK_SIZE);
|
||||
|
||||
sha256_init(&ctx->ctx_outside);
|
||||
sha256_update(&ctx->ctx_outside, ctx->block_opad,
|
||||
hb_sha256_init(&ctx->ctx_outside);
|
||||
hb_sha256_update(&ctx->ctx_outside, ctx->block_opad,
|
||||
SHA256_BLOCK_SIZE);
|
||||
|
||||
/* for hmac_reinit */
|
||||
@@ -176,7 +176,7 @@ void hmac_sha256_init(hmac_sha256_ctx *ctx, const void *keyv,
|
||||
sizeof(sha256_ctx));
|
||||
}
|
||||
|
||||
void hmac_sha256_reinit(hmac_sha256_ctx *ctx)
|
||||
void hb_hmac_sha256_reinit(hmac_sha256_ctx *ctx)
|
||||
{
|
||||
memcpy(&ctx->ctx_inside, &ctx->ctx_inside_reinit,
|
||||
sizeof(sha256_ctx));
|
||||
@@ -184,38 +184,38 @@ void hmac_sha256_reinit(hmac_sha256_ctx *ctx)
|
||||
sizeof(sha256_ctx));
|
||||
}
|
||||
|
||||
void hmac_sha256_update(hmac_sha256_ctx *ctx, const void *message,
|
||||
void hb_hmac_sha256_update(hmac_sha256_ctx *ctx, const void *message,
|
||||
unsigned int message_len)
|
||||
{
|
||||
sha256_update(&ctx->ctx_inside, message, message_len);
|
||||
hb_sha256_update(&ctx->ctx_inside, message, message_len);
|
||||
}
|
||||
|
||||
void hmac_sha256_final(hmac_sha256_ctx *ctx, unsigned char *mac,
|
||||
void hb_hmac_sha256_final(hmac_sha256_ctx *ctx, unsigned char *mac,
|
||||
unsigned int mac_size)
|
||||
{
|
||||
unsigned char digest_inside[SHA256_DIGEST_SIZE];
|
||||
unsigned char mac_temp[SHA256_DIGEST_SIZE];
|
||||
|
||||
sha256_final(&ctx->ctx_inside, digest_inside);
|
||||
sha256_update(&ctx->ctx_outside, digest_inside, SHA256_DIGEST_SIZE);
|
||||
sha256_final(&ctx->ctx_outside, mac_temp);
|
||||
hb_sha256_final(&ctx->ctx_inside, digest_inside);
|
||||
hb_sha256_update(&ctx->ctx_outside, digest_inside, SHA256_DIGEST_SIZE);
|
||||
hb_sha256_final(&ctx->ctx_outside, mac_temp);
|
||||
memcpy(mac, mac_temp, mac_size);
|
||||
}
|
||||
|
||||
void hmac_sha256(const void *key, unsigned int key_size,
|
||||
void hb_hmac_sha256(const void *key, unsigned int key_size,
|
||||
const void *message, unsigned int message_len,
|
||||
unsigned char *mac, unsigned mac_size)
|
||||
{
|
||||
hmac_sha256_ctx ctx;
|
||||
|
||||
hmac_sha256_init(&ctx, key, key_size);
|
||||
hmac_sha256_update(&ctx, message, message_len);
|
||||
hmac_sha256_final(&ctx, mac, mac_size);
|
||||
hb_hmac_sha256_init(&ctx, key, key_size);
|
||||
hb_hmac_sha256_update(&ctx, message, message_len);
|
||||
hb_hmac_sha256_final(&ctx, mac, mac_size);
|
||||
}
|
||||
|
||||
/* HMAC-SHA-384 functions */
|
||||
|
||||
void hmac_sha384_init(hmac_sha384_ctx *ctx, const void *keyv,
|
||||
void hb_hmac_sha384_init(hmac_sha384_ctx *ctx, const void *keyv,
|
||||
unsigned int key_size)
|
||||
{
|
||||
unsigned int fill;
|
||||
@@ -233,7 +233,7 @@ void hmac_sha384_init(hmac_sha384_ctx *ctx, const void *keyv,
|
||||
if (key_size > SHA384_BLOCK_SIZE){
|
||||
key_used = key_temp;
|
||||
num = SHA384_DIGEST_SIZE;
|
||||
sha384(key, key_size, key_used);
|
||||
hb_sha384(key, key_size, key_used);
|
||||
} else { /* key_size > SHA384_BLOCK_SIZE */
|
||||
key_used = ( unsigned char * ) key;
|
||||
num = key_size;
|
||||
@@ -249,11 +249,11 @@ void hmac_sha384_init(hmac_sha384_ctx *ctx, const void *keyv,
|
||||
ctx->block_opad[i] = key_used[i] ^ 0x5c;
|
||||
}
|
||||
|
||||
sha384_init(&ctx->ctx_inside);
|
||||
sha384_update(&ctx->ctx_inside, ctx->block_ipad, SHA384_BLOCK_SIZE);
|
||||
hb_sha384_init(&ctx->ctx_inside);
|
||||
hb_sha384_update(&ctx->ctx_inside, ctx->block_ipad, SHA384_BLOCK_SIZE);
|
||||
|
||||
sha384_init(&ctx->ctx_outside);
|
||||
sha384_update(&ctx->ctx_outside, ctx->block_opad,
|
||||
hb_sha384_init(&ctx->ctx_outside);
|
||||
hb_sha384_update(&ctx->ctx_outside, ctx->block_opad,
|
||||
SHA384_BLOCK_SIZE);
|
||||
|
||||
/* for hmac_reinit */
|
||||
@@ -263,7 +263,7 @@ void hmac_sha384_init(hmac_sha384_ctx *ctx, const void *keyv,
|
||||
sizeof(sha384_ctx));
|
||||
}
|
||||
|
||||
void hmac_sha384_reinit(hmac_sha384_ctx *ctx)
|
||||
void hb_hmac_sha384_reinit(hmac_sha384_ctx *ctx)
|
||||
{
|
||||
memcpy(&ctx->ctx_inside, &ctx->ctx_inside_reinit,
|
||||
sizeof(sha384_ctx));
|
||||
@@ -271,38 +271,38 @@ void hmac_sha384_reinit(hmac_sha384_ctx *ctx)
|
||||
sizeof(sha384_ctx));
|
||||
}
|
||||
|
||||
void hmac_sha384_update(hmac_sha384_ctx *ctx, const void *message,
|
||||
void hb_hmac_sha384_update(hmac_sha384_ctx *ctx, const void *message,
|
||||
unsigned int message_len)
|
||||
{
|
||||
sha384_update(&ctx->ctx_inside, message, message_len);
|
||||
hb_sha384_update(&ctx->ctx_inside, message, message_len);
|
||||
}
|
||||
|
||||
void hmac_sha384_final(hmac_sha384_ctx *ctx, unsigned char *mac,
|
||||
void hb_hmac_sha384_final(hmac_sha384_ctx *ctx, unsigned char *mac,
|
||||
unsigned int mac_size)
|
||||
{
|
||||
unsigned char digest_inside[SHA384_DIGEST_SIZE];
|
||||
unsigned char mac_temp[SHA384_DIGEST_SIZE];
|
||||
|
||||
sha384_final(&ctx->ctx_inside, digest_inside);
|
||||
sha384_update(&ctx->ctx_outside, digest_inside, SHA384_DIGEST_SIZE);
|
||||
sha384_final(&ctx->ctx_outside, mac_temp);
|
||||
hb_sha384_final(&ctx->ctx_inside, digest_inside);
|
||||
hb_sha384_update(&ctx->ctx_outside, digest_inside, SHA384_DIGEST_SIZE);
|
||||
hb_sha384_final(&ctx->ctx_outside, mac_temp);
|
||||
memcpy(mac, mac_temp, mac_size);
|
||||
}
|
||||
|
||||
void hmac_sha384(const void *key, unsigned int key_size,
|
||||
void hb_hmac_sha384(const void *key, unsigned int key_size,
|
||||
const void *message, unsigned int message_len,
|
||||
unsigned char *mac, unsigned mac_size)
|
||||
{
|
||||
hmac_sha384_ctx ctx;
|
||||
|
||||
hmac_sha384_init(&ctx, key, key_size);
|
||||
hmac_sha384_update(&ctx, message, message_len);
|
||||
hmac_sha384_final(&ctx, mac, mac_size);
|
||||
hb_hmac_sha384_init(&ctx, key, key_size);
|
||||
hb_hmac_sha384_update(&ctx, message, message_len);
|
||||
hb_hmac_sha384_final(&ctx, mac, mac_size);
|
||||
}
|
||||
|
||||
/* HMAC-SHA-512 functions */
|
||||
|
||||
void hmac_sha512_init(hmac_sha512_ctx *ctx, const void *keyv,
|
||||
void hb_hmac_sha512_init(hmac_sha512_ctx *ctx, const void *keyv,
|
||||
unsigned int key_size)
|
||||
{
|
||||
unsigned int fill;
|
||||
@@ -320,7 +320,7 @@ void hmac_sha512_init(hmac_sha512_ctx *ctx, const void *keyv,
|
||||
if (key_size > SHA512_BLOCK_SIZE){
|
||||
key_used = key_temp;
|
||||
num = SHA512_DIGEST_SIZE;
|
||||
sha512(key, key_size, key_used);
|
||||
hb_sha512(key, key_size, key_used);
|
||||
} else { /* key_size > SHA512_BLOCK_SIZE */
|
||||
key_used = ( unsigned char * ) key;
|
||||
num = key_size;
|
||||
@@ -336,11 +336,11 @@ void hmac_sha512_init(hmac_sha512_ctx *ctx, const void *keyv,
|
||||
ctx->block_opad[i] = key_used[i] ^ 0x5c;
|
||||
}
|
||||
|
||||
sha512_init(&ctx->ctx_inside);
|
||||
sha512_update(&ctx->ctx_inside, ctx->block_ipad, SHA512_BLOCK_SIZE);
|
||||
hb_sha512_init(&ctx->ctx_inside);
|
||||
hb_sha512_update(&ctx->ctx_inside, ctx->block_ipad, SHA512_BLOCK_SIZE);
|
||||
|
||||
sha512_init(&ctx->ctx_outside);
|
||||
sha512_update(&ctx->ctx_outside, ctx->block_opad,
|
||||
hb_sha512_init(&ctx->ctx_outside);
|
||||
hb_sha512_update(&ctx->ctx_outside, ctx->block_opad,
|
||||
SHA512_BLOCK_SIZE);
|
||||
|
||||
/* for hmac_reinit */
|
||||
@@ -350,7 +350,7 @@ void hmac_sha512_init(hmac_sha512_ctx *ctx, const void *keyv,
|
||||
sizeof(sha512_ctx));
|
||||
}
|
||||
|
||||
void hmac_sha512_reinit(hmac_sha512_ctx *ctx)
|
||||
void hb_hmac_sha512_reinit(hmac_sha512_ctx *ctx)
|
||||
{
|
||||
memcpy(&ctx->ctx_inside, &ctx->ctx_inside_reinit,
|
||||
sizeof(sha512_ctx));
|
||||
@@ -358,31 +358,31 @@ void hmac_sha512_reinit(hmac_sha512_ctx *ctx)
|
||||
sizeof(sha512_ctx));
|
||||
}
|
||||
|
||||
void hmac_sha512_update(hmac_sha512_ctx *ctx, const void *message,
|
||||
void hb_hmac_sha512_update(hmac_sha512_ctx *ctx, const void *message,
|
||||
unsigned int message_len)
|
||||
{
|
||||
sha512_update(&ctx->ctx_inside, message, message_len);
|
||||
hb_sha512_update(&ctx->ctx_inside, message, message_len);
|
||||
}
|
||||
|
||||
void hmac_sha512_final(hmac_sha512_ctx *ctx, unsigned char *mac,
|
||||
void hb_hmac_sha512_final(hmac_sha512_ctx *ctx, unsigned char *mac,
|
||||
unsigned int mac_size)
|
||||
{
|
||||
unsigned char digest_inside[SHA512_DIGEST_SIZE];
|
||||
unsigned char mac_temp[SHA512_DIGEST_SIZE];
|
||||
|
||||
sha512_final(&ctx->ctx_inside, digest_inside);
|
||||
sha512_update(&ctx->ctx_outside, digest_inside, SHA512_DIGEST_SIZE);
|
||||
sha512_final(&ctx->ctx_outside, mac_temp);
|
||||
hb_sha512_final(&ctx->ctx_inside, digest_inside);
|
||||
hb_sha512_update(&ctx->ctx_outside, digest_inside, SHA512_DIGEST_SIZE);
|
||||
hb_sha512_final(&ctx->ctx_outside, mac_temp);
|
||||
memcpy(mac, mac_temp, mac_size);
|
||||
}
|
||||
|
||||
void hmac_sha512(const void *key, unsigned int key_size,
|
||||
void hb_hmac_sha512(const void *key, unsigned int key_size,
|
||||
const void *message, unsigned int message_len,
|
||||
unsigned char *mac, unsigned mac_size)
|
||||
{
|
||||
hmac_sha512_ctx ctx;
|
||||
|
||||
hmac_sha512_init(&ctx, key, key_size);
|
||||
hmac_sha512_update(&ctx, message, message_len);
|
||||
hmac_sha512_final(&ctx, mac, mac_size);
|
||||
hb_hmac_sha512_init(&ctx, key, key_size);
|
||||
hb_hmac_sha512_update(&ctx, message, message_len);
|
||||
hb_hmac_sha512_final(&ctx, mac, mac_size);
|
||||
}
|
||||
|
||||
@@ -92,49 +92,49 @@ typedef struct {
|
||||
unsigned char block_opad[SHA512_BLOCK_SIZE];
|
||||
} hmac_sha512_ctx;
|
||||
|
||||
void hmac_sha224_init(hmac_sha224_ctx *ctx, const void *key,
|
||||
unsigned int key_size);
|
||||
void hmac_sha224_reinit(hmac_sha224_ctx *ctx);
|
||||
void hmac_sha224_update(hmac_sha224_ctx *ctx, const void *message,
|
||||
unsigned int message_len);
|
||||
void hmac_sha224_final(hmac_sha224_ctx *ctx, unsigned char *mac,
|
||||
unsigned int mac_size);
|
||||
void hmac_sha224(const void *key, unsigned int key_size,
|
||||
const void *message, unsigned int message_len,
|
||||
unsigned char *mac, unsigned mac_size);
|
||||
void hb_hmac_sha224_init(hmac_sha224_ctx *ctx, const void *key,
|
||||
unsigned int key_size);
|
||||
void hb_hmac_sha224_reinit(hmac_sha224_ctx *ctx);
|
||||
void hb_hmac_sha224_update(hmac_sha224_ctx *ctx, const void *message,
|
||||
unsigned int message_len);
|
||||
void hb_hmac_sha224_final(hmac_sha224_ctx *ctx, unsigned char *mac,
|
||||
unsigned int mac_size);
|
||||
void hb_hmac_sha224(const void *key, unsigned int key_size,
|
||||
const void *message, unsigned int message_len,
|
||||
unsigned char *mac, unsigned mac_size);
|
||||
|
||||
void hmac_sha256_init(hmac_sha256_ctx *ctx, const void *key,
|
||||
unsigned int key_size);
|
||||
void hmac_sha256_reinit(hmac_sha256_ctx *ctx);
|
||||
void hmac_sha256_update(hmac_sha256_ctx *ctx, const void *message,
|
||||
unsigned int message_len);
|
||||
void hmac_sha256_final(hmac_sha256_ctx *ctx, unsigned char *mac,
|
||||
unsigned int mac_size);
|
||||
void hmac_sha256(const void *key, unsigned int key_size,
|
||||
const void *message, unsigned int message_len,
|
||||
unsigned char *mac, unsigned mac_size);
|
||||
void hb_hmac_sha256_init(hmac_sha256_ctx *ctx, const void *key,
|
||||
unsigned int key_size);
|
||||
void hb_hmac_sha256_reinit(hmac_sha256_ctx *ctx);
|
||||
void hb_hmac_sha256_update(hmac_sha256_ctx *ctx, const void *message,
|
||||
unsigned int message_len);
|
||||
void hb_hmac_sha256_final(hmac_sha256_ctx *ctx, unsigned char *mac,
|
||||
unsigned int mac_size);
|
||||
void hb_hmac_sha256(const void *key, unsigned int key_size,
|
||||
const void *message, unsigned int message_len,
|
||||
unsigned char *mac, unsigned mac_size);
|
||||
|
||||
void hmac_sha384_init(hmac_sha384_ctx *ctx, const void *key,
|
||||
unsigned int key_size);
|
||||
void hmac_sha384_reinit(hmac_sha384_ctx *ctx);
|
||||
void hmac_sha384_update(hmac_sha384_ctx *ctx, const void *message,
|
||||
unsigned int message_len);
|
||||
void hmac_sha384_final(hmac_sha384_ctx *ctx, unsigned char *mac,
|
||||
unsigned int mac_size);
|
||||
void hmac_sha384(const void *key, unsigned int key_size,
|
||||
const void *message, unsigned int message_len,
|
||||
unsigned char *mac, unsigned mac_size);
|
||||
void hb_hmac_sha384_init(hmac_sha384_ctx *ctx, const void *key,
|
||||
unsigned int key_size);
|
||||
void hb_hmac_sha384_reinit(hmac_sha384_ctx *ctx);
|
||||
void hb_hmac_sha384_update(hmac_sha384_ctx *ctx, const void *message,
|
||||
unsigned int message_len);
|
||||
void hb_hmac_sha384_final(hmac_sha384_ctx *ctx, unsigned char *mac,
|
||||
unsigned int mac_size);
|
||||
void hb_hmac_sha384(const void *key, unsigned int key_size,
|
||||
const void *message, unsigned int message_len,
|
||||
unsigned char *mac, unsigned mac_size);
|
||||
|
||||
void hmac_sha512_init(hmac_sha512_ctx *ctx, const void *key,
|
||||
unsigned int key_size);
|
||||
void hmac_sha512_reinit(hmac_sha512_ctx *ctx);
|
||||
void hmac_sha512_update(hmac_sha512_ctx *ctx, const void *message,
|
||||
unsigned int message_len);
|
||||
void hmac_sha512_final(hmac_sha512_ctx *ctx, unsigned char *mac,
|
||||
unsigned int mac_size);
|
||||
void hmac_sha512(const void *key, unsigned int key_size,
|
||||
const void *message, unsigned int message_len,
|
||||
unsigned char *mac, unsigned mac_size);
|
||||
void hb_hmac_sha512_init(hmac_sha512_ctx *ctx, const void *key,
|
||||
unsigned int key_size);
|
||||
void hb_hmac_sha512_reinit(hmac_sha512_ctx *ctx);
|
||||
void hb_hmac_sha512_update(hmac_sha512_ctx *ctx, const void *message,
|
||||
unsigned int message_len);
|
||||
void hb_hmac_sha512_final(hmac_sha512_ctx *ctx, unsigned char *mac,
|
||||
unsigned int mac_size);
|
||||
void hb_hmac_sha512(const void *key, unsigned int key_size,
|
||||
const void *message, unsigned int message_len,
|
||||
unsigned char *mac, unsigned mac_size);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -7137,7 +7137,7 @@ STATIC FUNCTION dep_evaluate( hbmk )
|
||||
ELSE
|
||||
/* Don't issue a missing dependency error (just warning) for non-*nix
|
||||
platforms if no manual dependency location and no local dir were
|
||||
given. This assumes that one these platforms dependencies can never
|
||||
specified. This assumes that on these platforms dependencies can never
|
||||
be found on locations known in advance and specified in make
|
||||
files. [vszakats] */
|
||||
IF hbmk[ _HBMK_cPLAT ] $ "win|wce|os2|dos" .AND. ;
|
||||
|
||||
Reference in New Issue
Block a user