static void md4_compress(hash_state *md, unsigned char *buf) { _md4_compress(md, buf); burn_stack(sizeof(ulong32) * 20 + sizeof(int)); }
int rc6_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key *skey) { int err = _rc6_ecb_decrypt(ct, pt, skey); burn_stack(sizeof(ulong32) * 6 + sizeof(int)); return err; }
int ECB_DEC(const unsigned char *ct, unsigned char *pt, symmetric_key *skey) { int err = _rijndael_ecb_decrypt(ct, pt, skey); burn_stack(sizeof(unsigned long)*8 + sizeof(unsigned long*) + sizeof(int)*2); return err; }
void noekeon_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key *skey) { _noekeon_ecb_decrypt(ct, pt, skey); burn_stack(sizeof(ulong32) * 5 + sizeof(int)); }
int cast5_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key *skey) { int err = _cast5_ecb_decrypt(ct,pt,skey); burn_stack(sizeof(ulong32)*3); return err; }
int noekeon_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key *skey) { int err = _noekeon_ecb_encrypt(pt, ct, skey); burn_stack(sizeof(ulong32) * 5 + sizeof(int)); return CRYPT_OK; }
int blowfish_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key *skey) { int err = _blowfish_ecb_encrypt(pt, ct, skey); burn_stack(sizeof(ulong32) * 2 + sizeof(int)); return err; }
static void sha256_final(SHA256_CONTEXT *hd) { u32 t, msb, lsb; byte *p; sha256_write(hd, NULL, 0); /* flush */; t = hd->nblocks; /* multiply by 64 to make a byte count */ lsb = t << 6; msb = t >> 26; /* add the count */ t = lsb; if( (lsb += hd->count) < t ) msb++; /* multiply by 8 to make a bit count */ t = lsb; lsb <<= 3; msb <<= 3; msb |= t >> 29; if( hd->count < 56 ) { /* enough room */ hd->buf[hd->count++] = 0x80; /* pad */ while( hd->count < 56 ) hd->buf[hd->count++] = 0; /* pad */ } else { /* need one extra block */ hd->buf[hd->count++] = 0x80; /* pad character */ while( hd->count < 64 ) hd->buf[hd->count++] = 0; sha256_write(hd, NULL, 0); /* flush */; memset(hd->buf, 0, 56 ); /* fill next block with zeroes */ } /* append the 64 bit count */ hd->buf[56] = msb >> 24; hd->buf[57] = msb >> 16; hd->buf[58] = msb >> 8; hd->buf[59] = msb ; hd->buf[60] = lsb >> 24; hd->buf[61] = lsb >> 16; hd->buf[62] = lsb >> 8; hd->buf[63] = lsb ; transform( hd, hd->buf ); burn_stack (328); p = hd->buf; #ifdef BIG_ENDIAN_HOST #define X(a) do { *(u32*)p = hd->h##a ; p += 4; } while(0) #else /* little endian */ #define X(a) do { *p++ = hd->h##a >> 24; *p++ = hd->h##a >> 16; \ *p++ = hd->h##a >> 8; *p++ = hd->h##a; } while(0) #endif X(0); X(1); X(2); X(3); X(4); X(5); X(6); /* Note that this last chunk is included even for SHA224. We just ignore it. */ X(7); #undef X }
int noekeon_ecb_decrypt(const unsigned char *ct, unsigned char *pt, const symmetric_key *skey) { int err = _noekeon_ecb_decrypt(ct, pt, skey); burn_stack(sizeof(ulong32) * 5 + sizeof(int)); return err; }
void rc6_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key *key) { _rc6_ecb_decrypt(ct, pt, key); burn_stack(sizeof(unsigned long) * 6 + sizeof(int)); }
void rc5_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key *key) { _rc5_ecb_encrypt(pt, ct, key); burn_stack(sizeof(unsigned long) * 2 + sizeof(int)); }