text: #include "utils/s2n_safety.h"
  #include "crypto/pq3/secube-host/se3c1def.h"
  
  #define UINT32TOUINT16( x )              do {if ( (x) > 65535 ) return S2N_FAILURE;} while (0)
  
  /* Function return code  */
  #define PQ3_SUCCESS 0
  #define PQ3_FAILURE -1
  
  #define PQ3TLS_GUARD( x , errcode)                  \
    do {                                              \
       if (x != SE3_OK) {                             \
          printf("Failure with code %i \n", errcode); \
          S2N_ERROR( errcode );                       \
  	 }                                                \
    } while (0)
  
  #define PQ3TLS_GUARD_PTR( x , errcode)                  \
    do {                                              \
       if (x != SE3_OK) {                             \
          printf("Failure with code %i \n", errcode); \
          S2N_ERROR_PTR( errcode );                       \
  	 }                                                \
    } while (0)
  
  #define PQ3TLS_GUARD_CTX_LOGOUT_PTR( x , errcode, s)\
    do {                                              \
       if (x != SE3_OK) {                             \
          printf("Failure with code %i \n", errcode); \
          L1_logout(s);                    \
          S2N_ERROR_PTR( errcode );                       \
  	 }                                                \
    } while (0)
  #define PQ3TLS_GUARD_CTX_LOGOUT( x , errcode, s)\
    do {                                              \
       if (x != SE3_OK) {                             \
          printf("Failure with code %i \n", errcode); \
          L1_logout(s);                    \
          S2N_ERROR( errcode );                       \
  	 }                                                \
    } while (0)
  
  typedef enum {
     PQ3_ERR_L0_OPEN,
     PQ3_ERR_L1_LOGIN,
     PQ3_ERR_L1_LOGOUT,
     PQ3_ERR_L1_KEY_UPDATE,
     PQ3_ERR_L1_CRYPTO_SET_TIME,
     PQ3_ERR_CRYPTO_INIT,
     PQ3_ERR_CRYPTO_UPDATE,
     PQ3_ERR_CRYPTO_KEM_KEYPAIR,
  } pq3_error;
  
  
  