• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ F2函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中F2函数的典型用法代码示例。如果您正苦于以下问题:C++ F2函数的具体用法?C++ F2怎么用?C++ F2使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了F2函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: W

/* forward octave */
static inline void W(u32 *key, unsigned int i) {
	u32 I;
	key[6] ^= F1(key[7], Tr[i % 4][0], Tm[i][0]);
	key[5] ^= F2(key[6], Tr[i % 4][1], Tm[i][1]);
	key[4] ^= F3(key[5], Tr[i % 4][2], Tm[i][2]);
	key[3] ^= F1(key[4], Tr[i % 4][3], Tm[i][3]);
	key[2] ^= F2(key[3], Tr[i % 4][4], Tm[i][4]);
	key[1] ^= F3(key[2], Tr[i % 4][5], Tm[i][5]);
	key[0] ^= F1(key[1], Tr[i % 4][6], Tm[i][6]);	
	key[7] ^= F2(key[0], Tr[i % 4][7], Tm[i][7]);
}
开发者ID:3sOx,项目名称:asuswrt-merlin,代码行数:12,代码来源:cast6.c


示例2: cast5_encrypt

static void cast5_encrypt(struct crypto_tfm *tfm, u8 *outbuf, const u8 *inbuf)
{
	struct cast5_ctx *c = crypto_tfm_ctx(tfm);
	const __be32 *src = (const __be32 *)inbuf;
	__be32 *dst = (__be32 *)outbuf;
	u32 l, r, t;
	u32 I;			/* used by the Fx macros */
	u32 *Km;
	u8 *Kr;

	Km = c->Km;
	Kr = c->Kr;

	/* (L0,R0) <-- (m1...m64).  (Split the plaintext into left and
	 * right 32-bit halves L0 = m1...m32 and R0 = m33...m64.)
	 */
	l = be32_to_cpu(src[0]);
	r = be32_to_cpu(src[1]);

	/* (16 rounds) for i from 1 to 16, compute Li and Ri as follows:
	 *  Li = Ri-1;
	 *  Ri = Li-1 ^ f(Ri-1,Kmi,Kri), where f is defined in Section 2.2
	 * Rounds 1, 4, 7, 10, 13, and 16 use f function Type 1.
	 * Rounds 2, 5, 8, 11, and 14 use f function Type 2.
	 * Rounds 3, 6, 9, 12, and 15 use f function Type 3.
	 */

	t = l; l = r; r = t ^ F1(r, Km[0], Kr[0]);
	t = l; l = r; r = t ^ F2(r, Km[1], Kr[1]);
	t = l; l = r; r = t ^ F3(r, Km[2], Kr[2]);
	t = l; l = r; r = t ^ F1(r, Km[3], Kr[3]);
	t = l; l = r; r = t ^ F2(r, Km[4], Kr[4]);
	t = l; l = r; r = t ^ F3(r, Km[5], Kr[5]);
	t = l; l = r; r = t ^ F1(r, Km[6], Kr[6]);
	t = l; l = r; r = t ^ F2(r, Km[7], Kr[7]);
	t = l; l = r; r = t ^ F3(r, Km[8], Kr[8]);
	t = l; l = r; r = t ^ F1(r, Km[9], Kr[9]);
	t = l; l = r; r = t ^ F2(r, Km[10], Kr[10]);
	t = l; l = r; r = t ^ F3(r, Km[11], Kr[11]);
	if (!(c->rr)) {
		t = l; l = r; r = t ^ F1(r, Km[12], Kr[12]);
		t = l; l = r; r = t ^ F2(r, Km[13], Kr[13]);
		t = l; l = r; r = t ^ F3(r, Km[14], Kr[14]);
		t = l; l = r; r = t ^ F1(r, Km[15], Kr[15]);
	}

	/* c1...c64 <-- (R16,L16).  (Exchange final blocks L16, R16 and
	 *  concatenate to form the ciphertext.) */
	dst[0] = cpu_to_be32(r);
	dst[1] = cpu_to_be32(l);
}
开发者ID:08opt,项目名称:linux,代码行数:51,代码来源:cast5.c


示例3: digitalWrite

