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

C++ PUTU32函数代码示例

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

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



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

示例1: AES_ctr128_inc

/* increment counter (128-bit int) by 1 */
static void AES_ctr128_inc(unsigned char *counter) {
	unsigned long c;

	/* Grab bottom dword of counter and increment */
	c = GETU32(counter + 12);
	c++;	c &= 0xFFFFFFFF;
	PUTU32(counter + 12, c);

	/* if no overflow, we're done */
	if (c)
		return;

	/* Grab 1st dword of counter and increment */
	c = GETU32(counter +  8);
	c++;	c &= 0xFFFFFFFF;
	PUTU32(counter +  8, c);

	/* if no overflow, we're done */
	if (c)
		return;

	/* Grab 2nd dword of counter and increment */
	c = GETU32(counter +  4);
	c++;	c &= 0xFFFFFFFF;
	PUTU32(counter +  4, c);

	/* if no overflow, we're done */
	if (c)
		return;

	/* Grab top dword of counter and increment */
	c = GETU32(counter +  0);
	c++;	c &= 0xFFFFFFFF;
	PUTU32(counter +  0, c);
}
开发者ID:1310701102,项目名称:sl4a,代码行数:36,代码来源:aes_ctr.c


示例2: garmin_pack_d1005

static void
garmin_pack_d1005 ( D1005 * limits, uint8 ** pos )
{
    PUTU32(limits->max_workouts);
    PUTU32(limits->max_unscheduled_workouts);
    PUTU32(limits->max_occurrences);
}
开发者ID:jorgesca,项目名称:garmintools,代码行数:7,代码来源:pack.c


示例3: garmin_pack_d1015

static void
garmin_pack_d1015 ( D1015 * lap, uint8 ** pos )
{
    PUTU16(lap->index);
    SKIP(2);
    PUTU32(lap->start_time);
    PUTU32(lap->total_time);
    PUTF32(lap->total_dist);
    PUTF32(lap->max_speed);
    PUTPOS(lap->begin);
    PUTPOS(lap->end);
    PUTU16(lap->calories);
    PUTU8(lap->avg_heart_rate);
    PUTU8(lap->max_heart_rate);
    PUTU8(lap->intensity);
    PUTU8(lap->avg_cadence);
    PUTU8(lap->trigger_method);

    /* Hopefully we'll know what this stuff actually is someday. */

    PUTU8(lap->unknown[0]);
    PUTU8(lap->unknown[1]);
    PUTU8(lap->unknown[2]);
    PUTU8(lap->unknown[3]);
    PUTU8(lap->unknown[4]);
}
开发者ID:jorgesca,项目名称:garmintools,代码行数:26,代码来源:pack.c


示例4: garmin_pack_d110

static void
garmin_pack_d110 ( D110 * wpt, uint8 ** pos )
{
    PUTU8(wpt->dtyp);
    PUTU8(wpt->wpt_class);
    PUTU8(wpt->dspl_color);
    PUTU8(wpt->attr);
    PUTU16(wpt->smbl);
    PUTSTR(wpt->subclass);
    PUTPOS(wpt->posn);
    PUTF32(wpt->alt);
    PUTF32(wpt->dpth);
    PUTF32(wpt->dist);
    PUTSTR(wpt->state);
    PUTSTR(wpt->cc);
    PUTU32(wpt->ete);
    PUTF32(wpt->temp);
    PUTU32(wpt->time);
    PUTU16(wpt->wpt_cat);
    PUTVST(wpt->ident);
    PUTVST(wpt->comment);
    PUTVST(wpt->facility);
    PUTVST(wpt->city);
    PUTVST(wpt->addr);
    PUTVST(wpt->cross_road);
}
开发者ID:jorgesca,项目名称:garmintools,代码行数:26,代码来源:pack.c


示例5: AES_ctr128_inc

/* increment counter (128-bit int) by 2^64 */
void AES_ctr128_inc(unsigned char *counter) {
	unsigned long c;

	/* Grab 3rd dword of counter and increment */
#ifdef L_ENDIAN
	c = GETU32(counter + 8);
	c++;
	PUTU32(counter + 8, c);
#else
	c = GETU32(counter + 4);
	c++;
	PUTU32(counter + 4, c);
#endif

	/* if no overflow, we're done */
	if (c)
		return;

	/* Grab top dword of counter and increment */
#ifdef L_ENDIAN
	c = GETU32(counter + 12);
	c++;
	PUTU32(counter + 12, c);
#else
	c = GETU32(counter +  0);
	c++;
	PUTU32(counter +  0, c);
#endif

}
开发者ID:ohayak,项目名称:tars_code,代码行数:31,代码来源:aes_ctr.c


