2N/A/*
2N/A * GRUB -- GRand Unified Bootloader
2N/A * Copyright (C) 2009 Free Software Foundation, Inc.
2N/A *
2N/A * GRUB is free software: you can redistribute it and/or modify
2N/A * it under the terms of the GNU General Public License as published by
2N/A * the Free Software Foundation, either version 3 of the License, or
2N/A * (at your option) any later version.
2N/A *
2N/A * GRUB is distributed in the hope that it will be useful,
2N/A * but WITHOUT ANY WARRANTY; without even the implied warranty of
2N/A * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2N/A * GNU General Public License for more details.
2N/A *
2N/A * You should have received a copy of the GNU General Public License
2N/A * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
2N/A */
2N/A
2N/A#ifndef GRUB_GCRY_WRAP_HEADER
2N/A#define GRUB_GCRY_WRAP_HEADER 1
2N/A
2N/A#include <grub/types.h>
2N/A#include <grub/mm.h>
2N/A#include <grub/misc.h>
2N/A#include <grub/dl.h>
2N/A#include <grub/crypto.h>
2N/A
2N/A#undef WORDS_BIGENDIAN
2N/A
2N/A#ifdef GRUB_CPU_WORDS_BIGENDIAN
2N/A#define WORDS_BIGENDIAN 1
2N/A#endif
2N/A
2N/A#define __GNU_LIBRARY__
2N/A
2N/A#define DIM ARRAY_SIZE
2N/A
2N/Atypedef grub_uint64_t u64;
2N/Atypedef grub_uint32_t u32;
2N/Atypedef grub_uint16_t u16;
2N/Atypedef grub_uint8_t byte;
2N/Atypedef grub_size_t size_t;
2N/A
2N/A#define U64_C(c) (c ## ULL)
2N/A
2N/A#define _gcry_burn_stack grub_burn_stack
2N/A#define log_error(fmt, args...) grub_dprintf ("crypto", fmt, ## args)
2N/A
2N/A
2N/A#define PUBKEY_FLAG_NO_BLINDING (1 << 0)
2N/A
2N/A#define CIPHER_INFO_NO_WEAK_KEY 1
2N/A
2N/A#define HAVE_U64_TYPEDEF 1
2N/A
2N/Atypedef union {
2N/A int a;
2N/A short b;
2N/A char c[1];
2N/A long d;
2N/A#ifdef HAVE_U64_TYPEDEF
2N/A u64 e;
2N/A#endif
2N/A float f;
2N/A double g;
2N/A} PROPERLY_ALIGNED_TYPE;
2N/A
2N/A#define gcry_assert(x) grub_assert_real(GRUB_FILE, __LINE__, x)
2N/A
2N/Astatic inline void
2N/Agrub_assert_real (const char *file, int line, int cond)
2N/A{
2N/A if (!cond)
2N/A grub_fatal ("Assertion failed at %s:%d\n", file, line);
2N/A}
2N/A
2N/A/* Selftests are in separate modules. */
2N/Astatic inline char *
2N/Aselftest (void)
2N/A{
2N/A return NULL;
2N/A}
2N/A
2N/Astatic inline int
2N/Afips_mode (void)
2N/A{
2N/A return 0;
2N/A}
2N/A
2N/A#ifdef GRUB_UTIL
2N/Astatic inline void *
2N/Amemcpy (void *dest, const void *src, grub_size_t n)
2N/A{
2N/A return grub_memcpy (dest, src, n);
2N/A}
2N/A
2N/Astatic inline void *
2N/Amemset (void *s, int c, grub_size_t n)
2N/A{
2N/A return grub_memset (s, c, n);
2N/A}
2N/A
2N/Astatic inline int
2N/Amemcmp (const void *s1, const void *s2, grub_size_t n)
2N/A{
2N/A return grub_memcmp (s1, s2, n);
2N/A}
2N/A#endif
2N/A
2N/A
2N/A#endif