MagickCore 7.0.10
md5.c
Go to the documentation of this file.
1/*
2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3% %
4% %
5% M M DDDD 55555 %
6% MM MM D D 5 %
7% M M M D D 55555 %
8% M M D D 5 %
9% M M DDDD 55555 %
10% %
11% %
12% Wizard's Toolkit Message Digest Algorithm-5 Methods %
13% %
14% Software Design %
15% Cristy %
16% March 2003 %
17% %
18% %
19% Copyright @ 1999 ImageMagick Studio LLC, a non-profit organization %
20% dedicated to making software imaging solutions freely available. %
21% %
22% You may not use this file except in compliance with the License. You may %
23% obtain a copy of the License at %
24% %
25% https://imagemagick.org/script/license.php %
26% %
27% Unless required by applicable law or agreed to in writing, software %
28% distributed under the License is distributed on an "AS IS" BASIS, %
29% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. %
30% See the License for the specific language governing permissions and %
31% limitations under the License. %
32% %
33%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
34%
35%
36*/
37
38/*
39 Include declarations.
40*/
41#include "wizard/studio.h"
42#include "wizard/exception.h"
44#include "wizard/memory_.h"
45#include "wizard/md5.h"
46
47/*
48 Define declarations.
49*/
50#define MD5Blocksize 64
51#define MD5Digestsize 16
52
53/*
54 Typedef declarations.
55*/
57{
58 unsigned int
61
65
66 unsigned int
70
71 time_t
73
74 size_t
76};
77
78/*
79 Forward declaraction.
80*/
81static void
82 TransformMD5(MD5Info *,const unsigned int *);
83
84/*
85%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
86% %
87% %
88% %
89% A c q u i r e M D 5 I n f o %
90% %
91% %
92% %
93%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
94%
95% AcquireMD5Info() allocate the MD5Info structure.
96%
97% The format of the AcquireMD5Info method is:
98%
99% MD5Info *AcquireMD5Info(void)
100%
101*/
103{
104 MD5Info
105 *md5_info;
106
107 md5_info=(MD5Info *) AcquireWizardMemory(sizeof(*md5_info));
108 if (md5_info == (MD5Info *) NULL)
110 (void) memset(md5_info,0,sizeof(*md5_info));
111 md5_info->digestsize=MD5Digestsize;
112 md5_info->blocksize=MD5Blocksize;
115 md5_info->accumulator=(unsigned int *) AcquireQuantumMemory(4UL,
116 sizeof(*md5_info->accumulator));
117 if (md5_info->accumulator == (unsigned int *) NULL)
119 md5_info->timestamp=time((time_t *) NULL);
120 md5_info->signature=WizardSignature;
121 return(md5_info);
122}
123
124/*
125%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
126% %
127% %
128% %
129% D e s t r o y M D 5 I n f o %
130% %
131% %
132% %
133%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
134%
135% DestroyMD5Info() zeros memory associated with the MD5Info structure.
136%
137% The format of the DestroyMD5Info method is:
138%
139% MD5Info *DestroyMD5Info(MD5Info *md5_info)
140%
141% A description of each parameter follows:
142%
143% o md5_info: The cipher md5_info.
144%
145*/
147{
149 assert(md5_info != (MD5Info *) NULL);
150 assert(md5_info->signature == WizardSignature);
151 if (md5_info->accumulator != (unsigned int *) NULL)
152 md5_info->accumulator=(unsigned int *)
154 if (md5_info->message != (StringInfo *) NULL)
155 md5_info->message=DestroyStringInfo(md5_info->message);
156 if (md5_info->digest != (StringInfo *) NULL)
157 md5_info->digest=DestroyStringInfo(md5_info->digest);
158 md5_info->signature=(~WizardSignature);
159 md5_info=(MD5Info *) RelinquishWizardMemory(md5_info);
160 return(md5_info);
161}
162
163/*
164%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
165% %
166% %
167% %
168% F i n a l i z e M D 5 %
169% %
170% %
171% %
172%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
173%
174% FinalizeMD5() finalizes the MD5 message digest computation.
175%
176% The format of the FinalizeMD5 method is:
177%
178% WizardBooleanType FinalizeMD5(MD5Info *md5_info)
179%
180% A description of each parameter follows:
181%
182% o md5_info: The address of a structure of type MD5Info.
183%
184*/
186{
187 ssize_t
188 number_bytes;
189
190 ssize_t
191 i;
192
193 unsigned char
194 *p;
195
197 *pad;
198
199 unsigned char
200 *datum;
201
202 unsigned int
203 message[16];
204
205 /*
206 Save number of bits.
207 */
209 assert(md5_info != (MD5Info *) NULL);
210 assert(md5_info->signature == WizardSignature);
211 message[14]=md5_info->low_order;
212 message[15]=md5_info->high_order;
213 /*
214 Final number of bytes mod 64.
215 */
216 number_bytes=(ssize_t) ((md5_info->low_order >> 3) & 0x3F);
217 /*
218 Pad message to 56 mod 64.
219 */
220 pad=AcquireStringInfo((size_t) ((number_bytes < 56) ? (56-number_bytes) :
221 (120-number_bytes)));
222 datum=GetStringInfoDatum(pad);
223 datum[0]=(unsigned char) 0x80;
224 for (i=1; i < (ssize_t) GetStringInfoLength(pad); i++)
225 datum[i]=(unsigned char) 0x0;
226 UpdateMD5(md5_info,pad);
227 pad=DestroyStringInfo(pad);
228 /*
229 Append length in bits and transform.
230 */
231 p=GetStringInfoDatum(md5_info->message);
232 for (i=0; i < 14; i++)
233 {
234 message[i]=(unsigned int) (*p++);
235 message[i]|=((unsigned int) (*p++)) << 8;
236 message[i]|=((unsigned int) (*p++)) << 16;
237 message[i]|=((unsigned int) (*p++)) << 24;
238 }
239 TransformMD5(md5_info,message);
240 /*
241 Store message in digest.
242 */
243 p=GetStringInfoDatum(md5_info->digest);
244 for (i=0; i < (MD5Digestsize/4); i++)
245 {
246 *p++=(unsigned char) (md5_info->accumulator[i] & 0xff);
247 *p++=(unsigned char) ((md5_info->accumulator[i] >> 8) & 0xff);
248 *p++=(unsigned char) ((md5_info->accumulator[i] >> 16) & 0xff);
249 *p++=(unsigned char) ((md5_info->accumulator[i] >> 24) & 0xff);
250 }
251 /*
252 Reset working registers.
253 */
254 number_bytes=0;
255 (void) memset(message,0,sizeof(message));
256 return(WizardTrue);
257}
258
259/*
260%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
261% %
262% %
263% %
264% G e t M D 5 B l o c k s i z e %
265% %
266% %
267% %
268%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
269%
270% GetMD5Blocksize() returns the MD5 blocksize.
271%
272% The format of the GetMD5Blocksize method is:
273%
274% unsigned int *GetMD5Blocksize(const MD5Info *md5_info)
275%
276% A description of each parameter follows:
277%
278% o md5_info: The md5 info.
279%
280*/
281WizardExport unsigned int GetMD5Blocksize(const MD5Info *md5_info)
282{
284 WizardAssert(CipherDomain,md5_info != (MD5Info *) NULL);
286 return(md5_info->blocksize);
287}
288
289/*
290%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
291% %
292% %
293% %
294% G e t M D 5 D i g e s t %
295% %
296% %
297% %
298%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
299%
300% GetMD5Digest() returns the MD5 digest.
301%
302% The format of the GetMD5Digest method is:
303%
304% const StringInfo *GetMD5Digest(const MD5Info *md5_info)
305%
306% A description of each parameter follows:
307%
308% o md5_info: The md5 info.
309%
310*/
312{
314 WizardAssert(HashDomain,md5_info != (MD5Info *) NULL);
316 return(md5_info->digest);
317}
318
319/*
320%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
321% %
322% %
323% %
324% G e t M D 5 D i g e s t s i z e %
325% %
326% %
327% %
328%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
329%
330% GetMD5Digestsize() returns the MD5 digest size.
331%
332% The format of the GetMD5Digestsize method is:
333%
334% unsigned int *GetMD5Digestsize(const MD5Info *md5_info)
335%
336% A description of each parameter follows:
337%
338% o md5_info: The md5 info.
339%
340*/
341WizardExport unsigned int GetMD5Digestsize(const MD5Info *md5_info)
342{
344 WizardAssert(CipherDomain,md5_info != (MD5Info *) NULL);
346 return(md5_info->digestsize);
347}
348
349/*
350%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
351% %
352% %
353% %
354% I n i t i a l i z e M D 5 %
355% %
356% %
357% %
358%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
359%
360% IntializeMD5() intializes the MD5 digest.
361%
362% The format of the InitializeMD5 method is:
363%
364% WizardBooleanType InitializeMD5(md5_info)
365%
366% A description of each parameter follows:
367%
368% o md5_info: The address of a structure of type MD5Info.
369%
370*/
372{
374 assert(md5_info != (MD5Info *) NULL);
375 assert(md5_info->signature == WizardSignature);
376 md5_info->low_order=(unsigned int) 0;
377 md5_info->high_order=(unsigned int) 0;
378 /*
379 Load magic initialization constants.
380 */
381 md5_info->accumulator[0]=(unsigned int) 0x67452301;
382 md5_info->accumulator[1]=(unsigned int) 0xefcdab89;
383 md5_info->accumulator[2]=(unsigned int) 0x98badcfe;
384 md5_info->accumulator[3]=(unsigned int) 0x10325476;
385 return(WizardTrue);
386}
387
388/*
389%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
390% %
391% %
392% %
393% T r a n s f o r m M D 5 %
394% %
395% %
396% %
397%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
398%
399% TransformMD5() transforms the MD5 message digest.
400%
401% The format of the TransformMD5 method is:
402%
403% TransformMD5(MD5Info *md5_info)
404%
405% A description of each parameter follows:
406%
407% o md5_info: The address of a structure of type MD5Info.
408%
409%
410*/
411
412static inline unsigned int F(const unsigned int x,const unsigned int y,
413 const unsigned int z)
414{
415 return((x & y) | (~x & z));
416}
417
418static inline unsigned int G(const unsigned int x,const unsigned int y,
419 const unsigned int z)
420{
421 return((x & z) | (y & ~z));
422}
423
424static inline unsigned int H(const unsigned int x,const unsigned int y,
425 const unsigned int z)
426{
427 return(x ^ y ^ z);
428}
429
430static inline unsigned int I(const unsigned int x,const unsigned int y,
431 const unsigned int z)
432{
433 return(y ^ (x | ~z));
434}
435
436static inline unsigned int Trunc32(const unsigned int x)
437{
438 return((unsigned int) (x & 0xffffffffUL));
439}
440
441static inline unsigned int RotateLeft(const unsigned int x,const unsigned int n)
442{
443 return(Trunc32((x << n) | (x >> (32-n))));
444}
445
446static void TransformMD5(MD5Info *md5_info,const unsigned int *message)
447{
448 const unsigned int
449 *p;
450
451 ssize_t
452 i;
453
454 unsigned int
455 j;
456
457 static const unsigned int
458 K[64]=
459 {
460 0xd76aa478U, 0xe8c7b756U, 0x242070dbU, 0xc1bdceeeU, 0xf57c0fafU,
461 0x4787c62aU, 0xa8304613U, 0xfd469501U, 0x698098d8U, 0x8b44f7afU,
462 0xffff5bb1U, 0x895cd7beU, 0x6b901122U, 0xfd987193U, 0xa679438eU,
463 0x49b40821U, 0xf61e2562U, 0xc040b340U, 0x265e5a51U, 0xe9b6c7aaU,
464 0xd62f105dU, 0x02441453U, 0xd8a1e681U, 0xe7d3fbc8U, 0x21e1cde6U,
465 0xc33707d6U, 0xf4d50d87U, 0x455a14edU, 0xa9e3e905U, 0xfcefa3f8U,
466 0x676f02d9U, 0x8d2a4c8aU, 0xfffa3942U, 0x8771f681U, 0x6d9d6122U,
467 0xfde5380cU, 0xa4beea44U, 0x4bdecfa9U, 0xf6bb4b60U, 0xbebfbc70U,
468 0x289b7ec6U, 0xeaa127faU, 0xd4ef3085U, 0x04881d05U, 0xd9d4d039U,
469 0xe6db99e5U, 0x1fa27cf8U, 0xc4ac5665U, 0xf4292244U, 0x432aff97U,
470 0xab9423a7U, 0xfc93a039U, 0x655b59c3U, 0x8f0ccc92U, 0xffeff47dU,
471 0x85845dd1U, 0x6fa87e4fU, 0xfe2ce6e0U, 0xa3014314U, 0x4e0811a1U,
472 0xf7537e82U, 0xbd3af235U, 0x2ad7d2bbU, 0xeb86d391U,
473 }; /* 4294967296*abs(sin(i)), i in radians */
474
475 unsigned int
476 A,
477 B,
478 C,
479 D;
480
481 /*
482 Copy accumulator to registers
483 */
484 A=md5_info->accumulator[0];
485 B=md5_info->accumulator[1];
486 C=md5_info->accumulator[2];
487 D=md5_info->accumulator[3];
488 /*
489 a=b+((a+F(b,c,d)+X[k]+t) <<< s).
490 */
491 p=K;
492 j=0;
493 for (i=0; i < 4; i++)
494 {
495 A+=F(B,C,D)+message[j & 0x0f]+(*p++);
496 A=RotateLeft(A,7)+B;
497 j++;
498 D+=F(A,B,C)+message[j & 0x0f]+(*p++);
499 D=RotateLeft(D,12)+A;
500 j++;
501 C+=F(D,A,B)+message[j & 0x0f]+(*p++);
502 C=RotateLeft(C,17)+D;
503 j++;
504 B+=F(C,D,A)+message[j & 0x0f]+(*p++);
505 B=RotateLeft(B,22)+C;
506 j++;
507 }
508 /*
509 a=b+((a+G(b,c,d)+X[k]+t) <<< s).
510 */
511 j=1;
512 for (i=0; i < 4; i++)
513 {
514 A+=G(B,C,D)+message[j & 0x0f]+(*p++);
515 A=RotateLeft(A,5)+B;
516 j+=5;
517 D+=G(A,B,C)+message[j & 0x0f]+(*p++);
518 D=RotateLeft(D,9)+A;
519 j+=5;
520 C+=G(D,A,B)+message[j & 0x0f]+(*p++);
521 C=RotateLeft(C,14)+D;
522 j+=5;
523 B+=G(C,D,A)+message[j & 0x0f]+(*p++);
524 B=RotateLeft(B,20)+C;
525 j+=5;
526 }
527 /*
528 a=b+((a+H(b,c,d)+X[k]+t) <<< s).
529 */
530 j=5;
531 for (i=0; i < 4; i++)
532 {
533 A+=H(B,C,D)+message[j & 0x0f]+(*p++);
534 A=RotateLeft(A,4)+B;
535 j+=3;
536 D+=H(A,B,C)+message[j & 0x0f]+(*p++);
537 D=RotateLeft(D,11)+A;
538 j+=3;
539 C+=H(D,A,B)+message[j & 0x0f]+(*p++);
540 C=RotateLeft(C,16)+D;
541 j+=3;
542 B+=H(C,D,A)+message[j & 0x0f]+(*p++);
543 B=RotateLeft(B,23)+C;
544 j+=3;
545 }
546 /*
547 a=b+((a+I(b,c,d)+X[k]+t) <<< s).
548 */
549 j=0;
550 for (i=0; i < 4; i++)
551 {
552 A+=I(B,C,D)+message[j & 0x0f]+(*p++);
553 A=RotateLeft(A,6)+B;
554 j+=7;
555 D+=I(A,B,C)+message[j & 0x0f]+(*p++);
556 D=RotateLeft(D,10)+A;
557 j+=7;
558 C+=I(D,A,B)+message[j & 0x0f]+(*p++);
559 C=RotateLeft(C,15)+D;
560 j+=7;
561 B+=I(C,D,A)+message[j & 0x0f]+(*p++);
562 B=RotateLeft(B,21)+C;
563 j+=7;
564 }
565 /*
566 Add registers back to accumulator.
567 */
568 md5_info->accumulator[0]=Trunc32(md5_info->accumulator[0]+A);
569 md5_info->accumulator[1]=Trunc32(md5_info->accumulator[1]+B);
570 md5_info->accumulator[2]=Trunc32(md5_info->accumulator[2]+C);
571 md5_info->accumulator[3]=Trunc32(md5_info->accumulator[3]+D);
572 /*
573 Reset working registers.
574 */
575 A=0;
576 B=0;
577 C=0;
578 D=0;
579}
580
581/*
582%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
583% %
584% %
585% %
586% U p d a t e M D 5 %
587% %
588% %
589% %
590%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
591%
592% UpdateMD5() updates the MD5 message digest
593%
594% The format of the UpdateMD5 method is:
595%
596% WizardBooleanType UpdateMD5(MD5Info *md5_info,
597% const unsigned char *message)
598%
599% A description of each parameter follows:
600%
601% o md5_info: The address of a structure of type MD5Info.
602%
603*/
605 const StringInfo *message)
606{
607 unsigned char
608 *p;
609
610 ssize_t
611 i,
612 j;
613
614 unsigned char
615 *datum;
616
617 unsigned int
618 buffer[16],
619 number_bits,
620 number_bytes;
621
622 /*
623 Update the MD5 accumulator.
624 */
625 assert(md5_info != (MD5Info *) NULL);
626 assert(md5_info->signature == WizardSignature);
627 number_bytes=(unsigned int) ((md5_info->low_order >> 3) & 0x3F);
628 number_bits=(unsigned int) (md5_info->low_order+(GetStringInfoLength(message)
629 << 3));
630 if ((number_bits & 0xffffffff) < md5_info->low_order)
631 md5_info->high_order++;
632 md5_info->low_order+=(unsigned int) (GetStringInfoLength(message) << 3);
633 md5_info->high_order+=(unsigned int) (GetStringInfoLength(message) >> 29);
634 datum=GetStringInfoDatum(message);
635 for (i=0; i < (ssize_t) GetStringInfoLength(message); i++)
636 {
637 p=GetStringInfoDatum(md5_info->message);
638 p[number_bytes++]=datum[i];
639 if (number_bytes != 0x40)
640 continue;
641 for (j=0; j < 16; j++)
642 {
643 buffer[j]=(unsigned int) (*p++);
644 buffer[j]|=((unsigned int) (*p++)) << 8;
645 buffer[j]|=((unsigned int) (*p++)) << 16;
646 buffer[j]|=((unsigned int) (*p++)) << 24;
647 }
648 TransformMD5(md5_info,buffer);
649 number_bytes=0;
650 }
651 /*
652 Reset working registers.
653 */
654 number_bits=0;
655 number_bytes=0;
656 (void) memset(buffer,0,sizeof(buffer));
657 return(WizardTrue);
658}
#define WizardAssert(domain, predicate)
#define ThrowWizardFatalError(domain, error)
@ HashDomain
Definition exception.h:30
@ CipherDomain
Definition exception.h:34
@ MemoryError
Definition exception.h:49
WizardBooleanType LogWizardEvent(const LogEventType type, const char *module, const char *function, const size_t line, const char *format,...)
Definition log.c:1390
@ TraceEvent
Definition log.h:39
#define GetWizardModule()
Definition log.h:30
WizardExport WizardBooleanType InitializeMD5(MD5Info *md5_info)
Definition md5.c:371
#define MD5Blocksize
Definition md5.c:50
WizardExport const StringInfo * GetMD5Digest(const MD5Info *md5_info)
Definition md5.c:311
static unsigned int H(const unsigned int x, const unsigned int y, const unsigned int z)
Definition md5.c:424
WizardExport WizardBooleanType FinalizeMD5(MD5Info *md5_info)
Definition md5.c:185
static unsigned int I(const unsigned int x, const unsigned int y, const unsigned int z)
Definition md5.c:430
static void TransformMD5(MD5Info *, const unsigned int *)
Definition md5.c:446
WizardExport WizardBooleanType UpdateMD5(MD5Info *md5_info, const StringInfo *message)
Definition md5.c:604
WizardExport MD5Info * AcquireMD5Info(void)
Definition md5.c:102
WizardExport unsigned int GetMD5Blocksize(const MD5Info *md5_info)
Definition md5.c:281
WizardExport MD5Info * DestroyMD5Info(MD5Info *md5_info)
Definition md5.c:146
#define MD5Digestsize
Definition md5.c:51
WizardExport unsigned int GetMD5Digestsize(const MD5Info *md5_info)
Definition md5.c:341
static unsigned int F(const unsigned int x, const unsigned int y, const unsigned int z)
Definition md5.c:412
static unsigned int RotateLeft(const unsigned int x, const unsigned int n)
Definition md5.c:441
static unsigned int G(const unsigned int x, const unsigned int y, const unsigned int z)
Definition md5.c:418
WizardExport void * AcquireWizardMemory(const size_t size)
Definition memory.c:586
WizardExport void * AcquireQuantumMemory(const size_t count, const size_t quantum)
Definition memory.c:657
WizardExport void * RelinquishWizardMemory(void *memory)
Definition memory.c:1039
#define WizardExport
#define WizardSignature
#define Trunc32(x)
Definition signature.c:52
WizardExport size_t GetStringInfoLength(const StringInfo *string_info)
Definition string.c:1280
WizardExport StringInfo * AcquireStringInfo(const size_t length)
Definition string.c:179
WizardExport unsigned char * GetStringInfoDatum(const StringInfo *string_info)
Definition string.c:1251
WizardExport StringInfo * DestroyStringInfo(StringInfo *string_info)
Definition string.c:857
Definition md5.c:57
unsigned int high_order
Definition md5.c:69
StringInfo * digest
Definition md5.c:63
size_t signature
Definition md5.c:75
unsigned int digestsize
Definition md5.c:59
unsigned int low_order
Definition md5.c:68
StringInfo * message
Definition md5.c:64
unsigned int * accumulator
Definition md5.c:67
unsigned int blocksize
Definition md5.c:60
time_t timestamp
Definition md5.c:72
WizardBooleanType
Definition wizard-type.h:26
@ WizardTrue
Definition wizard-type.h:28