#ifndef __ASN1_ARCH_BLOWFISH_CONFIG_H__
#define __ASN1_ARCH_BLOWFISH_CONFIG_H__

#include <tee_internal_api.h>

#define CALLOC(nmemb, size) TEE_Malloc((nmemb) * (size), HINT_FILL_WITH_ZEROS)
#define MALLOC(size)    TEE_Malloc(size, HINT_DONT_FILL_WITH_ZEROS)
#define REALLOC(oldptr, size) TEE_Realloc(oldptr, size)
#define FREEMEM(ptr)    TEE_Free(ptr)

#ifndef alloca
#define alloca(size)   __builtin_alloca (size)
#endif

/*
File stdlib.h in Teegris-SDK does not contain prototype for bsearch function.
So put prototype here to avoid compile time warning.
This platform uses platform-specific implementation of bsearch.
Definition is in ../bsearch.c file.
*/
const void *bsearch(
    const void *key, const void *base_, size_t num, size_t size,
    int (*compar)(const void *, const void *));

#endif // __ASN1_ARCH_BLOWFISH_CONFIG_H__
