當前位置: 首頁>>代碼示例>>C++>>正文


C++ GETU32函數代碼示例

本文整理匯總了C++中GETU32函數的典型用法代碼示例。如果您正苦於以下問題:C++ GETU32函數的具體用法?C++ GETU32怎麽用?C++ GETU32使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了GETU32函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: aes_init_key

int aes_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
                 const unsigned char *iv, int enc)
{
    int i;
    unsigned int key_len, mode;

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

    REG_MODE = 0x20;

    REG_AES = BC_INI(0, key_len, enc, mode, 0);

    for (i = 0; i < (4 + key_len * 2); i++)
        REG_KEY(i) = GETU32(key + i * 4);

    if (!mode) {
        for (i = 0; i < 4; i++)
            REG_IV(i) = GETU32(iv + i * 4);
    }

    // Key expension
    REG_AES = KEXP(0, key_len, enc, mode, 0);

    return 1;
}
開發者ID:zhjwpku,項目名稱:hw_engine,代碼行數:26,代碼來源:hw_aes.c

示例2: 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

示例3: 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

示例4: 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

示例5: do_append

int do_append(const char *filename,uint64_t lv,uint32_t ts,char *ptr) {
	uint32_t inode,inode_src;
	EAT(ptr,filename,lv,'(');
	GETU32(inode,ptr);
	EAT(ptr,filename,lv,',');
	GETU32(inode_src,ptr);
	EAT(ptr,filename,lv,')');
	return fs_log_append(ts,inode,inode_src);
}
開發者ID:alexmiao,項目名稱:moosefs,代碼行數:9,代碼來源:restore.c

示例6: do_append

uint8_t do_append(uint64_t lv,uint32_t ts,char *ptr) {
        uint32_t inode,inode_src;
        EAT(ptr,lv,'(');
        GETU32(inode,ptr);
        EAT(ptr,lv,',');
        GETU32(inode_src,ptr);
        EAT(ptr,lv,')');
        return shadow_fs_append(ts,inode,inode_src);
}
開發者ID:andyqzb,項目名稱:shadow-mfs,代碼行數:9,代碼來源:replay.c

示例7: do_emptytrash

uint8_t do_emptytrash(uint64_t lv,uint32_t ts,char *ptr) {
        uint32_t reservedinodes,freeinodes;
        EAT(ptr,lv,'(');
        EAT(ptr,lv,')');
        EAT(ptr,lv,':');
        GETU32(freeinodes,ptr);
        EAT(ptr,lv,',');
        GETU32(reservedinodes,ptr);
        return shadow_fs_emptytrash(ts,freeinodes,reservedinodes);
}
開發者ID:andyqzb,項目名稱:shadow-mfs,代碼行數:10,代碼來源:replay.c

示例8: do_aquire

uint8_t do_aquire(uint64_t lv,uint32_t ts,char *ptr) {
	uint32_t inode,cuid;
	(void)ts;
	EAT(ptr,lv,'(');
	GETU32(inode,ptr);
	EAT(ptr,lv,',');
	GETU32(cuid,ptr);
	EAT(ptr,lv,')');
	return fs_aquire(inode,cuid);
}
開發者ID:chengyishi,項目名稱:moosefs,代碼行數:10,代碼來源:restore.c

示例9: do_release

uint8_t do_release(uint64_t lv,uint32_t ts,char *ptr) {
        uint32_t inode,cuid;
        (void)ts;
        EAT(ptr,lv,'(');
        GETU32(inode,ptr);
        EAT(ptr,lv,',');
        GETU32(cuid,ptr);
        EAT(ptr,lv,')');
        return shadow_fs_release(inode,cuid);
}
開發者ID:andyqzb,項目名稱:shadow-mfs,代碼行數:10,代碼來源:replay.c

示例10: do_emptytrash

