Ejemplo n.º 1
0
void seal_encrypt(seal_ctx *c, dword *data_ptr, int w)
{
	int i;
	for(i=0;i<w;i++)
	{
		if(c->ks_pos>=WORDS_PER_SEAL_CALL) seal_refill_buffer(c);
		data_ptr[i]^=c->ks_buf[c->ks_pos];
		c->ks_pos++;
	}
}
Ejemplo n.º 2
0
/* This encrypts the next w words with SEAL2. */
void seal_encrypt(seal_ctx *c, unsigned char *plaintext, int w,
    unsigned char *ciphertext)
{
    int i;

    for (i = 0; i < w; i++) {
        if(c->ks_pos >= WORDS_PER_SEAL2_CALL) seal_refill_buffer(c);
        ciphertext[i] = plaintext[i] ^ c->ks_buf[c->ks_pos];
        c->ks_pos++;
    }
}