示例6: Camellia_DecryptBlock

void
Camellia_DecryptBlock(const int keyBitLength, 
		      const unsigned char *ciphertext, 
		      const uint32_t *subkey,
		      unsigned char *plaintext)
{
    uint32_t tmp[4];
 
    tmp[0] = GETU32(ciphertext);
    tmp[1] = GETU32(ciphertext + 4);
    tmp[2] = GETU32(ciphertext + 8);
    tmp[3] = GETU32(ciphertext + 12);

    switch (keyBitLength) {
    case 128:
	camellia_decrypt128(subkey, tmp);
	break;
    case 192:
	/* fall through */
    case 256:
	camellia_decrypt256(subkey, tmp);
	break;
    default:
	break;
    }

    PUTU32(plaintext,    tmp[0]);
    PUTU32(plaintext+4,  tmp[1]);
    PUTU32(plaintext+8,  tmp[2]);
    PUTU32(plaintext+12, tmp[3]);
}
开发者ID:edgar-pek,项目名称:PerspicuOS,代码行数:31,代码来源:camellia.c


示例7: garmin_pack_d1013

static void
garmin_pack_d1013 ( D1013 * limits, uint8 ** pos )
{
    PUTU32(limits->max_courses);
    PUTU32(limits->max_course_laps);
    PUTU32(limits->max_course_pnt);
    PUTU32(limits->max_course_trk_pnt);
}
开发者ID:jorgesca,项目名称:garmintools,代码行数:8,代码来源:pack.c


示例8: ctr_init_iv

void ctr_init_iv(uint8 *iv, int64 counter)
{
	int64 val = counter;
	unsigned int ll = (unsigned int)counter;
	unsigned int hh = (unsigned int)(counter >> 32);

	memset(iv, 0, 16);
	PUTU32(iv+8, hh);
	PUTU32(iv+12, ll);
}
开发者ID:wqx081,项目名称:mpr_crypto_system,代码行数:10,代码来源:cryptlib.c


示例9: garmin_pack_d906

static void
garmin_pack_d906 ( D906 * lap, uint8 ** pos )
{
    PUTU32(lap->start_time);
    PUTU32(lap->total_time);
    PUTF32(lap->total_distance);
    PUTPOS(lap->begin);
    PUTPOS(lap->end);
    PUTU16(lap->calories);
    PUTU8(lap->track_index);
}
开发者ID:jorgesca,项目名称:garmintools,代码行数:11,代码来源:pack.c


示例10: garmin_pack_dlist

static void
garmin_pack_dlist ( garmin_list * list, uint8 ** pos )
{
    garmin_list_node * node;

    PUTU32(list->id);
    PUTU32(list->elements);
    for ( node = list->head; node != NULL; node = node->next ) {
        PUTU32(list->id);
        garmin_pack(node->data,pos);
    }
}
开发者ID:jorgesca,项目名称:garmintools,代码行数:12,代码来源:pack.c


示例11: garmin_pack_d1000

static void
garmin_pack_d1000 ( D1000 * run, uint8 ** pos )
{
    PUTU32(run->track_index);
    PUTU32(run->first_lap_index);
    PUTU32(run->last_lap_index);
    PUTU8(run->sport_type);
    PUTU8(run->program_type);
    SKIP(2);
    PUTU32(run->virtual_partner.time);
    PUTF32(run->virtual_partner.distance);
    garmin_pack_d1002(&run->workout,pos);
}
开发者ID:jorgesca,项目名称:garmintools,代码行数:13,代码来源:pack.c


示例12: rijndaelDecrypt_Final

