int builtin_echo(t_list *list, char **cmd) { t_echo *echo; char *printable; int i; (void)list; if ((echo = init_echo()) == NULL) return (FAILURE); i = 0; while (cmd[++i]) { if (echo->check_flags == 1 && strlen(cmd[i]) >= 1 && cmd[i][0] == '-') check_options(echo, cmd[i]) ? (echo->i = i) : (echo->i = i); else { echo->check_flags = 0; if ((printable = preparsing_echo(echo, cmd)) != NULL) { echo_print(echo, printable); xfree(printable); } break; } } echo->flag_n == 0 ? write(1, "\n", 1) : 0; return (SUCCESS); }
HashReturn hash_echo(int hashbitlen, const BitSequence *data, DataLength databitlen, BitSequence *hashval) { HashReturn hRet; hashState_echo hs; ///// /* __m128i a, b, c, d, t[4], u[4], v[4]; a = _mm_set_epi32(0x0f0e0d0c, 0x0b0a0908, 0x07060504, 0x03020100); b = _mm_set_epi32(0x1f1e1d1c, 0x1b1a1918, 0x17161514, 0x13121110); c = _mm_set_epi32(0x2f2e2d2c, 0x2b2a2928, 0x27262524, 0x23222120); d = _mm_set_epi32(0x3f3e3d3c, 0x3b3a3938, 0x37363534, 0x33323130); t[0] = _mm_unpacklo_epi8(a, b); t[1] = _mm_unpackhi_epi8(a, b); t[2] = _mm_unpacklo_epi8(c, d); t[3] = _mm_unpackhi_epi8(c, d); u[0] = _mm_unpacklo_epi16(t[0], t[2]); u[1] = _mm_unpackhi_epi16(t[0], t[2]); u[2] = _mm_unpacklo_epi16(t[1], t[3]); u[3] = _mm_unpackhi_epi16(t[1], t[3]); t[0] = _mm_unpacklo_epi16(u[0], u[1]); t[1] = _mm_unpackhi_epi16(u[0], u[1]); t[2] = _mm_unpacklo_epi16(u[2], u[3]); t[3] = _mm_unpackhi_epi16(u[2], u[3]); u[0] = _mm_unpacklo_epi8(t[0], t[1]); u[1] = _mm_unpackhi_epi8(t[0], t[1]); u[2] = _mm_unpacklo_epi8(t[2], t[3]); u[3] = _mm_unpackhi_epi8(t[2], t[3]); a = _mm_unpacklo_epi8(u[0], u[1]); b = _mm_unpackhi_epi8(u[0], u[1]); c = _mm_unpacklo_epi8(u[2], u[3]); d = _mm_unpackhi_epi8(u[2], u[3]); */ ///// hRet = init_echo(&hs, hashbitlen); if(hRet != SUCCESS) return hRet; hRet = update_echo(&hs, data, databitlen); if(hRet != SUCCESS) return hRet; hRet = final_echo(&hs, hashval); if(hRet != SUCCESS) return hRet; return SUCCESS; }
void ultra_sound_init(){ init_periph_clk(); init_echo(); init_trigger(); ultrasoundTimers=xTimerCreate("ultrasound",(30 ), pdTRUE, ( void * ) 1, UltrasoundPolling ); xTimerStart( ultrasoundTimers, 0 ); }
void init_x12_4way_ctx() { blake512_4way_init( &x12_4way_ctx.blake ); bmw512_4way_init( &x12_4way_ctx.bmw ); init_groestl( &x12_4way_ctx.groestl, 64 ); skein512_4way_init( &x12_4way_ctx.skein ); jh512_4way_init( &x12_4way_ctx.jh ); keccak512_4way_init( &x12_4way_ctx.keccak ); luffa_2way_init( &x12_4way_ctx.luffa, 512 ); cubehashInit( &x12_4way_ctx.cube, 512, 16, 32 ); sph_shavite512_init( &x12_4way_ctx.shavite ); simd_2way_init( &x12_4way_ctx.simd, 512 ); init_echo( &x12_4way_ctx.echo, 512 ); hamsi512_4way_init( &x12_4way_ctx.hamsi ); // sph_fugue512_init( &x12_4way_ctx.fugue ); };
void init_qubit_ctx() { #ifdef LUFFA_SSE2_BROKEN sph_luffa512_init(&qubit_ctx.luffa); #else init_luffa(&qubit_ctx.luffa,512); #endif cubehashInit(&qubit_ctx.cubehash,512,16,32); sph_shavite512_init(&qubit_ctx.shavite); init_sd(&qubit_ctx.simd,512); #ifdef NO_AES_NI sph_echo512_init(&qubit_ctx.echo); #else init_echo(&qubit_ctx.echo, 512); #endif };
void init_x14_ctx() { #ifdef NO_AES_NI sph_groestl512_init(&x14_ctx.groestl); sph_echo512_init(&x14_ctx.echo); #else init_echo(&x14_ctx.echo, 512); init_groestl(&x14_ctx.groestl); #endif init_luffa(&x14_ctx.luffa,512); cubehashInit(&x14_ctx.cubehash,512,16,32); sph_shavite512_init(&x14_ctx.shavite); init_sd(&x14_ctx.simd,512); sph_hamsi512_init(&x14_ctx.hamsi); sph_fugue512_init(&x14_ctx.fugue); sph_shabal512_init(&x14_ctx.shabal); };
void init_Xhash_contexts(){ //---luffa--- init_luffa(&base_contexts.luffa,512); //--ch sse2--- cubehashInit(&base_contexts.cubehash,512,16,32); //------- sph_shavite512_init(&base_contexts.shavite1); //---echo sphlib or AESNI----------- #ifdef AES_NI init_echo(&base_contexts.echo1, 512); #else sph_echo512_init(&base_contexts.echo1); #endif //---local simd var --- init_sd(&base_contexts.ctx_simd1,512); }