void ChannelSelector::setCubiePower(bool mode)
{
  if (mode == false) {
      digitalWrite(PIN_CUBIEPOWER, LOW);
      GLOBALS.cubie_power_enabled = false;
      MDISPLAY.showMessage(F2("Power Off"));
  }
  else {
      digitalWrite(PIN_CUBIEPOWER, HIGH);
      GLOBALS.cubie_power_enabled = true;
      MDISPLAY.showMessage(F2("Power On"));
  }


}
开发者ID:yodor,项目名称:arduino,代码行数:15,代码来源:ChannelSelector.cpp


示例4: q_promote

void
q_promote(
    q_expr e)
{
    q_expr leftTerm, rightTerm;
    q_expr newTerm;

    assert(e != NULL);
    assert(e->kind == T_FNC);
    assert(e->info.function->tag == Q_EXPR_AND);

    leftTerm = q_leftPar(e);
    rightTerm = q_rightPar(e);
    q_disjunctify(leftTerm);
    q_disjunctify(rightTerm);
    if (q_isFnc(leftTerm,Q_EXPR_OR)) {
        /* e = (A or B) and C ====> e = A and C or B and C */
        newTerm = F2(Q_EXPR_AND,q_rightPar(leftTerm),q_exprCopy(rightTerm));
        /* e = (A or B) and C; newTerm = B and C */
q_promote(newTerm);
        q_swapRight(leftTerm,q_swapRight(e,newTerm));
        /* e = (A or C) and (B and C); */
        q_setTag(leftTerm,Q_EXPR_AND);
        /* e = (A and C) and (B and C); */
q_promote(leftTerm);
        q_setTag(e,Q_EXPR_OR);
        /* e = (A and C) or (B and C); */
        if (q_isFnc(rightTerm,Q_EXPR_OR)) {
            /* e = (A and (C or D)) or (B and (C or D)); */
            q_promote(leftTerm);
            /* e = (A and C) or (A and D)) or (B and (C or D)); */
            q_promote(newTerm);
            /* e = ((A and C) or (A and D)) or ((B and C) or (A and D)); */
        }
    } else {
    	if (q_isFnc(rightTerm,Q_EXPR_OR)) {
            /* e = A and (B or C) ====> e = A and B or A and C */
            newTerm = F2(Q_EXPR_AND,q_exprCopy(leftTerm),q_leftPar(rightTerm));
            /* e = A and (B or C); newTerm = A and B */
            q_swapLeft(rightTerm,q_swapLeft(e,newTerm));
            /* e = (A and B) and (A or C); */
            q_setTag(rightTerm,Q_EXPR_AND);
            /* e = (A and B) and (A and C); */
            q_setTag(e,Q_EXPR_OR);
            /* e = (A and B) or (A and C); */
    	}
    }
}
开发者ID:xrl,项目名称:opensplice_dds,代码行数:48,代码来源:q_expr.c


示例5: rubikStep

void rubikStep(char *step)
{
	u8 m=0;
	for(m=0;step[m]!=0;m++)
	{
		switch(step[m])
		{
			case 7:allright90();break;
			case 11:F1();break;
			case 12:F2();break;
			case 13:F3();break;
			case 21:B1();break;
			case 22:B2();break;
			case 23:B3();break;
			case 31:R1();break;
			case 32:R2();break;
			case 33:R3();break;
			case 41:L1();break;
			case 42:L2();break;
			case 43:L3();break;
			case 51:U1();break;
			case 52:U2();break;
			case 53:U3();break;
			case 61:D1();break;
			case 62:D2();break;
			case 63:D3();break;
			default:break;
		}
	}
}
开发者ID:MrChang0,项目名称:rubik,代码行数:30,代码来源:mofang.c


示例6: QBAR

/*reverse quad round*/
static inline void QBAR (u32 * block, u8 * Kr, u32 * Km) {
	u32 I;
        block[3] ^= F1(block[0], Kr[3], Km[3]);
        block[0] ^= F3(block[1], Kr[2], Km[2]);
        block[1] ^= F2(block[2], Kr[1], Km[1]);
        block[2] ^= F1(block[3], Kr[0], Km[0]);
}
开发者ID:3sOx,项目名称:asuswrt-merlin,代码行数:8,代码来源:cast6.c


示例7: TEST

TEST(RecorderTest, ArgRecorderTest) {
	TRACER_TRACE(&F2) f2;
	auto f2a = tracer::RecordArgs(f2);
	int a = 5;
	F2(a);
	for (int i = a; i >= 0; i--) 
		EXPECT_EQ(5 - i, f2a.Arg<0>(i));
}
开发者ID:QingYun,项目名称:tracer,代码行数:8,代码来源:recorder_test.cpp


