cipher_wrap.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /*
  2. * GRUB -- GRand Unified Bootloader
  3. * Copyright (C) 2009 Free Software Foundation, Inc.
  4. *
  5. * GRUB is free software: you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation, either version 3 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * GRUB is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. #ifndef GRUB_GCRY_WRAP_HEADER
  19. #define GRUB_GCRY_WRAP_HEADER 1
  20. #include <grub/types.h>
  21. #include <grub/mm.h>
  22. #include <grub/misc.h>
  23. #include <grub/dl.h>
  24. #include <grub/crypto.h>
  25. #include <sys/types.h>
  26. #define _gcry_mpi_invm gcry_mpi_invm
  27. #define _gcry_mpi_set gcry_mpi_set
  28. #define _gcry_mpi_set_ui gcry_mpi_set_ui
  29. #define size_t grub_size_t
  30. #undef __GNU_LIBRARY__
  31. #define __GNU_LIBRARY__ 1
  32. #define U64_C(c) (c ## ULL)
  33. #define PUBKEY_FLAG_NO_BLINDING (1 << 0)
  34. #define CIPHER_INFO_NO_WEAK_KEY 1
  35. #define HAVE_U64_TYPEDEF 1
  36. /* Selftests are in separate modules. */
  37. static inline char *
  38. selftest (void)
  39. {
  40. return NULL;
  41. }
  42. static inline int
  43. _gcry_fips_mode (void)
  44. {
  45. return 0;
  46. }
  47. #define assert gcry_assert
  48. #ifdef GRUB_UTIL
  49. #define memset grub_memset
  50. #endif
  51. #define DBG_CIPHER 0
  52. #include <string.h>
  53. #pragma GCC diagnostic ignored "-Wredundant-decls"
  54. #include <grub/gcrypt/g10lib.h>
  55. #include <grub/gcrypt/gcrypt.h>
  56. #define gcry_mpi_mod _gcry_mpi_mod
  57. #endif