icepole128v2/ref/icepole.c
void processDataBlock(
    ICESTATE S, 
    const unsigned char * source, 
    unsigned char ** dest,
    unsigned long long blocklen, 
    unsigned int frameBit
)
{
	uint64_t q;
	uint64_t snew;
	uint64_t padding;
	unsigned int qlen; 
	unsigned int i = 0;
	assert(blocklen <= ICEPOLEDATABLOCKLEN);
	    
    /* absorb the data block (and produce the ciphertext) */
	do {
        qlen = (blocklen < 8 ? (unsigned int) blocklen : 8); 
        q = load64(source, qlen);
        snew = S[i%4][i/4] ^ q;
        if (dest) {
            store64(*dest, snew, qlen);
            *dest += qlen;
        }        
        padding = qlen < 8 ? ((uint64_t)frameBit | 0x02ULL) << (8*qlen) : 0;
        S[i%4][i/4] ^= q ^ padding;
        ++i;
        source += qlen;
        blocklen -= qlen;
	} while (qlen == 8);
}
/* Reads 'blocklen' bytes of plaintext data (message or authenticated data)
   from 'source' and absorbs it into the ICEPOLE state S. 
   If dest is not NULL, then it also produces corresponding ciphertext
   block and writes it at 'dest' moving the pointer forward by 'blocklen'. 
   'frameBit' becomes part of the block padding.  */
Reads 'blocklen' bytes of plaintext data (message or authenticated data)
from 'source' and absorbs it into the ICEPOLE state S.
If dest is not NULL, then it also produces corresponding ciphertext
block and writes it at 'dest' moving the pointer forward by 'blocklen'.
'frameBit' becomes part of the block padding.
Reads ' blocklen ' bytes of plaintext data ( message or authenticated data ) from ' source ' and absorbs it into the ICEPOLE state S . If dest is not NULL then it also produces corresponding ciphertext block and writes it at ' dest ' moving the pointer forward by ' blocklen ' . ' frameBit ' becomes part of the block padding .
void processDataBlock(
    ICESTATE S, 
    const unsigned char * source, 
    unsigned char ** dest,
    unsigned long long blocklen, 
    unsigned int frameBit
)
{
	uint64_t q;
	uint64_t snew;
	uint64_t padding;
	unsigned int qlen; 
	unsigned int i = 0;
	assert(blocklen <= ICEPOLEDATABLOCKLEN);
	do {
        qlen = (blocklen < 8 ? (unsigned int) blocklen : 8); 
        q = load64(source, qlen);
        snew = S[i%4][i/4] ^ q;
        if (dest) {
            store64(*dest, snew, qlen);
            *dest += qlen;
        }        
        padding = qlen < 8 ? ((uint64_t)frameBit | 0x02ULL) << (8*qlen) : 0;
        S[i%4][i/4] ^= q ^ padding;
        ++i;
        source += qlen;
        blocklen -= qlen;
	} while (qlen == 8);
}
void processDataBlock ( ICESTATE S , const unsigned char * source , unsigned char * * dest , unsigned long long blocklen , unsigned int frameBit ) { uint64_t q ; uint64_t snew ; uint64_t padding ; unsigned int qlen ; unsigned int i = 0 ; assert ( blocklen <= ICEPOLEDATABLOCKLEN ) ; do { qlen = ( blocklen < 8 ? ( unsigned int ) blocklen : 8 ) ; q = load64 ( source , qlen ) ; snew = S [ i % 4 ] [ i / 4 ] ^ q ; if ( dest ) { store64 ( * dest , snew , qlen ) ; * dest += qlen ; } padding = qlen < 8 ? ( ( uint64_t ) frameBit | 0x02ULL ) << ( 8 * qlen ) : 0 ; S [ i % 4 ] [ i / 4 ] ^= q ^ padding ; ++ i ; source += qlen ; blocklen -= qlen ; } while ( qlen == 8 ) ; }
Reads 'blocklen' bytes of plaintext data (message or authenticated data)
from 'source' and absorbs it into the ICEPOLE state S.
If dest is not NULL, then it also produces corresponding ciphertext
block and writes it at 'dest' moving the pointer forward by 'blocklen'.
Reads ' blocklen ' bytes of plaintext data ( message or authenticated data ) from ' source ' and absorbs it into the ICEPOLE state S . If dest is not NULL then it also produces corresponding ciphertext block and writes it at ' dest ' moving the pointer forward by ' blocklen ' .
/* absorb the data block (and produce the ciphertext) */