Lines Matching refs:ver

87 static unsigned int sfp_hdr_size(uint8_t ver)  in sfp_hdr_size()  argument
89 if (ver == 0) in sfp_hdr_size()
91 if (ver == 1) in sfp_hdr_size()
96 static unsigned int sfp_pad_size(uint8_t ver) in sfp_pad_size() argument
98 if (ver == 0) in sfp_pad_size()
100 if (ver == 1) in sfp_pad_size()
110 static uint16_t sfp_hdr_checksum(uint8_t *buf, unsigned char ver) in sfp_hdr_checksum() argument
113 int len = sfp_hdr_size(ver) - sizeof(ret); in sfp_hdr_checksum()
121 static void sfp_build_header(uint8_t *buf, uint8_t ver, uint8_t flags, in sfp_build_header() argument
144 if (ver == 0) { in sfp_build_header()
159 static int sfp_verify_header(const uint8_t *buf, uint8_t *ver) in sfp_verify_header() argument
198 static int sfp_sign_buffer(uint8_t *buf, uint8_t ver, uint8_t flags, in sfp_sign_buffer() argument
207 sfp_build_header(buf + HEADER_OFFSET, ver, flags, len + 4); in sfp_sign_buffer()
217 return sfp_pad_size(ver); in sfp_sign_buffer()
226 uint8_t ver = 0; in sfp_verify_buffer() local
228 len = sfp_verify_header(buf + HEADER_OFFSET, &ver); in sfp_verify_buffer()
234 if (len < HEADER_OFFSET || len > sfp_pad_size(ver)) { in sfp_verify_buffer()
312 static int sfp_fake_header_size(unsigned int size, uint8_t ver) in sfp_fake_header_size() argument
314 return sfp_pad_size(ver) - size; in sfp_fake_header_size()
318 struct image_type_params *tparams, uint8_t ver) in sfp_vrec_header() argument
324 sbuf.st_size <= (sfp_pad_size(ver) - sizeof(uint32_t))) { in sfp_vrec_header()
326 tparams->header_size = sfp_fake_header_size(data_size, ver); in sfp_vrec_header()
344 static void sfp_set_header(void *ptr, unsigned char ver) in sfp_set_header() argument
355 memmove(buf, buf + sfp_fake_header_size(data_size, ver), data_size); in sfp_set_header()
356 memset(buf + data_size, 0, sfp_fake_header_size(data_size, ver)); in sfp_set_header()
358 sfp_sign_buffer(buf, ver, 0, data_size, 0); in sfp_set_header()