您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ store32函数代码示例

51自学网 2021-06-03 08:24:44
  C++
这篇教程C++ store32函数代码示例写得很实用,希望能帮到您。

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

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

示例1: osap

/* * Create an object specific authorisation protocol (OSAP) session */static int osap(struct tpm_buf *tb, struct osapsess *s,		const unsigned char *key, uint16_t type, uint32_t handle){	unsigned char enonce[TPM_NONCE_SIZE];	unsigned char ononce[TPM_NONCE_SIZE];	int ret;	ret = tpm_get_random(TPM_ANY_NUM, ononce, TPM_NONCE_SIZE);	if (ret != TPM_NONCE_SIZE)		return ret;	INIT_BUF(tb);	store16(tb, TPM_TAG_RQU_COMMAND);	store32(tb, TPM_OSAP_SIZE);	store32(tb, TPM_ORD_OSAP);	store16(tb, type);	store32(tb, handle);	storebytes(tb, ononce, TPM_NONCE_SIZE);	ret = trusted_tpm_send(TPM_ANY_NUM, tb->data, MAX_BUF_SIZE);	if (ret < 0)		return ret;	s->handle = LOAD32(tb->data, TPM_DATA_OFFSET);	memcpy(s->enonce, &(tb->data[TPM_DATA_OFFSET + sizeof(uint32_t)]),	       TPM_NONCE_SIZE);	memcpy(enonce, &(tb->data[TPM_DATA_OFFSET + sizeof(uint32_t) +				  TPM_NONCE_SIZE]), TPM_NONCE_SIZE);	return TSS_rawhmac(s->secret, key, SHA1_DIGEST_SIZE, TPM_NONCE_SIZE,			   enonce, TPM_NONCE_SIZE, ononce, 0, 0);}
开发者ID:a2hojsjsjs,项目名称:linux,代码行数:34,


示例2: blake2b_init_key

int blake2b_init_key( blake2b_state *S, size_t outlen, const void *key, size_t keylen ){  blake2b_param P[1];  if ( ( !outlen ) || ( outlen > BLAKE2B_OUTBYTES ) ) return -1;  if ( !key || !keylen || keylen > BLAKE2B_KEYBYTES ) return -1;  P->digest_length = (uint8_t)outlen;  P->key_length    = (uint8_t)keylen;  P->fanout        = 1;  P->depth         = 1;  store32( &P->leaf_length, 0 );  store32( &P->node_offset, 0 );  store32( &P->xof_length, 0 );  P->node_depth    = 0;  P->inner_length  = 0;  memset( P->reserved, 0, sizeof( P->reserved ) );  memset( P->salt,     0, sizeof( P->salt ) );  memset( P->personal, 0, sizeof( P->personal ) );  if( blake2b_init_param( S, P ) < 0 ) return -1;  {    uint8_t block[BLAKE2B_BLOCKBYTES];    memset( block, 0, BLAKE2B_BLOCKBYTES );    memcpy( block, key, keylen );    blake2b_update( S, block, BLAKE2B_BLOCKBYTES );    secure_zero_memory( block, BLAKE2B_BLOCKBYTES ); /* Burn the key from stack */  }  return 0;}
开发者ID:Abogical,项目名称:borg,代码行数:32,


示例3: emitLoad