示例8: cast5_decrypt

static void cast5_decrypt(void *ctx, u8 * outbuf, const u8 * inbuf)
{
	struct cast5_ctx *c = (struct cast5_ctx *) ctx;
	const __be32 *src = (const __be32 *)inbuf;
	__be32 *dst = (__be32 *)outbuf;
	u32 l, r, t;
	u32 I;
	u32 *Km;
	u8 *Kr;

	Km = c->Km;
	Kr = c->Kr;

	l = be32_to_cpu(src[0]);
	r = be32_to_cpu(src[1]);

	if (!(c->rr)) {
		t = l; l = r; r = t ^ F1(r, Km[15], Kr[15]);
		t = l; l = r; r = t ^ F3(r, Km[14], Kr[14]);
		t = l; l = r; r = t ^ F2(r, Km[13], Kr[13]);
		t = l; l = r; r = t ^ F1(r, Km[12], Kr[12]);
		t = l; l = r; r = t ^ F3(r, Km[11], Kr[11]);
		t = l; l = r; r = t ^ F2(r, Km[10], Kr[10]);
		t = l; l = r; r = t ^ F1(r, Km[9], Kr[9]);
		t = l; l = r; r = t ^ F3(r, Km[8], Kr[8]);
		t = l; l = r; r = t ^ F2(r, Km[7], Kr[7]);
		t = l; l = r; r = t ^ F1(r, Km[6], Kr[6]);
		t = l; l = r; r = t ^ F3(r, Km[5], Kr[5]);
		t = l; l = r; r = t ^ F2(r, Km[4], Kr[4]);
		t = l; l = r; r = t ^ F1(r, Km[3], Kr[3]);
		t = l; l = r; r = t ^ F3(r, Km[2], Kr[2]);
		t = l; l = r; r = t ^ F2(r, Km[1], Kr[1]);
		t = l; l = r; r = t ^ F1(r, Km[0], Kr[0]);
	} else {
		t = l; l = r; r = t ^ F3(r, Km[11], Kr[11]);
		t = l; l = r; r = t ^ F2(r, Km[10], Kr[10]);
		t = l; l = r; r = t ^ F1(r, Km[9], Kr[9]);
		t = l; l = r; r = t ^ F3(r, Km[8], Kr[8]);
		t = l; l = r; r = t ^ F2(r, Km[7], Kr[7]);
		t = l; l = r; r = t ^ F1(r, Km[6], Kr[6]);
		t = l; l = r; r = t ^ F3(r, Km[5], Kr[5]);
		t = l; l = r; r = t ^ F2(r, Km[4], Kr[4]);
		t = l; l = r; r = t ^ F1(r, Km[3], Kr[3]);
		t = l; l = r; r = t ^ F3(r, Km[2], Kr[2]);
		t = l; l = r; r = t ^ F2(r, Km[1], Kr[1]);
		t = l; l = r; r = t ^ F1(r, Km[0], Kr[0]);
	}

	dst[0] = cpu_to_be32(r);
	dst[1] = cpu_to_be32(l);
}
开发者ID:devicenull,项目名称:supermicro_ipmi_firmware,代码行数:51,代码来源:cast5.c


示例9: return

const char* ChannelSelector::getChannelName()
{
  if (current_channel>CHANNEL_NONE && current_channel<CHANNEL_LAST) {
    return (const char*)channel_names[(int)current_channel];
  }
  else {
    return (const char*)F2("N/A");
  }
}
开发者ID:yodor,项目名称:arduino,代码行数:9,代码来源:ChannelSelector.cpp


示例10: main

int main()
{
	auto a1 = F1();
	auto a2 = F2();
	auto a3 = F3();
	auto a4 = F4();
	auto a5 = F5();

    return 0;
}
开发者ID:potimarimo,项目名称:material-of-a-study-meeting,代码行数:10,代码来源:テンプレートメタプログラミング.cpp


示例11: cast_decrypt