void rijndaelDecrypt_Final(const u32 rk[/*44*/], u8 pt[16], int rank)
{
	//printf("In AES final thread\n");
	float tempArray[4];
	int i = 0;
	u32 s[4], t0 = 0, t1 = 0, t2 = 0, t3 = 0;

	int Nr = 10;

	int * s_sign = (int*)s;
	MPI_Recv(s_sign, 4, MPI_INT, rank - 1, 0, MPI_COMM_WORLD, MPI_STATUS_IGNORE);
	ROUND(9, &t0, &t1, &t2, &t3, s[0], s[1], s[2], s[3], rk);

	/*
	 * apply last round and
	 * map cipher state to byte array block:
	 */

	rk += Nr << 2;

	s[0] = TD41(t0) ^ TD42(t3) ^ TD43(t2) ^ TD44(t1) ^ rk[0];
	PUTU32(pt     , s[0]);
	s[1] = TD41(t1) ^ TD42(t0) ^ TD43(t3) ^ TD44(t2) ^ rk[1];
	PUTU32(pt +  4, s[1]);
	s[2] = TD41(t2) ^ TD42(t1) ^ TD43(t0) ^ TD44(t3) ^ rk[2];
	PUTU32(pt +  8, s[2]);
	s[3] = TD41(t3) ^ TD42(t2) ^ TD43(t1) ^ TD44(t0) ^ rk[3];
	PUTU32(pt + 12, s[3]);

	for(i=0; i <4; i++)
	{
		union {
			float f;
			unsigned char b[4];
		} u;

		u.b[3] = pt[4*i+0];
		u.b[2] = pt[4*i+1];
		u.b[1] = pt[4*i+2];
		u.b[0] = pt[4*i+3];

		tempArray[i] = u.f;
		//printf("%f ",tempArray[i]);
	}

	//printf("\n");
	//for(i = 1; i <= 4; i++)
	//printf("Sent the values to %d\n", rank + 1);
	MPI_Send(tempArray, 4, MPI_FLOAT, rank + 1, 0, MPI_COMM_WORLD);
}
开发者ID:iot-locus,项目名称:kernels,代码行数:50,代码来源:aes_mpi.c


示例13: garmin_pack_d1001

static void
garmin_pack_d1001 ( D1001 * lap, uint8 ** pos )
{
    PUTU32(lap->index);
    PUTU32(lap->start_time);
    PUTU32(lap->total_time);
    PUTF32(lap->total_dist);
    PUTF32(lap->max_speed);
    PUTPOS(lap->begin);
    PUTPOS(lap->end);
    PUTU16(lap->calories);
    PUTU8(lap->avg_heart_rate);
    PUTU8(lap->max_heart_rate);
    PUTU8(lap->intensity);
}
开发者ID:jorgesca,项目名称:garmintools,代码行数:15,代码来源:pack.c


示例14: sms4_encrypt

void sms4_encrypt(const unsigned char *in, unsigned char *out, const sms4_key_t *key)
{
	const uint32_t *rk = key->rk;
	uint32_t X0, X1, X2, X3, X4;

	X0 = GETU32(in     );
	X1 = GETU32(in +  4);
	X2 = GETU32(in +  8);
	X3 = GETU32(in + 12);

	ROUND(X0, X1, X2, X3, X4, rk[0]);
	ROUND(X1, X2, X3, X4, X0, rk[1]);
	ROUND(X2, X3, X4, X0, X1, rk[2]);
	ROUND(X3, X4, X0, X1, X2, rk[3]);
	ROUND(X4, X0, X1, X2, X3, rk[4]);
	ROUND(X0, X1, X2, X3, X4, rk[5]);
	ROUND(X1, X2, X3, X4, X0, rk[6]);
	ROUND(X2, X3, X4, X0, X1, rk[7]);
	ROUND(X3, X4, X0, X1, X2, rk[8]);
	ROUND(X4, X0, X1, X2, X3, rk[9]);
	ROUND(X0, X1, X2, X3, X4, rk[10]);
	ROUND(X1, X2, X3, X4, X0, rk[11]);
	ROUND(X2, X3, X4, X0, X1, rk[12]);
	ROUND(X3, X4, X0, X1, X2, rk[13]);
	ROUND(X4, X0, X1, X2, X3, rk[14]);
	ROUND(X0, X1, X2, X3, X4, rk[15]);
	ROUND(X1, X2, X3, X4, X0, rk[16]);
	ROUND(X2, X3, X4, X0, X1, rk[17]);
	ROUND(X3, X4, X0, X1, X2, rk[18]);
	ROUND(X4, X0, X1, X2, X3, rk[19]);
	ROUND(X0, X1, X2, X3, X4, rk[20]);
	ROUND(X1, X2, X3, X4, X0, rk[21]);
	ROUND(X2, X3, X4, X0, X1, rk[22]);
	ROUND(X3, X4, X0, X1, X2, rk[23]);
	ROUND(X4, X0, X1, X2, X3, rk[24]);
	ROUND(X0, X1, X2, X3, X4, rk[25]);
	ROUND(X1, X2, X3, X4, X0, rk[26]);
	ROUND(X2, X3, X4, X0, X1, rk[27]);
	ROUND(X3, X4, X0, X1, X2, rk[28]);
	ROUND(X4, X0, X1, X2, X3, rk[29]);
	ROUND(X0, X1, X2, X3, X4, rk[30]);
	ROUND(X1, X2, X3, X4, X0, rk[31]);

	PUTU32(X0, out);
	PUTU32(X4, out + 4);
	PUTU32(X3, out + 8);
	PUTU32(X2, out + 12);
}
开发者ID:BeyondChallenge,项目名称:GmSSL,代码行数:48,代码来源:sms4.c


