summaryrefslogtreecommitdiff
path: root/host/lib21/include/host_misc21.h
blob: 795ebb23ac82615220d29ed8f99421fb9de92402 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/* Copyright 2015 The Chromium OS Authors. All rights reserved.
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#ifndef VBOOT_REFERENCE_HOST_MISC2_H_
#define VBOOT_REFERENCE_HOST_MISC2_H_

#include <stdint.h>
#include <stdio.h>

#include "2id.h"

/* Length of string representation, including trailing '\0' */
#define VB2_ID_MIN_STRLEN (2 * VB2_ID_NUM_BYTES + 1)

/**
 * Convert hex string to struct vb2_id.
 *
 * @param str		Example: "01ABef000042"
 * @param id            Destination for binary representation
 * @return VB2_SUCCESS, or non-zero if error.
 */
vb2_error_t vb2_str_to_id(const char *str, struct vb2_id *id);

#endif  /* VBOOT_REFERENCE_HOST_MISC2_H_ */