aboutsummaryrefslogtreecommitdiff
path: root/errorstrings.c
blob: 9686eabf992af4ae316f856ea0b2006148778ff6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/*
 * Translate HAL error codes to strings.
 */

#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <assert.h>

#include "cryptech.h"

#define DEFINE_HAL_ERROR(_code_,_text_)	\
  case _code_: return _text_;

const char *hal_error_string(const hal_error_t code)
{
  switch (code) {
    HAL_ERROR_LIST;
  default:
    return "Unknown HAL error code";
  }
}

#undef DEFINE_HAL_ERROR