host_misc2.h 723 B

123456789101112131415161718192021222324252627
  1. /* Copyright 2015 The Chromium OS Authors. All rights reserved.
  2. * Use of this source code is governed by a BSD-style license that can be
  3. * found in the LICENSE file.
  4. */
  5. #ifndef VBOOT_REFERENCE_HOST_MISC2_H_
  6. #define VBOOT_REFERENCE_HOST_MISC2_H_
  7. #include <stdint.h>
  8. #include <stdio.h>
  9. #include "2id.h"
  10. /* Length of string representation, including trailing '\0' */
  11. #define VB2_ID_MIN_STRLEN (2 * VB2_ID_NUM_BYTES + 1)
  12. /**
  13. * Convert hex string to struct vb2_id.
  14. *
  15. * @param str Example: "01ABef000042"
  16. * @param id Destination for binary representation
  17. * @return VB2_SUCCESS, or non-zero if error.
  18. */
  19. int vb2_str_to_id(const char *str, struct vb2_id *id);
  20. #endif /* VBOOT_REFERENCE_HOST_MISC2_H_ */