Lines Matching refs:sig
25 VbSignature* sig = (VbSignature*)malloc(sizeof(VbSignature) + sig_size); in SignatureAlloc() local
26 if (!sig) in SignatureAlloc()
29 sig->sig_offset = sizeof(VbSignature); in SignatureAlloc()
30 sig->sig_size = sig_size; in SignatureAlloc()
31 sig->data_size = data_size; in SignatureAlloc()
32 return sig; in SignatureAlloc()
36 void SignatureInit(VbSignature* sig, uint8_t* sig_data, in SignatureInit() argument
38 sig->sig_offset = OffsetOf(sig, sig_data); in SignatureInit()
39 sig->sig_size = sig_size; in SignatureInit()
40 sig->data_size = data_size; in SignatureInit()
57 VbSignature* sig; in CalculateChecksum() local
63 sig = SignatureAlloc(SHA512_DIGEST_SIZE, 0); in CalculateChecksum()
64 if (!sig) { in CalculateChecksum()
68 sig->sig_offset = sizeof(VbSignature); in CalculateChecksum()
69 sig->sig_size = SHA512_DIGEST_SIZE; in CalculateChecksum()
70 sig->data_size = size; in CalculateChecksum()
73 Memcpy(GetSignatureData(sig), header_checksum, SHA512_DIGEST_SIZE); in CalculateChecksum()
75 return sig; in CalculateChecksum()
82 VbSignature* sig = NULL; in CalculateHash() local
90 sig = SignatureAlloc(digest_size, size); in CalculateHash()
91 if (!sig) { in CalculateHash()
97 Memcpy(GetSignatureData(sig), digest, digest_size); in CalculateHash()
101 return sig; in CalculateHash()
116 VbSignature* sig; in CalculateSignature() local
136 sig = SignatureAlloc(siglen_map[key->algorithm], size); in CalculateSignature()
137 if (!sig) { in CalculateSignature()
145 GetSignatureData(sig), /* Output sig */ in CalculateSignature()
152 free(sig); in CalculateSignature()
157 return sig; in CalculateSignature()
261 VbSignature* sig; in CalculateSignature_external() local
281 sig = SignatureAlloc(siglen_map[key_algorithm], size); in CalculateSignature_external()
282 if (!sig) { in CalculateSignature_external()
290 GetSignatureData(sig), /* Output sig */ in CalculateSignature_external()
298 free(sig); in CalculateSignature_external()
303 return sig; in CalculateSignature_external()