/* ----------------------------------------------------------------------------
 * Raima Database Manager
 *
 * Copyright (c) 2010 Raima Inc.,  All rights reserved.
 *
 * Use of this software, whether in source code format, or in executable,
 * binary object code form, is governed by the Raima LICENSE which
 * is fully described in the LICENSE.TXT file, included within this
 * distribution of files.
 * ----------------------------------------------------------------------------
 */

#if !defined(ENCPRIV_H)
#define ENCPRIV_H

#include "psp.h"
#include "rdm.h"



#if defined(__cplusplus)
extern "C" {
#endif

#define NUMBYTES(x) ((x) / 8)

#define ENC_FAST    1
#define CHARSPERKEY 8

#define SHA_DIGESTSIZE     NUMBYTES(160)
#define SHA224_DIGESTSIZE  NUMBYTES(224)
#define SHA256_DIGESTSIZE  NUMBYTES(256)
#define SHA384_DIGESTSIZE  NUMBYTES(384)
#define SHA512_DIGESTSIZE  NUMBYTES(512)

#define INI_ACCOUNTS_SECTION    "Accounts"

#if defined(RDM_NEED_ENC_SYSKEY)
PSP_PRIVATE void      enc_syskey(char c, char syskey[RDM_SYS_KEYLEN]);
#endif
RDM_EXPORT ENC_TYPE EXTERNAL_FCN enc_get_type(const char *full_passcode, const char **user_passcode);

typedef struct {
    PSP_MEMTAG tag;
    void     *aes;
    uint32_t  blocksize;
    uint8_t   key[CHARSPERKEY];
} ENCCB;

#if defined(__cplusplus)
}
#endif

#endif /* ENCPRIV_H */