示例15: aes_cipher

int aes_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
               const unsigned char *in, size_t len)
{
    int block;
    int i, j;
    unsigned int mode, key_len;

    mode = EVP_CIPHER_CTX_mode(ctx) - 1;
    key_len = (ctx->key_len)/8 - 2;

    block = len / 16;

    for (i = 0; i < block; i++) {
        for (j = 0; j < 4; j++) {
            REG_TEXT(j) = GETU32(in + i*16 + j*4);
        }

        REG_AES = ED(0, key_len, ctx->encrypt, mode, 0, 0);

        int a[5];
        a[4] = REG_RESULT(0);
        for (j = 0; j < 4; j++) {
            a[j] = REG_RESULT(j);
        }

        for (j = 0; j < 4; j++) {
            PUTU32(a[j], out + i*16 + j*4);
        }
    }

    return 1;
}
开发者ID:zhjwpku,项目名称:hw_engine,代码行数:32,代码来源:hw_aes.c


示例16: garmin_pack_d300

static void
garmin_pack_d300 ( D300 * point, uint8 ** pos )
{
    PUTPOS(point->posn);
    PUTU32(point->time);
    PUTU8(point->new_trk);
}
开发者ID:jorgesca,项目名称:garmintools,代码行数:7,代码来源:pack.c


示例17: garmin_pack_d303

static void
garmin_pack_d303 ( D303 * point, uint8 ** pos )
{
    PUTPOS(point->posn);
    PUTU32(point->time);
    PUTF32(point->alt);
    PUTU8(point->heart_rate);
}
开发者ID:jorgesca,项目名称:garmintools,代码行数:8,代码来源:pack.c


示例18: garmin_pack_d450

static void
garmin_pack_d450 ( D450 * prx, uint8 ** pos )
{
    PUTU32(prx->idx);
    garmin_pack_d150(&prx->wpt,pos);
    SKIP(sizeof(D150));
    PUTF32(prx->dst);
}
开发者ID:jorgesca,项目名称:garmintools,代码行数:8,代码来源:pack.c


示例19: Camellia_DecryptBlock_Rounds

void Camellia_DecryptBlock_Rounds(int grandRounds, const u8 ciphertext[],
                                  const KEY_TABLE_TYPE keyTable,
                                  u8 plaintext[])
{
    u32 s0, s1, s2, s3;
    const u32 *k = keyTable + grandRounds * 16, *kend = keyTable + 4;

    s0 = GETU32(ciphertext) ^ k[0];
    s1 = GETU32(ciphertext + 4) ^ k[1];
    s2 = GETU32(ciphertext + 8) ^ k[2];
    s3 = GETU32(ciphertext + 12) ^ k[3];

    while (1) {
        /* Camellia makes 6 Feistel rounds */
        k -= 12;
        Camellia_Feistel(s0, s1, s2, s3, k + 10);
        Camellia_Feistel(s2, s3, s0, s1, k + 8);
        Camellia_Feistel(s0, s1, s2, s3, k + 6);
        Camellia_Feistel(s2, s3, s0, s1, k + 4);
        Camellia_Feistel(s0, s1, s2, s3, k + 2);
        Camellia_Feistel(s2, s3, s0, s1, k + 0);

        if (k == kend)
            break;

        /*
         * This is the same function as the diffusion function D of the
         * accompanying documentation. See section 3.2 for properties of the
         * FLlayer function.
         */
        k -= 4;
        s1 ^= LeftRotate(s0 & k[2], 1);
        s2 ^= s3 | k[1];
        s0 ^= s1 | k[3];
        s3 ^= LeftRotate(s2 & k[0], 1);
    }

    k -= 4;
    s2 ^= k[0], s3 ^= k[1], s0 ^= k[2], s1 ^= k[3];

    PUTU32(plaintext, s2);
    PUTU32(plaintext + 4, s3);
    PUTU32(plaintext + 8, s0);
    PUTU32(plaintext + 12, s1);
}
开发者ID:InfoHunter,项目名称:openssl,代码行数:45,代码来源:camellia.c


示例20: garmin_pack_d301

static void
garmin_pack_d301 ( D301 * point, uint8 ** pos )
{
    PUTPOS(point->posn);
    PUTU32(point->time);
    PUTF32(point->alt);
    PUTF32(point->dpth);
    PUTU8(point->new_trk);
}
开发者ID:jorgesca,项目名称:garmintools,代码行数:9,代码来源:pack.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ PUT_32BIT函数代码示例发布时间:2022-05-30
下一篇:
C++ PUTSHORT函数代码示例发布时间: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