本文整理汇总了C++中PUTU32函数的典型用法代码示例。如果您正苦于以下问题:C++ PUTU32函数的具体用法?C++ PUTU32怎么用?C++ PUTU32使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了PUTU32函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例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);
}
示例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]);
}
示例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);
}
示例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
}
示例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]);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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;
}