Lines Matching refs:signature_info
121 *signature_info; in AcquireSignatureInfo() local
126 signature_info=(SignatureInfo *) AcquireCriticalMemory( in AcquireSignatureInfo()
127 sizeof(*signature_info)); in AcquireSignatureInfo()
128 (void) memset(signature_info,0,sizeof(*signature_info)); in AcquireSignatureInfo()
129 signature_info->digestsize=SignatureDigestsize; in AcquireSignatureInfo()
130 signature_info->blocksize=SignatureBlocksize; in AcquireSignatureInfo()
131 signature_info->digest=AcquireStringInfo(SignatureDigestsize); in AcquireSignatureInfo()
132 signature_info->message=AcquireStringInfo(SignatureBlocksize); in AcquireSignatureInfo()
133 signature_info->accumulator=(unsigned int *) AcquireQuantumMemory( in AcquireSignatureInfo()
134 SignatureBlocksize,sizeof(*signature_info->accumulator)); in AcquireSignatureInfo()
135 if (signature_info->accumulator == (unsigned int *) NULL) in AcquireSignatureInfo()
137 (void) memset(signature_info->accumulator,0,SignatureBlocksize* in AcquireSignatureInfo()
138 sizeof(*signature_info->accumulator)); in AcquireSignatureInfo()
140 signature_info->lsb_first=(int) (*(char *) &lsb_first) == 1 ? MagickTrue : in AcquireSignatureInfo()
142 signature_info->timestamp=(ssize_t) GetMagickTime(); in AcquireSignatureInfo()
143 signature_info->signature=MagickCoreSignature; in AcquireSignatureInfo()
144 InitializeSignature(signature_info); in AcquireSignatureInfo()
145 return(signature_info); in AcquireSignatureInfo()
171 MagickPrivate SignatureInfo *DestroySignatureInfo(SignatureInfo *signature_info) in DestroySignatureInfo() argument
174 assert(signature_info != (SignatureInfo *) NULL); in DestroySignatureInfo()
175 assert(signature_info->signature == MagickCoreSignature); in DestroySignatureInfo()
176 if (signature_info->accumulator != (unsigned int *) NULL) in DestroySignatureInfo()
177 signature_info->accumulator=(unsigned int *) RelinquishMagickMemory( in DestroySignatureInfo()
178 signature_info->accumulator); in DestroySignatureInfo()
179 if (signature_info->message != (StringInfo *) NULL) in DestroySignatureInfo()
180 signature_info->message=DestroyStringInfo(signature_info->message); in DestroySignatureInfo()
181 if (signature_info->digest != (StringInfo *) NULL) in DestroySignatureInfo()
182 signature_info->digest=DestroyStringInfo(signature_info->digest); in DestroySignatureInfo()
183 signature_info->signature=(~MagickCoreSignature); in DestroySignatureInfo()
184 signature_info=(SignatureInfo *) RelinquishMagickMemory(signature_info); in DestroySignatureInfo()
185 return(signature_info); in DestroySignatureInfo()
210 MagickPrivate void FinalizeSignature(SignatureInfo *signature_info) in FinalizeSignature() argument
235 assert(signature_info != (SignatureInfo *) NULL); in FinalizeSignature()
236 assert(signature_info->signature == MagickCoreSignature); in FinalizeSignature()
237 low_order=signature_info->low_order; in FinalizeSignature()
238 high_order=signature_info->high_order; in FinalizeSignature()
240 datum=GetStringInfoDatum(signature_info->message); in FinalizeSignature()
242 if (extent <= (unsigned int) (GetStringInfoLength(signature_info->message)-8)) in FinalizeSignature()
244 signature_info->message)-8-extent); in FinalizeSignature()
248 signature_info->message)-extent); in FinalizeSignature()
249 TransformSignature(signature_info); in FinalizeSignature()
251 signature_info->message)-8); in FinalizeSignature()
261 TransformSignature(signature_info); in FinalizeSignature()
262 p=signature_info->accumulator; in FinalizeSignature()
263 q=GetStringInfoDatum(signature_info->digest); in FinalizeSignature()
297 const SignatureInfo *signature_info) in GetSignatureBlocksize() argument
300 assert(signature_info != (SignatureInfo *) NULL); in GetSignatureBlocksize()
301 assert(signature_info->signature == MagickCoreSignature); in GetSignatureBlocksize()
302 return(signature_info->blocksize); in GetSignatureBlocksize()
328 const SignatureInfo *signature_info) in GetSignatureDigest() argument
331 assert(signature_info != (SignatureInfo *) NULL); in GetSignatureDigest()
332 assert(signature_info->signature == MagickCoreSignature); in GetSignatureDigest()
333 return(signature_info->digest); in GetSignatureDigest()
359 const SignatureInfo *signature_info) in GetSignatureDigestsize() argument
362 assert(signature_info != (SignatureInfo *) NULL); in GetSignatureDigestsize()
363 assert(signature_info->signature == MagickCoreSignature); in GetSignatureDigestsize()
364 return(signature_info->digestsize); in GetSignatureDigestsize()
389 MagickPrivate void InitializeSignature(SignatureInfo *signature_info) in InitializeSignature() argument
392 assert(signature_info != (SignatureInfo *) NULL); in InitializeSignature()
393 assert(signature_info->signature == MagickCoreSignature); in InitializeSignature()
394 signature_info->accumulator[0]=0x6a09e667U; in InitializeSignature()
395 signature_info->accumulator[1]=0xbb67ae85U; in InitializeSignature()
396 signature_info->accumulator[2]=0x3c6ef372U; in InitializeSignature()
397 signature_info->accumulator[3]=0xa54ff53aU; in InitializeSignature()
398 signature_info->accumulator[4]=0x510e527fU; in InitializeSignature()
399 signature_info->accumulator[5]=0x9b05688cU; in InitializeSignature()
400 signature_info->accumulator[6]=0x1f83d9abU; in InitializeSignature()
401 signature_info->accumulator[7]=0x5be0cd19U; in InitializeSignature()
402 signature_info->low_order=0; in InitializeSignature()
403 signature_info->high_order=0; in InitializeSignature()
404 signature_info->extent=0; in InitializeSignature()
432 MagickPrivate void SetSignatureDigest(SignatureInfo *signature_info, in SetSignatureDigest() argument
438 assert(signature_info != (SignatureInfo *) NULL); in SetSignatureDigest()
439 assert(signature_info->signature == MagickCoreSignature); in SetSignatureDigest()
440 SetStringInfo(signature_info->digest,digest); in SetSignatureDigest()
486 *signature_info; in SignatureImage() local
504 signature_info=AcquireSignatureInfo(); in SignatureImage()
543 if (signature_info->lsb_first == MagickFalse) in SignatureImage()
553 UpdateSignature(signature_info,signature); in SignatureImage()
556 FinalizeSignature(signature_info); in SignatureImage()
557 hex_signature=StringInfoToHexString(GetSignatureDigest(signature_info)); in SignatureImage()
565 signature_info=DestroySignatureInfo(signature_info); in SignatureImage()
591 static void TransformSignature(SignatureInfo *signature_info) in TransformSignature() argument
645 p=GetStringInfoDatum(signature_info->message); in TransformSignature()
646 if (signature_info->lsb_first == MagickFalse) in TransformSignature()
691 A=signature_info->accumulator[0]; in TransformSignature()
692 B=signature_info->accumulator[1]; in TransformSignature()
693 C=signature_info->accumulator[2]; in TransformSignature()
694 D=signature_info->accumulator[3]; in TransformSignature()
695 E=signature_info->accumulator[4]; in TransformSignature()
696 F=signature_info->accumulator[5]; in TransformSignature()
697 G=signature_info->accumulator[6]; in TransformSignature()
698 H=signature_info->accumulator[7]; in TransformSignature()
717 signature_info->accumulator[0]=Trunc32(signature_info->accumulator[0]+A); in TransformSignature()
718 signature_info->accumulator[1]=Trunc32(signature_info->accumulator[1]+B); in TransformSignature()
719 signature_info->accumulator[2]=Trunc32(signature_info->accumulator[2]+C); in TransformSignature()
720 signature_info->accumulator[3]=Trunc32(signature_info->accumulator[3]+D); in TransformSignature()
721 signature_info->accumulator[4]=Trunc32(signature_info->accumulator[4]+E); in TransformSignature()
722 signature_info->accumulator[5]=Trunc32(signature_info->accumulator[5]+F); in TransformSignature()
723 signature_info->accumulator[6]=Trunc32(signature_info->accumulator[6]+G); in TransformSignature()
724 signature_info->accumulator[7]=Trunc32(signature_info->accumulator[7]+H); in TransformSignature()
766 MagickPrivate void UpdateSignature(SignatureInfo *signature_info, in UpdateSignature() argument
784 assert(signature_info != (SignatureInfo *) NULL); in UpdateSignature()
785 assert(signature_info->signature == MagickCoreSignature); in UpdateSignature()
787 length=Trunc32((unsigned int) (signature_info->low_order+(n << 3))); in UpdateSignature()
788 if (length < signature_info->low_order) in UpdateSignature()
789 signature_info->high_order++; in UpdateSignature()
790 signature_info->low_order=length; in UpdateSignature()
791 signature_info->high_order+=(unsigned int) n >> 29; in UpdateSignature()
793 if (signature_info->extent != 0) in UpdateSignature()
795 i=GetStringInfoLength(signature_info->message)-signature_info->extent; in UpdateSignature()
798 (void) memcpy(GetStringInfoDatum(signature_info->message)+ in UpdateSignature()
799 signature_info->extent,p,i); in UpdateSignature()
802 signature_info->extent+=i; in UpdateSignature()
803 if (signature_info->extent != GetStringInfoLength(signature_info->message)) in UpdateSignature()
805 TransformSignature(signature_info); in UpdateSignature()
807 while (n >= GetStringInfoLength(signature_info->message)) in UpdateSignature()
809 SetStringInfoDatum(signature_info->message,p); in UpdateSignature()
810 p+=GetStringInfoLength(signature_info->message); in UpdateSignature()
811 n-=GetStringInfoLength(signature_info->message); in UpdateSignature()
812 TransformSignature(signature_info); in UpdateSignature()
814 (void) memcpy(GetStringInfoDatum(signature_info->message),p,n); in UpdateSignature()
815 signature_info->extent=n; in UpdateSignature()