void JIT::compileSetupVarargsFrame(Instruction* instruction, CallLinkInfo* info){    int thisValue = instruction[3].u.operand;    int arguments = instruction[4].u.operand;    int firstFreeRegister = instruction[5].u.operand;    int firstVarArgOffset = instruction[6].u.operand;    emitLoad(arguments, regT1, regT0);    callOperation(operationSizeFrameForVarargs, regT1, regT0, -firstFreeRegister, firstVarArgOffset);    move(TrustedImm32(-firstFreeRegister), regT1);    emitSetVarargsFrame(*this, returnValueGPR, false, regT1, regT1);    addPtr(TrustedImm32(-(sizeof(CallerFrameAndPC) + WTF::roundUpToMultipleOf(stackAlignmentBytes(), 6 * sizeof(void*)))), regT1, stackPointerRegister);    emitLoad(arguments, regT2, regT4);    callOperation(operationSetupVarargsFrame, regT1, regT2, regT4, firstVarArgOffset, regT0);    move(returnValueGPR, regT1);    // Profile the argument count.    load32(Address(regT1, JSStack::ArgumentCount * static_cast<int>(sizeof(Register)) + PayloadOffset), regT2);    load8(info->addressOfMaxNumArguments(), regT0);    Jump notBiggest = branch32(Above, regT0, regT2);    Jump notSaturated = branch32(BelowOrEqual, regT2, TrustedImm32(255));    move(TrustedImm32(255), regT2);    notSaturated.link(this);    store8(regT2, info->addressOfMaxNumArguments());    notBiggest.link(this);        // Initialize 'this'.    emitLoad(thisValue, regT2, regT0);    store32(regT0, Address(regT1, PayloadOffset + (CallFrame::thisArgumentOffset() * static_cast<int>(sizeof(Register)))));    store32(regT2, Address(regT1, TagOffset + (CallFrame::thisArgumentOffset() * static_cast<int>(sizeof(Register)))));        addPtr(TrustedImm32(sizeof(CallerFrameAndPC)), regT1, stackPointerRegister);}
开发者ID:cheekiatng,项目名称:webkit,代码行数:33,


示例4: emitLoadTag

void JIT::compileLoadVarargs(Instruction* instruction){    int thisValue = instruction[2].u.operand;    int arguments = instruction[3].u.operand;    int firstFreeRegister = instruction[4].u.operand;    JumpList slowCase;    JumpList end;    if (m_codeBlock->usesArguments() && arguments == m_codeBlock->argumentsRegister()) {        emitLoadTag(arguments, regT1);        slowCase.append(branch32(NotEqual, regT1, TrustedImm32(JSValue::EmptyValueTag)));        load32(payloadFor(RegisterFile::ArgumentCount), regT2);        slowCase.append(branch32(Above, regT2, TrustedImm32(Arguments::MaxArguments + 1)));        // regT2: argumentCountIncludingThis        move(regT2, regT3);        add32(TrustedImm32(firstFreeRegister + RegisterFile::CallFrameHeaderSize), regT3);        lshift32(TrustedImm32(3), regT3);        addPtr(callFrameRegister, regT3);        // regT3: newCallFrame        slowCase.append(branchPtr(Below, AbsoluteAddress(m_globalData->interpreter->registerFile().addressOfEnd()), regT3));        // Initialize ArgumentCount.        store32(regT2, payloadFor(RegisterFile::ArgumentCount, regT3));        // Initialize 'this'.        emitLoad(thisValue, regT1, regT0);        store32(regT0, Address(regT3, OBJECT_OFFSETOF(JSValue, u.asBits.payload) + (CallFrame::thisArgumentOffset() * static_cast<int>(sizeof(Register)))));        store32(regT1, Address(regT3, OBJECT_OFFSETOF(JSValue, u.asBits.tag) + (CallFrame::thisArgumentOffset() * static_cast<int>(sizeof(Register)))));        // Copy arguments.        neg32(regT2);        end.append(branchAdd32(Zero, TrustedImm32(1), regT2));        // regT2: -argumentCount;        Label copyLoop = label();        load32(BaseIndex(callFrameRegister, regT2, TimesEight, OBJECT_OFFSETOF(JSValue, u.asBits.payload) +(CallFrame::thisArgumentOffset() * static_cast<int>(sizeof(Register)))), regT0);        load32(BaseIndex(callFrameRegister, regT2, TimesEight, OBJECT_OFFSETOF(JSValue, u.asBits.tag) +(CallFrame::thisArgumentOffset() * static_cast<int>(sizeof(Register)))), regT1);        store32(regT0, BaseIndex(regT3, regT2, TimesEight, OBJECT_OFFSETOF(JSValue, u.asBits.payload) +(CallFrame::thisArgumentOffset() * static_cast<int>(sizeof(Register)))));        store32(regT1, BaseIndex(regT3, regT2, TimesEight, OBJECT_OFFSETOF(JSValue, u.asBits.tag) +(CallFrame::thisArgumentOffset() * static_cast<int>(sizeof(Register)))));        branchAdd32(NonZero, TrustedImm32(1), regT2).linkTo(copyLoop, this);        end.append(jump());    }    if (m_codeBlock->usesArguments() && arguments == m_codeBlock->argumentsRegister())        slowCase.link(this);    JITStubCall stubCall(this, cti_op_load_varargs);    stubCall.addArgument(thisValue);    stubCall.addArgument(arguments);    stubCall.addArgument(Imm32(firstFreeRegister));    stubCall.call(regT3);    if (m_codeBlock->usesArguments() && arguments == m_codeBlock->argumentsRegister())        end.link(this);}
开发者ID:xiaolu31,项目名称:webkit-node,代码行数:59,


示例5: blake2xs_final

int blake2xs_final(blake2xs_state *S, void *out, size_t outlen) {  blake2s_state C[1];  blake2s_param P[1];  uint16_t xof_length = load16(&S->P->xof_length);  uint8_t root[BLAKE2S_BLOCKBYTES];  size_t i;  if (NULL == out) {    return -1;  }  /* outlen must match the output size defined in xof_length, */  /* unless it was -1, in which case anything goes except 0. */  if(xof_length == 0xFFFFUL) {    if(outlen == 0) {      return -1;    }  } else {    if(outlen != xof_length) {      return -1;    }  }  /* Finalize the root hash */  if (blake2s_final(S->S, root, BLAKE2S_OUTBYTES) < 0) {    return -1;  }  /* Set common block structure values */  /* Copy values from parent instance, and only change the ones below */  memcpy(P, S->P, sizeof(blake2s_param));  P->key_length = 0;  P->fanout = 0;  P->depth = 0;  store32(&P->leaf_length, BLAKE2S_OUTBYTES);  P->inner_length = BLAKE2S_OUTBYTES;  P->node_depth = 0;  for (i = 0; outlen > 0; ++i) {    const size_t block_size = (outlen < BLAKE2S_OUTBYTES) ? outlen : BLAKE2S_OUTBYTES;    /* Initialize state */    P->digest_length = block_size;    store32(&P->node_offset, i);    blake2s_init_param(C, P);    /* Process key if needed */    blake2s_update(C, root, BLAKE2S_OUTBYTES);    if (blake2s_final(C, (uint8_t *)out + i * BLAKE2S_OUTBYTES, block_size) < 0) {        return -1;    }    outlen -= block_size;  }  secure_zero_memory(root, sizeof(root));  secure_zero_memory(P, sizeof(P));  secure_zero_memory(C, sizeof(C));  /* Put blake2xs in an invalid state? cf. blake2s_is_lastblock */  return 0;}
开发者ID:BLAKE2,项目名称:BLAKE2,代码行数:58,


示例6: stubCall

void JIT::compileOpCall(OpcodeID opcodeID, Instruction* instruction, unsigned callLinkInfoIndex){    int callee = instruction[1].u.operand;    int argCount = instruction[2].u.operand;    int registerOffset = instruction[3].u.operand;    Jump wasEval;    if (opcodeID == op_call_eval) {        JITStubCall stubCall(this, cti_op_call_eval);        stubCall.addArgument(callee);        stubCall.addArgument(JIT::Imm32(registerOffset));        stubCall.addArgument(JIT::Imm32(argCount));        stubCall.call();        wasEval = branch32(NotEqual, regT1, TrustedImm32(JSValue::EmptyValueTag));    }    emitLoad(callee, regT1, regT0);    DataLabelPtr addressOfLinkedFunctionCheck;    BEGIN_UNINTERRUPTED_SEQUENCE(sequenceOpCall);    Jump jumpToSlow = branchPtrWithPatch(NotEqual, regT0, addressOfLinkedFunctionCheck, TrustedImmPtr(0));    END_UNINTERRUPTED_SEQUENCE(sequenceOpCall);    addSlowCase(jumpToSlow);    ASSERT_JIT_OFFSET(differenceBetween(addressOfLinkedFunctionCheck, jumpToSlow), patchOffsetOpCallCompareToJump);    ASSERT(m_callStructureStubCompilationInfo.size() == callLinkInfoIndex);    m_callStructureStubCompilationInfo.append(StructureStubCompilationInfo());    m_callStructureStubCompilationInfo[callLinkInfoIndex].hotPathBegin = addressOfLinkedFunctionCheck;    m_callStructureStubCompilationInfo[callLinkInfoIndex].isCall = opcodeID != op_construct;    m_callStructureStubCompilationInfo[callLinkInfoIndex].bytecodeIndex = m_bytecodeOffset;    addSlowCase(branch32(NotEqual, regT1, TrustedImm32(JSValue::CellTag)));    // The following is the fast case, only used whan a callee can be linked.    // Fast version of stack frame initialization, directly relative to edi.    // Note that this omits to set up RegisterFile::CodeBlock, which is set in the callee    loadPtr(Address(regT0, OBJECT_OFFSETOF(JSFunction, m_scopeChain)), regT2);    store32(TrustedImm32(JSValue::Int32Tag), tagFor(registerOffset + RegisterFile::ArgumentCount));    store32(Imm32(argCount), payloadFor(registerOffset + RegisterFile::ArgumentCount));    storePtr(callFrameRegister, payloadFor(RegisterFile::CallerFrame + registerOffset, callFrameRegister));    emitStore(registerOffset + RegisterFile::Callee, regT1, regT0);    store32(TrustedImm32(JSValue::CellTag), tagFor(registerOffset + RegisterFile::ScopeChain));    store32(regT2, payloadFor(registerOffset + RegisterFile::ScopeChain));    addPtr(Imm32(registerOffset * sizeof(Register)), callFrameRegister);    // Call to the callee    m_callStructureStubCompilationInfo[callLinkInfoIndex].hotPathOther = emitNakedCall();        if (opcodeID == op_call_eval)        wasEval.link(this);    sampleCodeBlock(m_codeBlock);}
开发者ID:1833183060,项目名称:wke,代码行数:58,


示例7: stubCall

void JIT::compileOpCall(OpcodeID opcodeID, Instruction* instruction, unsigned callLinkInfoIndex){    int callee = instruction[1].u.operand;    int argCount = instruction[2].u.operand;    int registerOffset = instruction[3].u.operand;    // Handle eval    Jump wasEval;    if (opcodeID == op_call_eval) {        JITStubCall stubCall(this, cti_op_call_eval);        stubCall.addArgument(callee, regT0);        stubCall.addArgument(JIT::Imm32(registerOffset));        stubCall.addArgument(JIT::Imm32(argCount));        stubCall.call();        wasEval = branchPtr(NotEqual, regT0, TrustedImmPtr(JSValue::encode(JSValue())));    }    // This plants a check for a cached JSFunction value, so we can plant a fast link to the callee.    // This deliberately leaves the callee in ecx, used when setting up the stack frame below    emitGetVirtualRegister(callee, regT0);    DataLabelPtr addressOfLinkedFunctionCheck;    BEGIN_UNINTERRUPTED_SEQUENCE(sequenceOpCall);    Jump jumpToSlow = branchPtrWithPatch(NotEqual, regT0, addressOfLinkedFunctionCheck, TrustedImmPtr(JSValue::encode(JSValue())));    END_UNINTERRUPTED_SEQUENCE(sequenceOpCall);    addSlowCase(jumpToSlow);    ASSERT_JIT_OFFSET(differenceBetween(addressOfLinkedFunctionCheck, jumpToSlow), patchOffsetOpCallCompareToJump);    m_callStructureStubCompilationInfo[callLinkInfoIndex].hotPathBegin = addressOfLinkedFunctionCheck;    m_callStructureStubCompilationInfo[callLinkInfoIndex].isCall = opcodeID != op_construct;    // The following is the fast case, only used whan a callee can be linked.    // Fast version of stack frame initialization, directly relative to edi.    // Note that this omits to set up RegisterFile::CodeBlock, which is set in the callee    loadPtr(Address(regT0, OBJECT_OFFSETOF(JSFunction, m_scopeChain)), regT1); // newScopeChain        store32(TrustedImm32(Int32Tag), intTagFor(registerOffset + RegisterFile::ArgumentCount));    store32(Imm32(argCount), intPayloadFor(registerOffset + RegisterFile::ArgumentCount));    storePtr(callFrameRegister, Address(callFrameRegister, (registerOffset + RegisterFile::CallerFrame) * static_cast<int>(sizeof(Register))));    storePtr(regT0, Address(callFrameRegister, (registerOffset + RegisterFile::Callee) * static_cast<int>(sizeof(Register))));    storePtr(regT1, Address(callFrameRegister, (registerOffset + RegisterFile::ScopeChain) * static_cast<int>(sizeof(Register))));    addPtr(Imm32(registerOffset * sizeof(Register)), callFrameRegister);    // Call to the callee    m_callStructureStubCompilationInfo[callLinkInfoIndex].hotPathOther = emitNakedCall();        if (opcodeID == op_call_eval)        wasEval.link(this);    sampleCodeBlock(m_codeBlock);}
开发者ID:mulriple,项目名称:Webkit-Projects,代码行数:55,


示例8: tpm_flushspecific

/* * Execute the FlushSpecific TPM command */static int tpm_flushspecific(struct tpm_buf *tb, uint32_t handle){	INIT_BUF(tb);	store16(tb, TPM_TAG_RQU_COMMAND);	store32(tb, TPM_FLUSHSPECIFIC_SIZE);	store32(tb, TPM_ORD_FLUSHSPECIFIC);	store32(tb, handle);	store32(tb, TPM_RT_KEY);	return trusted_tpm_send(tb->data, MAX_BUF_SIZE);}
开发者ID:AlexShiLucky,项目名称:linux,代码行数:14,


示例9: emitGetVirtualRegister

void JIT::compileLoadVarargs(Instruction* instruction){    int thisValue = instruction[3].u.operand;    int arguments = instruction[4].u.operand;    int firstFreeRegister = instruction[5].u.operand;    JumpList slowCase;    JumpList end;    bool canOptimize = m_codeBlock->usesArguments()        && arguments == m_codeBlock->argumentsRegister().offset()        && !m_codeBlock->symbolTable()->slowArguments();    if (canOptimize) {        emitGetVirtualRegister(arguments, regT0);        slowCase.append(branch64(NotEqual, regT0, TrustedImm64(JSValue::encode(JSValue()))));        emitGetFromCallFrameHeader32(JSStack::ArgumentCount, regT0);        slowCase.append(branch32(Above, regT0, TrustedImm32(Arguments::MaxArguments + 1)));        // regT0: argumentCountIncludingThis        move(regT0, regT1);        neg64(regT1);        add64(TrustedImm32(firstFreeRegister - JSStack::CallFrameHeaderSize), regT1);        lshift64(TrustedImm32(3), regT1);        addPtr(callFrameRegister, regT1);        // regT1: newCallFrame        slowCase.append(branchPtr(Above, AbsoluteAddress(m_vm->addressOfJSStackLimit()), regT1));        // Initialize ArgumentCount.        store32(regT0, Address(regT1, JSStack::ArgumentCount * static_cast<int>(sizeof(Register)) + OBJECT_OFFSETOF(EncodedValueDescriptor, asBits.payload)));        // Initialize 'this'.        emitGetVirtualRegister(thisValue, regT2);        store64(regT2, Address(regT1, CallFrame::thisArgumentOffset() * static_cast<int>(sizeof(Register))));        // Copy arguments.        signExtend32ToPtr(regT0, regT0);        end.append(branchSub64(Zero, TrustedImm32(1), regT0));        // regT0: argumentCount        Label copyLoop = label();        load64(BaseIndex(callFrameRegister, regT0, TimesEight, CallFrame::thisArgumentOffset() * static_cast<int>(sizeof(Register))), regT2);        store64(regT2, BaseIndex(regT1, regT0, TimesEight, CallFrame::thisArgumentOffset() * static_cast<int>(sizeof(Register))));        branchSub64(NonZero, TrustedImm32(1), regT0).linkTo(copyLoop, this);        end.append(jump());    }    if (canOptimize)        slowCase.link(this);    emitGetVirtualRegister(thisValue, regT0);    emitGetVirtualRegister(arguments, regT1);    callOperation(operationLoadVarargs, regT0, regT1, firstFreeRegister);    move(returnValueGPR, regT1);    if (canOptimize)        end.link(this);}
开发者ID:rajeshpillai,项目名称:webkit,代码行数:60,


示例10: blake2s_init_key

int blake2s_init_key( blake2s_state *S, const uint8_t outlen, const void *key, const uint8_t keylen,		const void *salt, const void *personal, const uint8_t saltlen, const uint8_t personallen){	blake2s_param P[1];	P->digest_length = outlen;	P->key_length    = keylen;	P->fanout        = 1;	P->depth         = 1;	store32( &P->leaf_length, 0 );	store48( &P->node_offset, 0 );	P->node_depth    = 0;	P->inner_length  = 0;	// memset(P->reserved, 0, sizeof(P->reserved) );	if (saltlen)		memcpy( P->salt, salt, BLAKE2S_SALTBYTES );	else		memset(P->salt, 0, sizeof( P->salt ));	if (personallen)		memcpy( P->personal, personal, BLAKE2S_PERSONALBYTES );	else		memset(P->personal, 0, sizeof(P->personal));	if( blake2s_init_param( S, P ) < 0 ) return -1;	{		uint8_t block[BLAKE2S_BLOCKBYTES];		memset( block, 0, BLAKE2S_BLOCKBYTES );		memcpy( block, key, keylen );		blake2s_update( S, block, BLAKE2S_BLOCKBYTES );		secure_zero_memory( block, BLAKE2S_BLOCKBYTES ); /* Burn the key from stack */	}	return 0;}
开发者ID:riverrun,项目名称:blake2_elixir,代码行数:34,


示例11: blake2b_init_salt_personal

int blake2b_init_salt_personal( blake2b_state *S, const uint8_t outlen,                                const void *salt, const void *personal ){  blake2b_param P[1];  if ( ( !outlen ) || ( outlen > BLAKE2B_OUTBYTES ) ) return -1;  P->digest_length = outlen;  P->key_length    = 0;  P->fanout        = 1;  P->depth         = 1;  store32( &P->leaf_length, 0 );  store64( &P->node_offset, 0 );  P->node_depth    = 0;  P->inner_length  = 0;  memset( P->reserved, 0, sizeof( P->reserved ) );  if (salt != NULL) {    blake2b_param_set_salt( P, (const uint8_t *) salt );  } else {    memset( P->salt, 0, sizeof( P->salt ) );  }  if (personal != NULL) {    blake2b_param_set_personal( P, (const uint8_t *) personal );  } else {    memset( P->personal, 0, sizeof( P->personal ) );  }  return blake2b_init_param( S, P );}
开发者ID:GraxRabble,项目名称:libsodium,代码行数:28,


示例12: sha_done

static void sha_done(sha256_state& md, void* out) {    // Increase the length of the message    md.length += md.curlen * 8;    // Append the '1' bit    md.buf[md.curlen++] = static_cast<unsigned char>(0x80);    // If the length is currently above 56 bytes we append zeros then compress.    // Then we can fall back to padding zeros and length encoding like normal.    if(md.curlen > 56) {        while(md.curlen < 64)            md.buf[md.curlen++] = 0;        sha_compress(md, md.buf);        md.curlen = 0;    }    // Pad upto 56 bytes of zeroes    while(md.curlen < 56)        md.buf[md.curlen++] = 0;    // Store length    store64(md.length, md.buf+56);    sha_compress(md, md.buf);    // Copy output    for(int i = 0; i < 8; i++)        store32(md.state[i], static_cast<unsigned char*>(out)+(4*i));}
开发者ID:SBKarr,项目名称:stappler,代码行数:28,


示例13: blake2s_final

int blake2s_final( blake2s_state *S, uint8_t *out, size_t outlen ){  uint8_t buffer[BLAKE2S_OUTBYTES];  if(S->outlen != outlen) return -1;  if( S->buflen > BLAKE2S_BLOCKBYTES )  {    blake2s_increment_counter( S, BLAKE2S_BLOCKBYTES );    blake2s_compress( S, S->buf );    S->buflen -= BLAKE2S_BLOCKBYTES;    memcpy( S->buf, S->buf + BLAKE2S_BLOCKBYTES, S->buflen );  }  blake2s_increment_counter( S, ( uint32_t )S->buflen );  blake2s_set_lastblock( S );  memset( S->buf + S->buflen, 0, 2 * BLAKE2S_BLOCKBYTES - S->buflen ); /* Padding */  blake2s_compress( S, S->buf );  for( int i = 0; i < 8; ++i ) /* Output full hash to temp buffer */    store32( buffer + sizeof( S->h[i] ) * i, S->h[i] );  memcpy( out, buffer, outlen );  return 0;}
开发者ID:AlexShiLucky,项目名称:luapower-all,代码行数:25,


示例14: stubCall

void JIT::compileOpCall(OpcodeID opcodeID, Instruction* instruction, unsigned){    int callee = instruction[1].u.operand;    int argCount = instruction[2].u.operand;    int registerOffset = instruction[3].u.operand;    Jump wasEval;    if (opcodeID == op_call_eval) {        JITStubCall stubCall(this, cti_op_call_eval);        stubCall.addArgument(callee);        stubCall.addArgument(JIT::Imm32(registerOffset));        stubCall.addArgument(JIT::Imm32(argCount));        stubCall.call();        wasEval = branch32(NotEqual, regT1, TrustedImm32(JSValue::EmptyValueTag));    }    emitLoad(callee, regT1, regT0);    emitJumpSlowCaseIfNotJSCell(callee, regT1);    addSlowCase(branchPtr(NotEqual, Address(regT0), TrustedImmPtr(m_globalData->jsFunctionVPtr)));    // Speculatively roll the callframe, assuming argCount will match the arity.    store32(TrustedImm32(JSValue::CellTag), tagFor(RegisterFile::CallerFrame + registerOffset, callFrameRegister));    storePtr(callFrameRegister, payloadFor(RegisterFile::CallerFrame + registerOffset, callFrameRegister));    addPtr(Imm32(registerOffset * static_cast<int>(sizeof(Register))), callFrameRegister);    move(TrustedImm32(argCount), regT1);    emitNakedCall(opcodeID == op_construct ? m_globalData->jitStubs->ctiVirtualConstruct() : m_globalData->jitStubs->ctiVirtualCall());    if (opcodeID == op_call_eval)        wasEval.link(this);    sampleCodeBlock(m_codeBlock);}
开发者ID:0omega,项目名称:platform_external_webkit,代码行数:34,


示例15: blake2sp_init_root

static int blake2sp_init_root( blake2s_state *S, size_t outlen, size_t keylen ){  blake2s_param P[1];  P->digest_length = (uint8_t)outlen;  P->key_length = (uint8_t)keylen;  P->fanout = PARALLELISM_DEGREE;  P->depth = 2;  store32( &P->leaf_length, 0 );  store32( &P->node_offset, 0 );  store16( &P->xof_length, 0 );  P->node_depth = 1;  P->inner_length = BLAKE2S_OUTBYTES;  memset( P->salt, 0, sizeof( P->salt ) );  memset( P->personal, 0, sizeof( P->personal ) );  return blake2s_init_param( S, P );}
开发者ID:BLAKE2,项目名称:BLAKE2,代码行数:16,


示例16: emitLoad

void JIT::compileOpCallVarargs(Instruction* instruction){    int callee = instruction[1].u.operand;    int argCountRegister = instruction[2].u.operand;    int registerOffset = instruction[3].u.operand;    emitLoad(callee, regT1, regT0);    emitLoadPayload(argCountRegister, regT2); // argCount    addPtr(Imm32(registerOffset), regT2, regT3); // registerOffset    emitJumpSlowCaseIfNotJSCell(callee, regT1);    addSlowCase(branchPtr(NotEqual, Address(regT0), TrustedImmPtr(m_globalData->jsFunctionVPtr)));    // Speculatively roll the callframe, assuming argCount will match the arity.    mul32(TrustedImm32(sizeof(Register)), regT3, regT3);    addPtr(callFrameRegister, regT3);    store32(TrustedImm32(JSValue::CellTag), tagFor(RegisterFile::CallerFrame, regT3));    storePtr(callFrameRegister, payloadFor(RegisterFile::CallerFrame, regT3));    move(regT3, callFrameRegister);    move(regT2, regT1); // argCount    emitNakedCall(m_globalData->jitStubs->ctiVirtualCall());    sampleCodeBlock(m_codeBlock);}
开发者ID:Irrelon,项目名称:iOS-JavaScript-Bridge,代码行数:26,


示例17: ASSERT

void JITCompiler::linkOSRExits(){    ASSERT(m_jitCode->osrExit.size() == m_exitCompilationInfo.size());    if (m_graph.compilation()) {        for (unsigned i = 0; i < m_jitCode->osrExit.size(); ++i) {            OSRExitCompilationInfo& info = m_exitCompilationInfo[i];            Vector<Label> labels;            if (!info.m_failureJumps.empty()) {                for (unsigned j = 0; j < info.m_failureJumps.jumps().size(); ++j)                    labels.append(info.m_failureJumps.jumps()[j].label());            } else                labels.append(info.m_replacementSource);            m_exitSiteLabels.append(labels);        }    }        for (unsigned i = 0; i < m_jitCode->osrExit.size(); ++i) {        OSRExit& exit = m_jitCode->osrExit[i];        OSRExitCompilationInfo& info = m_exitCompilationInfo[i];        JumpList& failureJumps = info.m_failureJumps;        if (!failureJumps.empty())            failureJumps.link(this);        else            info.m_replacementDestination = label();        jitAssertHasValidCallFrame();        store32(TrustedImm32(i), &vm()->osrExitIndex);        exit.setPatchableCodeOffset(patchableJump());    }}
开发者ID:icepy,项目名称:JavaScriptCore,代码行数:30,


示例18: store32

void JIT::compileOpCallInitializeCallFrame(){    // regT0 holds callee, regT1 holds argCount    store32(regT1, Address(callFrameRegister, RegisterFile::ArgumentCount * static_cast<int>(sizeof(Register))));    loadPtr(Address(regT0, OBJECT_OFFSETOF(JSFunction, m_scopeChain) + OBJECT_OFFSETOF(ScopeChain, m_node)), regT3); // scopeChain    storePtr(regT0, Address(callFrameRegister, RegisterFile::Callee * static_cast<int>(sizeof(Register)))); // callee    storePtr(regT3, Address(callFrameRegister, RegisterFile::ScopeChain * static_cast<int>(sizeof(Register)))); // scopeChain}
开发者ID:youtube,项目名称:h5vcc_hh,代码行数:8,


示例19: load_partial_ctr

static inline void load_partial_ctr(CPFB_BLOCK* block, const unsigned char* b, unsigned long long len, unsigned long long counter){  unsigned int i;  for (i = 0; i < len; i++)    block->u8[i] = b[i];  for (; i < PAYLOAD_LENGTH; i ++)    block->u8[i] = 0;  store32(block->u8+PAYLOAD_LENGTH,counter);}  
开发者ID:0x64616E69656C,项目名称:supercop,代码行数:8,


示例20: oiap

/* * Create an object independent authorisation protocol (oiap) session */static int oiap(struct tpm_buf *tb, uint32_t *handle, unsigned char *nonce){	int ret;	INIT_BUF(tb);	store16(tb, TPM_TAG_RQU_COMMAND);	store32(tb, TPM_OIAP_SIZE);	store32(tb, TPM_ORD_OIAP);	ret = trusted_tpm_send(TPM_ANY_NUM, tb->data, MAX_BUF_SIZE);	if (ret < 0)		return ret;	*handle = LOAD32(tb->data, TPM_DATA_OFFSET);	memcpy(nonce, &tb->data[TPM_DATA_OFFSET + sizeof(uint32_t)],	       TPM_NONCE_SIZE);	return 0;}
开发者ID:a2hojsjsjs,项目名称:linux,代码行数:20,


示例21: emitLoad

std::enable_if_t<    Op::opcodeID == op_call_varargs || Op::opcodeID == op_construct_varargs    || Op::opcodeID == op_tail_call_varargs || Op::opcodeID == op_tail_call_forward_arguments, void>JIT::compileSetupFrame(const Op& bytecode, CallLinkInfo* info){    OpcodeID opcodeID = Op::opcodeID;    int thisValue = bytecode.m_thisValue.offset();    int arguments = bytecode.m_arguments.offset();    int firstFreeRegister = bytecode.m_firstFree.offset();    int firstVarArgOffset = bytecode.m_firstVarArg;    emitLoad(arguments, regT1, regT0);    Z_JITOperation_EJZZ sizeOperation;    if (Op::opcodeID == op_tail_call_forward_arguments)        sizeOperation = operationSizeFrameForForwardArguments;    else        sizeOperation = operationSizeFrameForVarargs;    callOperation(sizeOperation, JSValueRegs(regT1, regT0), -firstFreeRegister, firstVarArgOffset);    move(TrustedImm32(-firstFreeRegister), regT1);    emitSetVarargsFrame(*this, returnValueGPR, false, regT1, regT1);    addPtr(TrustedImm32(-(sizeof(CallerFrameAndPC) + WTF::roundUpToMultipleOf(stackAlignmentBytes(), 6 * sizeof(void*)))), regT1, stackPointerRegister);    emitLoad(arguments, regT2, regT4);    F_JITOperation_EFJZZ setupOperation;    if (opcodeID == op_tail_call_forward_arguments)        setupOperation = operationSetupForwardArgumentsFrame;    else        setupOperation = operationSetupVarargsFrame;    callOperation(setupOperation, regT1, JSValueRegs(regT2, regT4), firstVarArgOffset, regT0);    move(returnValueGPR, regT1);    // Profile the argument count.    load32(Address(regT1, CallFrameSlot::argumentCount * static_cast<int>(sizeof(Register)) + PayloadOffset), regT2);    load32(info->addressOfMaxNumArguments(), regT0);    Jump notBiggest = branch32(Above, regT0, regT2);    store32(regT2, info->addressOfMaxNumArguments());    notBiggest.link(this);        // Initialize 'this'.    emitLoad(thisValue, regT2, regT0);    store32(regT0, Address(regT1, PayloadOffset + (CallFrame::thisArgumentOffset() * static_cast<int>(sizeof(Register)))));    store32(regT2, Address(regT1, TagOffset + (CallFrame::thisArgumentOffset() * static_cast<int>(sizeof(Register)))));        addPtr(TrustedImm32(sizeof(CallerFrameAndPC)), regT1, stackPointerRegister);}
开发者ID:wolfviking0,项目名称:webcl-webkit,代码行数:45,


示例22: blake2b_long

/* MMXVI Team - Begin Code */int blake2b_long(void *pout, size_t outlen, const void *in, size_t inlen) {    uint8_t *out = (uint8_t *)pout;    blake2b_state blake_state;    uint8_t outlen_bytes[sizeof(uint32_t)] = {0};    int ret = -1;    if (outlen > UINT32_MAX) {        goto fail;    }    /* Ensure little-endian byte order! */    store32(outlen_bytes, (uint32_t)outlen);#define TRY(statement)                                                         /    do {                                                                       /        ret = statement;                                                       /        if (ret < 0) {                                                         /            goto fail;                                                         /        }                                                                      /    } while ((void)0, 0)    if (outlen <= BLAKE2B_OUTBYTES) {        TRY(blake2b_init(&blake_state, outlen));        TRY(blake2b_update(&blake_state, outlen_bytes, sizeof(outlen_bytes)));        TRY(blake2b_update(&blake_state, in, inlen));        TRY(blake2b_final(&blake_state, out, outlen));    } else {        uint32_t toproduce;        uint8_t out_buffer[BLAKE2B_OUTBYTES];        uint8_t in_buffer[BLAKE2B_OUTBYTES];        TRY(blake2b_init(&blake_state, BLAKE2B_OUTBYTES));        TRY(blake2b_update(&blake_state, outlen_bytes, sizeof(outlen_bytes)));        TRY(blake2b_update(&blake_state, in, inlen));        TRY(blake2b_final(&blake_state, out_buffer, BLAKE2B_OUTBYTES));        memcpy(out, out_buffer, BLAKE2B_OUTBYTES / 2);        out += BLAKE2B_OUTBYTES / 2;        toproduce = (uint32_t)outlen - BLAKE2B_OUTBYTES / 2;        while (toproduce > BLAKE2B_OUTBYTES) {            memcpy(in_buffer, out_buffer, BLAKE2B_OUTBYTES);            TRY(blake2b(out_buffer, BLAKE2B_OUTBYTES, in_buffer,                        BLAKE2B_OUTBYTES, NULL, 0));            memcpy(out, out_buffer, BLAKE2B_OUTBYTES / 2);            out += BLAKE2B_OUTBYTES / 2;            toproduce -= BLAKE2B_OUTBYTES / 2;        }        memcpy(in_buffer, out_buffer, BLAKE2B_OUTBYTES);        TRY(blake2b(out_buffer, toproduce, in_buffer, BLAKE2B_OUTBYTES, NULL,                    0));        memcpy(out, out_buffer, toproduce);    }fail:    burn(&blake_state, sizeof(blake_state));    return ret;#undef TRY}
开发者ID:alexmihajlovic,项目名称:MMXVI,代码行数:58,


示例23: stubCall

void JIT::emit_op_load_varargs(Instruction* currentInstruction){    int argCountDst = currentInstruction[1].u.operand;    int argsOffset = currentInstruction[2].u.operand;    JITStubCall stubCall(this, cti_op_load_varargs);    stubCall.addArgument(Imm32(argsOffset));    stubCall.call();    // Stores a naked int32 in the register file.    store32(returnValueRegister, Address(callFrameRegister, argCountDst * sizeof(Register)));}
开发者ID:youtube,项目名称:h5vcc_hh,代码行数:11,


示例24: blake2b_init

int blake2b_init( blake2b_state *S, size_t outlen ){  blake2b_param P[1];  if ( ( !outlen ) || ( outlen > BLAKE2B_OUTBYTES ) ) return -1;  P->digest_length = (uint8_t)outlen;  P->key_length    = 0;  P->fanout        = 1;  P->depth         = 1;  store32( &P->leaf_length, 0 );  store32( &P->node_offset, 0 );  store32( &P->xof_length, 0 );  P->node_depth    = 0;  P->inner_length  = 0;  memset( P->reserved, 0, sizeof( P->reserved ) );  memset( P->salt,     0, sizeof( P->salt ) );  memset( P->personal, 0, sizeof( P->personal ) );  return blake2b_init_param( S, P );}
开发者ID:Abogical,项目名称:borg,代码行数:20,


示例25: blake2s_InitPersonal

int blake2s_InitPersonal( blake2s_state *S, size_t outlen, const void *personal, size_t personal_len){  blake2s_param P[1];  if ( ( !outlen ) || ( outlen > BLAKE2S_OUTBYTES ) ) return -1;  if ( ( !personal ) || ( personal_len != BLAKE2S_PERSONALBYTES ) ) return -1;  P->digest_length = (uint8_t)outlen;  P->key_length    = 0;  P->fanout        = 1;  P->depth         = 1;  store32( &P->leaf_length, 0 );  store32( &P->node_offset, 0 );  store16( &P->xof_length, 0 );  P->node_depth    = 0;  P->inner_length  = 0;  /* memset(P->reserved, 0, sizeof(P->reserved) ); */  memset( P->salt,     0, sizeof( P->salt ) );  memcpy( P->personal, personal, BLAKE2S_PERSONALBYTES );  return blake2s_init_param( S, P );}
开发者ID:wo01,项目名称:trezor-crypto,代码行数:21,



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


C++ store64函数代码示例
C++ store函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。