Logo Search packages:      
Sourcecode: libtomcrypt version File versions  Download package

int pelican_init ( pelican_state *  pelmac,
const unsigned char *  key,
unsigned long  keylen 

Initialize a Pelican state

pelmacThe Pelican state to initialize
keyThe secret key
keylenThe length of the secret key (octets)
CRYPT_OK if successful

Definition at line 31 of file pelican.c.

References zeromem().

Referenced by pelican_memory().

    int err;
    LTC_ARGCHK(pelmac != NULL);
    LTC_ARGCHK(key    != NULL);

#ifdef LTC_FAST
    if (16 % sizeof(LTC_FAST_TYPE)) {
        return CRYPT_INVALID_ARG;

    if ((err = aes_setup(key, keylen, 0, &pelmac->K)) != CRYPT_OK) {
       return err;

    zeromem(pelmac->state, 16);
    aes_ecb_encrypt(pelmac->state, pelmac->state, &pelmac->K);
    pelmac->buflen = 0;

    return CRYPT_OK;    

Here is the call graph for this function:

Here is the caller graph for this function:

Generated by  Doxygen 1.6.0   Back to index