void
cast_decrypt(cast_key* key, u_int8_t* inblock, u_int8_t* outblock)
{
	u_int32_t t, l, r;

	/* Get inblock into l,r */
	r = ((u_int32_t)inblock[0] << 24) | ((u_int32_t)inblock[1] << 16) |
	    ((u_int32_t)inblock[2] << 8) | (u_int32_t)inblock[3];
	l = ((u_int32_t)inblock[4] << 24) | ((u_int32_t)inblock[5] << 16) |
	    ((u_int32_t)inblock[6] << 8) | (u_int32_t)inblock[7];
	/* Do the work */
	/* Only do full 16 rounds if key length > 80 bits */
	if (key->rounds > 12) {
		F1(r, l, 15);
		F3(l, r, 14);
		F2(r, l, 13);
		F1(l, r, 12);
	}
	F3(r, l, 11);
	F2(l, r, 10);
	F1(r, l,  9);
	F3(l, r,  8);
	F2(r, l,  7);
	F1(l, r,  6);
	F3(r, l,  5);
	F2(l, r,  4);
	F1(r, l,  3);
	F3(l, r,  2);
	F2(r, l,  1);
	F1(l, r,  0);
	/* Put l,r into outblock */
	outblock[0] = U8a(l);
	outblock[1] = U8b(l);
	outblock[2] = U8c(l);
	outblock[3] = U8d(l);
	outblock[4] = U8a(r);
	outblock[5] = U8b(r);
	outblock[6] = U8c(r);
	outblock[7] = U8d(r);
	/* Wipe clean */
	t = l = r = 0;
}
开发者ID:mikekmv,项目名称:aeriebsd-src,代码行数:42,代码来源:cast.c


示例12: q_deNot

static q_expr
q_deNot(
    q_expr e)
{
    q_expr r;

    if (e == NULL) {
        return NULL;
    }
    if (e->kind == T_FNC) {
        switch (e->info.function->tag) {
        case Q_EXPR_LIKE:                                    r = e; break;
        case Q_EXPR_EQ:   e->info.function->tag = Q_EXPR_NE; r = e; break;
        case Q_EXPR_NE:   e->info.function->tag = Q_EXPR_EQ; r = e; break;
        case Q_EXPR_LT:   e->info.function->tag = Q_EXPR_GE; r = e; break;
        case Q_EXPR_LE:   e->info.function->tag = Q_EXPR_GT; r = e; break;
        case Q_EXPR_GT:   e->info.function->tag = Q_EXPR_LE; r = e; break;
        case Q_EXPR_GE:   e->info.function->tag = Q_EXPR_LT; r = e; break;
        case Q_EXPR_NOT:
            r = q_takePar(e,0);
            q_dispose(e);
        break;
        case Q_EXPR_AND:
            r = F2(Q_EXPR_OR,q_removeNots(q_takePar(e,0)),q_removeNots(q_takePar(e,1)));
            q_dispose(e);
        break;
        case Q_EXPR_OR:
            r = F2(Q_EXPR_AND,q_removeNots(q_takePar(e,0)),q_removeNots(q_takePar(e,1)));
            q_dispose(e);
        break;
        default:
            assert(FALSE);
            r = e;
        break;
        }
    } else {
        r = e;
    }
    return r;
}
开发者ID:xrl,项目名称:opensplice_dds,代码行数:40,代码来源:q_expr.c


示例13: CAST5decrypt

void 
CAST5decrypt(const PGPUInt8 *in, PGPUInt8 *out, const PGPUInt32 *xkey)
{
	PGPUInt32 l, r, t;

	r = (PGPUInt32) in[0]<<24 | (PGPUInt32) in[1]<<16 | 
		(PGPUInt32) in[2]<<8 | in[3];

	l = (PGPUInt32) in[4]<<24 | (PGPUInt32) in[5]<<16 | 
		(PGPUInt32) in[6]<<8 | in[7];

	t = F1(l, xkey, 15); r ^= G1(t);
	t = F3(r, xkey, 14); l ^= G3(t);
	t = F2(l, xkey, 13); r ^= G2(t);
	t = F1(r, xkey, 12); l ^= G1(t);
	// Start here if only doing 12 rounds
	t = F3(l, xkey, 11); r ^= G3(t);
	t = F2(r, xkey, 10); l ^= G2(t);
	t = F1(l, xkey,  9); r ^= G1(t);
	t = F3(r, xkey,  8); l ^= G3(t);
	t = F2(l, xkey,  7); r ^= G2(t);
	t = F1(r, xkey,  6); l ^= G1(t);
	t = F3(l, xkey,  5); r ^= G3(t);
	t = F2(r, xkey,  4); l ^= G2(t);
	t = F1(l, xkey,  3); r ^= G1(t);
	t = F3(r, xkey,  2); l ^= G3(t);
	t = F2(l, xkey,  1); r ^= G2(t);
	t = F1(r, xkey,  0); l ^= G1(t);

	out[0]	= (PGPUInt8) B0(l);
	out[1]	= (PGPUInt8) B1(l);
	out[2]	= (PGPUInt8) B2(l);
	out[3]	= (PGPUInt8) B3(l);
	out[4]	= (PGPUInt8) B0(r);
	out[5]	= (PGPUInt8) B1(r);
	out[6]	= (PGPUInt8) B2(r);
	out[7]	= (PGPUInt8) B3(r);
}
开发者ID:ysangkok,项目名称:pgp-win32-6.5.8,代码行数:38,代码来源:Cast5.cpp


