file_keys.h 691 B

123456789101112131415161718192021
  1. /* Copyright (c) 2010 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. * Utility functions for file and key handling.
  6. */
  7. #ifndef VBOOT_REFERENCE_FILE_KEYS_H_
  8. #define VBOOT_REFERENCE_FILE_KEYS_H_
  9. #include "2sha.h"
  10. /* Calculates the appropriate digest for the data in [input_file] based on the
  11. * hash algorithm [alg] and stores it into [digest], which is of size
  12. * [digest_size]. Returns VB2_SUCCESS, or non-zero on error.
  13. */
  14. int DigestFile(char *input_file, enum vb2_hash_algorithm alg,
  15. uint8_t *digest, uint32_t digest_size);
  16. #endif /* VBOOT_REFERENCE_FILE_KEYS_H_ */