2crypto.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /* Copyright (c) 2014 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. * Crypto constants for verified boot
  6. */
  7. #ifndef VBOOT_REFERENCE_VBOOT_2CRYPTO_H_
  8. #define VBOOT_REFERENCE_VBOOT_2CRYPTO_H_
  9. #include <stdint.h>
  10. /* Verified boot crypto algorithms */
  11. enum vb2_crypto_algorithm {
  12. VB2_ALG_RSA1024_SHA1 = 0,
  13. VB2_ALG_RSA1024_SHA256 = 1,
  14. VB2_ALG_RSA1024_SHA512 = 2,
  15. VB2_ALG_RSA2048_SHA1 = 3,
  16. VB2_ALG_RSA2048_SHA256 = 4,
  17. VB2_ALG_RSA2048_SHA512 = 5,
  18. VB2_ALG_RSA4096_SHA1 = 6,
  19. VB2_ALG_RSA4096_SHA256 = 7,
  20. VB2_ALG_RSA4096_SHA512 = 8,
  21. VB2_ALG_RSA8192_SHA1 = 9,
  22. VB2_ALG_RSA8192_SHA256 = 10,
  23. VB2_ALG_RSA8192_SHA512 = 11,
  24. /* Number of algorithms */
  25. VB2_ALG_COUNT
  26. };
  27. /* Algorithm types for signatures */
  28. enum vb2_signature_algorithm {
  29. /* Invalid or unsupported signature type */
  30. VB2_SIG_INVALID = 0,
  31. /*
  32. * No signature algorithm. The digest is unsigned. See
  33. * VB2_ID_NONE_* for key IDs to use with this algorithm.
  34. */
  35. VB2_SIG_NONE = 1,
  36. /* RSA algorithms of the given length in bits (1024-8192) */
  37. VB2_SIG_RSA1024 = 2, /* Warning! This is likely to be deprecated! */
  38. VB2_SIG_RSA2048 = 3,
  39. VB2_SIG_RSA4096 = 4,
  40. VB2_SIG_RSA8192 = 5,
  41. };
  42. /* Algorithm types for hash digests */
  43. enum vb2_hash_algorithm {
  44. /* Invalid or unsupported digest type */
  45. VB2_HASH_INVALID = 0,
  46. /* SHA-1. Warning: This is likely to be deprecated soon! */
  47. VB2_HASH_SHA1 = 1,
  48. /* SHA-256 and SHA-512 */
  49. VB2_HASH_SHA256 = 2,
  50. VB2_HASH_SHA512 = 3,
  51. /* Last index. Don't add anything below. */
  52. VB2_HASH_ALG_COUNT,
  53. };
  54. #endif /* VBOOT_REFERENCE_VBOOT_2CRYPTO_H_ */