示例14: bf_e_block

static void bf_e_block(uint32_t *p_xl, uint32_t *p_xr)
{
  uint32_t temp;
  uint32_t xl = *p_xl;
  uint32_t xr = *p_xr;

  F1(0) F2(1) F1(2) F2(3) F1(4) F2(5) F1(6) F2(7)
  F1(8) F2(9) F1(10) F2(11) F1(12) F2(13) F1(14) F2(15)
  xl ^= pax[16];
  xr ^= pax[17];
  temp = xl;
  xl = xr;
  xr = temp;
  *p_xl = xl;
  *p_xr = xr;
}
开发者ID:MarcWeber,项目名称:neovim,代码行数:16,代码来源:blowfish.c


示例15: Vector_Drive

void
Vector_Drive(vector V, double omega)
{
	vector F1(-1.000,0.000), F2(0.500,-0.866), F3(0.866,0.500);
	double omega1, omega2, omega3, b=0.090, r=0.020, h=0;
	omega1 = ( F1*V + b*omega ) / r;	// F1*V is overloaded dot product
	omega2 = ( F2*V + b*omega ) / r;
	omega3 = ( F3*V + b*omega ) / r;
	// makes sure that given path is physically possible
	if ( (omega1>6) || (omega2>6) || (omega3>6) || (omega1<-6) || (omega2<-6) || (omega3<-6) )
		DisplayTxt("Vectors: ERROR!");
	else 
		Drive(Vel_To_Value(omega1),Vel_To_Value(omega2),Vel_To_Value(omega3));
}
开发者ID:BackupTheBerlios,项目名称:wl530g-svn,代码行数:14,代码来源:palmbot.cpp


示例16: CAST5encrypt

/*
 * Encrypt the 8 bytes at *in into the 8 bytes at *out using the expanded
 * key schedule from *xkey.
 */
static void
CAST5encrypt(PGPByte const *in, PGPByte *out, PGPUInt32 const *xkey)
{
	PGPUInt32 l, r, t;

	l = (PGPUInt32)
		in[0]<<24 | (PGPUInt32)in[1]<<16 | (PGPUInt32)in[2]<<8 | in[3];
	r = (PGPUInt32)
		in[4]<<24 | (PGPUInt32)in[5]<<16 | (PGPUInt32)in[6]<<8 | in[7];

	t = F1(r, xkey,  0); l ^= G1(t);
	t = F2(l, xkey,  1); r ^= G2(t);
	t = F3(r, xkey,  2); l ^= G3(t);
	t = F1(l, xkey,  3); r ^= G1(t);
	t = F2(r, xkey,  4); l ^= G2(t);
	t = F3(l, xkey,  5); r ^= G3(t);
	t = F1(r, xkey,  6); l ^= G1(t);
	t = F2(l, xkey,  7); r ^= G2(t);
	t = F3(r, xkey,  8); l ^= G3(t);
	t = F1(l, xkey,  9); r ^= G1(t);
	t = F2(r, xkey, 10); l ^= G2(t);
	t = F3(l, xkey, 11); r ^= G3(t);
	/* Stop here if only doing 12 rounds */
	t = F1(r, xkey, 12); l ^= G1(t);
	t = F2(l, xkey, 13); r ^= G2(t);
	t = F3(r, xkey, 14); l ^= G3(t);
	t = F1(l, xkey, 15); r ^= G1(t);

	out[0] = B0(r);
	out[1] = B1(r);
	out[2] = B2(r);
	out[3] = B3(r);
	out[4] = B0(l);
	out[5] = B1(l);
	out[6] = B2(l);
	out[7] = B3(l);
}
开发者ID:ysangkok,项目名称:pgp-win32-6.5.8,代码行数:41,代码来源:pgpCAST5.c


