QTfrontend/sha1.h
changeset 33 d6363050cad0
parent 21 dff476dcaaa3
equal deleted inserted replaced
32:78bff13b11c0 33:d6363050cad0
    37 #include <qglobal.h>
    37 #include <qglobal.h>
    38 
    38 
    39 #ifdef __cplusplus
    39 #ifdef __cplusplus
    40 extern "C" {
    40 extern "C" {
    41 #endif
    41 #endif
    42 typedef unsigned char caddr_t[20];
    42 typedef unsigned char sha1_digest[20];
    43 
    43 
    44 struct sha1_ctxt {
    44 struct sha1_ctxt {
    45 	union {
    45 	union {
    46 		quint8	b8[20];
    46 		quint8	b8[20];
    47 		quint32	b32[5];
    47 		quint32	b32[5];
    58 };
    58 };
    59 
    59 
    60 void sha1_init(struct sha1_ctxt *ctxt);
    60 void sha1_init(struct sha1_ctxt *ctxt);
    61 void sha1_pad(struct sha1_ctxt *ctxt);
    61 void sha1_pad(struct sha1_ctxt *ctxt);
    62 extern void sha1_loop(struct sha1_ctxt *ctxt, const quint8 *input, size_t len);
    62 extern void sha1_loop(struct sha1_ctxt *ctxt, const quint8 *input, size_t len);
    63 extern void sha1_result(struct sha1_ctxt *ctxt, caddr_t digest0);
    63 extern void sha1_result(struct sha1_ctxt *ctxt, sha1_digest digest0);
    64 #ifdef __cplusplus
    64 #ifdef __cplusplus
    65 }
    65 }
    66 #endif
    66 #endif
    67 
    67 
    68 #define SHA1Init(x)		sha1_init((x))
    68 #define SHA1Init(x)		sha1_init((x))