int do_emptytrash(const char *filename,uint64_t lv,uint32_t ts,char *ptr) {
	uint32_t reservedinodes,freeinodes;
	EAT(ptr,filename,lv,'(');
	EAT(ptr,filename,lv,')');
	EAT(ptr,filename,lv,':');
	GETU32(freeinodes,ptr);
	EAT(ptr,filename,lv,',');
	GETU32(reservedinodes,ptr);
	return fs_log_emptytrash(ts,freeinodes,reservedinodes);
}
開發者ID:alexmiao,項目名稱:moosefs,代碼行數:10,代碼來源:restore.c

示例11: rijndaelKeySetupEnc_Master

void rijndaelKeySetupEnc_Master(u32 *rk, const u8 cipherKey[], int rank)
{
	rk[0] = GETU32(cipherKey     );
	rk[1] = GETU32(cipherKey +  4);
	rk[2] = GETU32(cipherKey +  8);
	rk[3] = GETU32(cipherKey + 12);

	int * rk_sign = (int*)rk;
	MPI_Send(rk_sign, 4, MPI_INT, rank + 1, 0, MPI_COMM_WORLD);
}
開發者ID:iot-locus,項目名稱:kernels,代碼行數:10,代碼來源:aes_mpi.c

示例12: do_reinit

/*
int do_reinit(const char *filename,uint64_t lv,uint32_t ts,char *ptr) {
	uint32_t inode,indx;
	uint64_t chunkid;
	EAT(ptr,filename,lv,'(');
	GETU32(inode,ptr);
	EAT(ptr,filename,lv,',');
	GETU32(indx,ptr);
	EAT(ptr,filename,lv,')');
	EAT(ptr,filename,lv,':');
	GETU64(chunkid,ptr);
	return fs_log_reinit(ts,inode,indx,chunkid);
}
*/
int do_release(const char *filename,uint64_t lv,uint32_t ts,char *ptr) {
	uint32_t inode,cuid;
	(void)ts;
	EAT(ptr,filename,lv,'(');
	GETU32(inode,ptr);
	EAT(ptr,filename,lv,',');
	GETU32(cuid,ptr);
	EAT(ptr,filename,lv,')');
	return fs_log_release(inode,cuid);
}
開發者ID:alexmiao,項目名稱:moosefs,代碼行數:24,代碼來源:restore.c

示例13: do_repair

int do_repair(const char *filename,uint64_t lv,uint32_t ts,char *ptr) {
	uint32_t inode,indx;
	uint32_t version;
	EAT(ptr,filename,lv,'(');
	GETU32(inode,ptr);
	EAT(ptr,filename,lv,',');
	GETU32(indx,ptr);
	EAT(ptr,filename,lv,')');
	EAT(ptr,filename,lv,':');
	GETU32(version,ptr);
	return fs_log_repair(ts,inode,indx,version);
}
開發者ID:alexmiao,項目名稱:moosefs,代碼行數:12,代碼來源:restore.c

示例14: do_unlink

int do_unlink(const char *filename,uint64_t lv,uint32_t ts,char *ptr) {
	uint32_t inode,parent;
	uint8_t name[256];
	EAT(ptr,filename,lv,'(');
	GETU32(parent,ptr);
	EAT(ptr,filename,lv,',');
	GETNAME(name,ptr,filename,lv,')');
	EAT(ptr,filename,lv,')');
	EAT(ptr,filename,lv,':');
	GETU32(inode,ptr);
	return fs_log_unlink(ts,parent,strlen((char*)name),name,inode);
}
開發者ID:alexmiao,項目名稱:moosefs,代碼行數:12,代碼來源:restore.c

示例15: do_trunc

int do_trunc(const char *filename,uint64_t lv,uint32_t ts,char *ptr) {
	uint32_t inode,indx;
	uint64_t chunkid;
	EAT(ptr,filename,lv,'(');
	GETU32(inode,ptr);
	EAT(ptr,filename,lv,',');
	GETU32(indx,ptr);
	EAT(ptr,filename,lv,')');
	EAT(ptr,filename,lv,':');
	GETU64(chunkid,ptr);
	return fs_log_trunc(ts,inode,indx,chunkid);
}
開發者ID:alexmiao,項目名稱:moosefs,代碼行數:12,代碼來源:restore.c


注:本文中的GETU32函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。