示例17: QWidget

seconlevel_f4::seconlevel_f4(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::seconlevel_f4)
{
    ui->setupUi(this);

    group = new GroupDialog(parent);
    group->hide();
    connect(group ,SIGNAL(finished(int)) ,this ,SLOT(f1_Done(int)));

    autotab = new AutoDialog(parent);
    autotab->hide();
    connect(autotab ,SIGNAL(finished(int)) ,this ,SLOT(f2_Done(int)));

    jump = new JumpDialog(parent);
    jump->hide();
    connect(jump ,SIGNAL(finished(int)) ,this ,SLOT(f6_Done(int)));

    connect(ui->pushButton_F1,SIGNAL(clicked()),this ,SLOT(F1()));
    ui->pushButton_F1->setCheckable(true);

    connect(ui->pushButton_F2,SIGNAL(clicked()),this ,SLOT(F2()));
    ui->pushButton_F2->setCheckable(true);

    connect(ui->pushButton_F3,SIGNAL(clicked()),this ,SLOT(F3()));
    ui->pushButton_F3->setCheckable(true);

    connect(ui->pushButton_F4,SIGNAL(clicked()),this ,SLOT(F4()));
    ui->pushButton_F4->setCheckable(true);

    connect(ui->pushButton_F5,SIGNAL(clicked()),this ,SLOT(F5()));
    ui->pushButton_F5->setCheckable(true);

    connect(ui->pushButton_F6,SIGNAL(clicked()),this ,SLOT(F6()));
    ui->pushButton_F6->setCheckable(true);

    connect(ui->pushButton_F7,SIGNAL(clicked()),this ,SLOT(F7()));
    ui->pushButton_F7->setCheckable(true);

    connect(this ,SIGNAL(enter(int)),parent ,SLOT(funcbarUpdate(int)));
    connect(ui->pushButton_F8,SIGNAL(clicked()),this ,SLOT(F8()));

    /*数据表模式改变信号*/
    connect(this ,SIGNAL(stateChange(char)) ,parent ,SLOT(tableStateUpdate(char)));
    /*段选信号*/
    connect(this ,SIGNAL(selectRows(bool)) ,parent ,SLOT(tableSelect(bool)));

    setFocusPolicy(Qt::NoFocus);
}
开发者ID:taiyuankejizhu,项目名称:SparkZNC,代码行数:49,代码来源:seconlevel_f4.cpp


示例18: main

int main() {

  typedef OKlib::Literals::Literals_int literal_type;
  typedef std::vector<literal_type> clause_type;
  typedef std::vector<clause_type> clause_set1_type;
  typedef OKlib::InputOutput::RawDimacsCLSAdaptor<literal_type, clause_set1_type> InputClsadaptor;
  InputClsadaptor F1;
  OKlib::InputOutput::StandardDIMACSInput<InputClsadaptor>(std::cin, F1);
  const InputClsadaptor::int_type n = F1.stat.parameter_n;

  typedef std::list<clause_type> clause_set2_type;
  clause_set2_type F2(F1.clause_set.begin(), F1.clause_set.end());
  F1.clause_set.clear();
  if (F2.size() >= 2) {
    clause_set2_type F_removed;
    typedef clause_set2_type::iterator clause_iterator;
    const clause_iterator F2end = F2.end();
    for (struct {clause_iterator Ci, next;} l = {F2.begin(), boost::next(F2.begin())}; l.Ci != F2end; l.Ci = l.next) {
      l.next = boost::next(l.Ci);
      F_removed.splice(F_removed.begin(), F2, l.Ci);
      typedef OKlib::Satisfiability::Reductions::UnitClausePropagation::CLSAdaptorUcpW<
          OKlib::Satisfiability::ProblemInstances::Clauses::WatchedLiterals_mono<literal_type>,
          OKlib::Satisfiability::Assignments::TotalAssignments::BAssignmentWithQueue<literal_type> >
        Ucp;
      Ucp U;
      OKlib::InputOutput::ListTransfer<Ucp>(F2, U, n);
      const Ucp::assignment_type f(U.assignment());
      if (U.contradicting_uclause()) continue;
      bool removable = true;
      const clause_iterator Frend = F_removed.end();
      for (clause_iterator Di = F_removed.begin(); Di != Frend; ++Di, U.contradicting_uclause() = false) {
        U.set_assignments(f);
        const clause_type& D = *Di;
        typedef clause_type::const_iterator literal_iterator;
        for (literal_iterator xi = D.begin(); xi != D.end(); ++xi)
          U.push_unit_clause(-*xi);
        if (not U.perform_ucp()) { removable = false; break; }
      }
      if (not removable) F2.splice(l.next, F_removed, F_removed.begin());
    }
  }

  {
   typedef OKlib::InputOutput::CLSAdaptorDIMACSOutput<literal_type> OutputClsadaptor;
   OutputClsadaptor out(std::cout);
   OKlib::InputOutput::ListTransfer<OutputClsadaptor>(F2, out, "");
  }

}
开发者ID:exp04shy,项目名称:oklibrary,代码行数:49,代码来源:RUcpBase.cpp


