本文整理匯總了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;
}
示例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]);
}
示例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);
}
示例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
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}