示例19: g

int g(unsigned char *in,int i,dword *h)
{
	dword h0,h1,h2,h3,h4,a,b,c,d,e,temp;
	unsigned char *kp;
	dword w[80];

	kp = in;
	h0 = WORD(kp); kp += 4;
	h1 = WORD(kp); kp += 4;
	h2 = WORD(kp); kp += 4;
	h3 = WORD(kp); kp += 4;
	h4 = WORD(kp); kp += 4;

	w[0] = i;
	for (i=1;i<16;i++) w[i] = 0;

	for (i=16;i<80;i++) w[i] = w[i-3]^w[i-8]^w[i-14]^w[i-16];

	a = h0; b = h1; c = h2; d = h3; e = h4;

	for(i=0;i<20;i++)
	{
		temp = ROT27(a) + F1(b, c, d) + e + w[i] + 0x5a827998;
		e = d; d = c; c = ROT2(b); b = a; a = temp;
	}

	for (i=20;i<40;i++)
	{
		temp = ROT27(a) + F2(b, c, d) + e + w[i] + 0x6ef9eba1;
		e = d; d = c; c = ROT2(b); b = a; a = temp;
	}
	for (i=40;i<60;i++)
	{
		temp = ROT27(a) + F3(b, c, d) + e + w[i] + 0x7f1cbcdc;
		e = d; d = c; c = ROT2(b); b = a; a = temp;
	}
	for (i=60;i<80;i++)
	{
		temp = ROT27(a) + F4(b, c, d) + e + w[i] + 0xaa62d1d6;
		e = d; d = c; c = ROT2(b); b = a; a = temp;
	}

	h[0] = h0+a; h[1] = h1+b; h[2] = h2+c; h[3] = h3+d; h[4] = h4+e;

	return (ALG_OK);
}
开发者ID:Beanux,项目名称:openkore_fork,代码行数:46,代码来源:seal.c


示例20: sha256_transform

void sha256_transform (uint32 *buf, uint32 const *in)
{
  uint32 w[64] ;
  unsigned int i = 0 ;
  register uint32 a = buf[0], b = buf[1], c = buf[2], d = buf[3], e = buf[4], f = buf[5], g = buf[6], h = buf[7] ;

  for (; i < 16 ; i++) w[i] = in[i] ;
  for (; i < 64 ; i++)
    w[i] = SMALLSIGMA1(w[i-2]) + w[i-7] + SMALLSIGMA0(w[i-15]) + w[i-16] ;
  for (i = 0 ; i < 64 ; i++)
  {
    uint32 temp1 = h + CAPITALSIGMA1(e) + F1(e, f, g) + sha256_constants[i] + w[i] ;
    uint32 temp2 = CAPITALSIGMA0(a) + F2(a, b, c) ;
    h = g ; g = f ; f = e ; e = d + temp1 ;
    d = c ; c = b ; b = a ; a = temp1 + temp2 ;
  }
  buf[0] += a ; buf[1] += b ; buf[2] += c ; buf[3] += d ;
  buf[4] += e ; buf[5] += f ; buf[6] += g ; buf[7] += h ;
}
开发者ID:Jubei-Mitsuyoshi,项目名称:aaa-skalibs,代码行数:19,代码来源:sha256_transform.c



注:本文中的F2函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ F2FS_I函数代码示例发布时间:2022-05-30
下一篇:
C++ F函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap