当前位置: 首页>>代码示例>>Java>>正文


Java MessageDigest.getInstance方法代码示例

本文整理汇总了Java中javacard.security.MessageDigest.getInstance方法的典型用法代码示例。如果您正苦于以下问题:Java MessageDigest.getInstance方法的具体用法?Java MessageDigest.getInstance怎么用?Java MessageDigest.getInstance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javacard.security.MessageDigest的用法示例。


在下文中一共展示了MessageDigest.getInstance方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: UsmileKeyAgreement

import javacard.security.MessageDigest; //导入方法依赖的package包/类
/**
 * Constructors
 * 
 * <p>
 * Performs necessary initialization and memory allocations
 * 
 * @param initBuffer
 *            initialization byte array buffer, contains identity':'password
 * @param length Length of ID and password
 * 
 */
public UsmileKeyAgreement(byte[] initBuffer, short length) {

	tempBuffer = initBuffer;

	/**
	 * init messageDigest
	 */
	mUsedMsgDigest = MessageDigest.getInstance(MessageDigest.ALG_SHA_256,
			false);
	
	// Initialize all key objects
	initializeKeys();
	
	// Compute all values which will not change during key agreement and verification phase
	staticComputations(tempBuffer, (short)0, length);
}
 
开发者ID:mobilesec,项目名称:secure-channel-ec-srp-applet,代码行数:28,代码来源:UsmileKeyAgreement.java

示例2: FIDOCCImplementation

import javacard.security.MessageDigest; //导入方法依赖的package包/类
public FIDOCCImplementation() {
	
	random = RandomData.getInstance(RandomData.ALG_SECURE_RANDOM);
	
    scratch = JCSystem.makeTransientByteArray((short)128, JCSystem.CLEAR_ON_DESELECT);
    //seed = new byte[64];
    
    keyPair = new KeyPair(
        (ECPublicKey)KeyBuilder.buildKey(KeyBuilder.TYPE_EC_FP_PUBLIC, KeyBuilder.LENGTH_EC_FP_256, false),
        (ECPrivateKey)KeyBuilder.buildKey(KeyBuilder.TYPE_EC_FP_PRIVATE, KeyBuilder.LENGTH_EC_FP_256, false));
    Secp256r1.setCommonCurveParameters((ECKey)keyPair.getPrivate());
    Secp256r1.setCommonCurveParameters((ECKey)keyPair.getPublic());
            
    // Initialize the unique seed for DRNG function 
    //random.generateData(seed, (short)0, (short)64);
    
    // Initialize the unique seed for DRNG function       
    drngSeed1 = (AESKey)KeyBuilderX.buildKey(KeyBuilderX.TYPE_AES_STATIC, KeyBuilder.LENGTH_AES_256, false);
    drngSeed2 = (AESKey)KeyBuilderX.buildKey(KeyBuilderX.TYPE_AES_STATIC, KeyBuilder.LENGTH_AES_256, false);
    random.generateData(scratch, (short)0, (short)32);
    drngSeed1.setKey(scratch, (short)0);
    random.generateData(scratch, (short)0, (short)32);
    drngSeed2.setKey(scratch, (short)0);
 
    sha256 = MessageDigest.getInstance(MessageDigest.ALG_SHA_256, false);
            
    // Initialize the unique keys for MAC function
    macKey1 = (AESKey)KeyBuilderX.buildKey(KeyBuilderX.TYPE_AES_STATIC, KeyBuilder.LENGTH_AES_128, false);
    macKey2 = (AESKey)KeyBuilderX.buildKey(KeyBuilderX.TYPE_AES_STATIC, KeyBuilder.LENGTH_AES_128, false);
    random.generateData(scratch, (short)0, (short)16);
    macKey1.setKey(scratch, (short)0);
    random.generateData(scratch, (short)0, (short)16);
    macKey2.setKey(scratch, (short)0);
    
    // Initialize ecMultiplier 
    ecMultiplyHelper = KeyAgreementX.getInstance(KeyAgreementX.ALG_EC_SVDP_DH_PLAIN_XY, false);
}
 
开发者ID:tsenger,项目名称:CCU2F,代码行数:38,代码来源:FIDOCCImplementation.java

示例3: HMACgenerator

import javacard.security.MessageDigest; //导入方法依赖的package包/类
/**
 * 
 * @param key Shared secret to use when generating HMAC
 * @param keyLen Length of shared secret in bytes
 * @param digits Numbers of digits to generate
 */
public HMACgenerator(byte key[], short keyLen, short digits){
    
    //Set counter to 0
    counter = new byte[counterSize];
    Util.arrayFillNonAtomic(counter, (short) 0, counterSize, (byte) 0);
    
    k_opad = new byte[64];
    k_ipad = new byte[64];
    shaBuffer = new byte[84];
    outBuffer = new byte[20];
    this.digits = digits;
    asciiBuffer = new byte[10];
    outputCodeDigits = new byte[digits];
    for (short i = (short) 0; i < (short) 64; i++){
        if(i < keyLen){
            k_opad[i] = (byte) (key[i] ^ 0x5c);
            k_ipad[i] = (byte) (key[i] ^ 0x36);
        } else {
            k_opad[i] = (byte) (0x5c);
            k_ipad[i] = (byte) (0x36);
        }
    }
    digest = MessageDigest.getInstance(MessageDigest.ALG_SHA, true);
    
}
 
开发者ID:petrs,项目名称:hotp_via_ndef,代码行数:32,代码来源:HMACgenerator.java

示例4: initialize

import javacard.security.MessageDigest; //导入方法依赖的package包/类
public void initialize(short MAX_POINT_SIZE, short MAX_COORD_SIZE, short MAX_BIGNAT_SIZE, short MULT_RSA_ENGINE_MAX_LENGTH_BITS, Bignat_Helper bnh) {
    // Allocate long-term helper values
    locker = new ObjectLocker((short) (NUM_HELPER_ARRAYS + NUM_SHARED_HELPER_OBJECTS));
    //locker.setLockingActive(false); // if required, locking can be disabled
    memAlloc = new ObjectAllocator();
    memAlloc.setAllAllocatorsRAM();
    //if required, memory for helper objects and arrays can be in persistent memory to save RAM (or some tradeoff)       
    //ObjectAllocator.setAllAllocatorsEEPROM();  //ObjectAllocator.setAllocatorsTradeoff();
    

    // Multiplication speedup engines and arrays used by Bignat.mult_RSATrick()
    helper_BN_array1 = memAlloc.allocateByteArray((short) (MULT_RSA_ENGINE_MAX_LENGTH_BITS / 8), memAlloc.getAllocatorType(ObjectAllocator.BNH_helper_BN_array1));
    locker.registerLock(helper_BN_array1);
    helper_BN_array2 = memAlloc.allocateByteArray((short) (MULT_RSA_ENGINE_MAX_LENGTH_BITS / 8), memAlloc.getAllocatorType(ObjectAllocator.BNH_helper_BN_array2));
    locker.registerLock(helper_BN_array2);
    helper_uncompressed_point_arr1 = memAlloc.allocateByteArray((short) (MAX_POINT_SIZE + 1), memAlloc.getAllocatorType(ObjectAllocator.ECPH_uncompressed_point_arr1));
    locker.registerLock(helper_uncompressed_point_arr1);
    hashEngine = MessageDigest.getInstance(MessageDigest.ALG_SHA_256, false);
    helper_hashArray = memAlloc.allocateByteArray(hashEngine.getLength(), memAlloc.getAllocatorType(ObjectAllocator.ECPH_hashArray));
    locker.registerLock(helper_hashArray);
    //locker.registerLock(hashEngine); // register hash engine to slightly speedup search for locked objects (hash engine used less frequently)
    
    
    helper_BN_A = new Bignat(MAX_BIGNAT_SIZE, memAlloc.getAllocatorType(ObjectAllocator.BNH_helper_BN_A), bnh);
    helper_BN_B = new Bignat(MAX_BIGNAT_SIZE, memAlloc.getAllocatorType(ObjectAllocator.BNH_helper_BN_B), bnh);
    helper_BN_C = new Bignat(MAX_BIGNAT_SIZE, memAlloc.getAllocatorType(ObjectAllocator.BNH_helper_BN_C), bnh);
    helper_BN_D = new Bignat(MAX_BIGNAT_SIZE, memAlloc.getAllocatorType(ObjectAllocator.BNH_helper_BN_D), bnh);
    helper_BN_E = new Bignat(MAX_BIGNAT_SIZE, memAlloc.getAllocatorType(ObjectAllocator.BNH_helper_BN_E), bnh);
    helper_BN_F = new Bignat((short) (MAX_BIGNAT_SIZE + 2), memAlloc.getAllocatorType(ObjectAllocator.BNH_helper_BN_F), bnh); // +2 is to correct for infrequent RSA result with two or more leading zeroes 
    
    helperEC_BN_A = new Bignat(MAX_POINT_SIZE, memAlloc.getAllocatorType(ObjectAllocator.ECPH_helperEC_BN_A), bnh);
    helperEC_BN_B = new Bignat(MAX_COORD_SIZE, memAlloc.getAllocatorType(ObjectAllocator.ECPH_helperEC_BN_B), bnh);
    helperEC_BN_C = new Bignat(MAX_COORD_SIZE, memAlloc.getAllocatorType(ObjectAllocator.ECPH_helperEC_BN_C), bnh);
    helperEC_BN_D = new Bignat(MAX_COORD_SIZE, memAlloc.getAllocatorType(ObjectAllocator.ECPH_helperEC_BN_D), bnh);
    helperEC_BN_E = new Bignat(MAX_COORD_SIZE, memAlloc.getAllocatorType(ObjectAllocator.ECPH_helperEC_BN_E), bnh);
    helperEC_BN_F = new Bignat(MAX_COORD_SIZE, memAlloc.getAllocatorType(ObjectAllocator.ECPH_helperEC_BN_F), bnh);
    
    
}
 
开发者ID:OpenCryptoProject,项目名称:JCMathLib,代码行数:40,代码来源:ResourceManager.java

示例5: initialize

import javacard.security.MessageDigest; //导入方法依赖的package包/类
public void initialize(short MAX_POINT_SIZE, short MAX_COORD_SIZE, short MAX_BIGNAT_SIZE, short MULT_RSA_ENGINE_MAX_LENGTH_BITS, Bignat_Helper bnh) {
    // Allocate long-term helper values
    locker = new ObjectLocker((short) (NUM_HELPER_ARRAYS + NUM_SHARED_HELPER_OBJECTS));
    //locker.setLockingActive(false); // if required, locking can be disabled
    memAlloc = new ObjectAllocator();
    memAlloc.setAllAllocatorsRAM();
    //if required, memory for helper objects and arrays can be in persistent memory to save RAM (or some tradeoff)       
    //ObjectAllocator.setAllAllocatorsEEPROM();  //ObjectAllocator.setAllocatorsTradeoff();
    
    
    // Multiplication speedup engines and arrays used by Bignat.mult_RSATrick()
    helper_BN_array1 = memAlloc.allocateByteArray((short) (MULT_RSA_ENGINE_MAX_LENGTH_BITS / 8), memAlloc.getAllocatorType(ObjectAllocator.BNH_helper_BN_array1));
    locker.registerLock(helper_BN_array1);
    helper_BN_array2 = memAlloc.allocateByteArray((short) (MULT_RSA_ENGINE_MAX_LENGTH_BITS / 8), memAlloc.getAllocatorType(ObjectAllocator.BNH_helper_BN_array2));
    locker.registerLock(helper_BN_array2);
    helper_uncompressed_point_arr1 = memAlloc.allocateByteArray((short) (MAX_POINT_SIZE + 1), memAlloc.getAllocatorType(ObjectAllocator.ECPH_uncompressed_point_arr1));
    locker.registerLock(helper_uncompressed_point_arr1);
    hashEngine = MessageDigest.getInstance(MessageDigest.ALG_SHA_256, false);
    helper_hashArray = memAlloc.allocateByteArray(hashEngine.getLength(), memAlloc.getAllocatorType(ObjectAllocator.ECPH_hashArray));
    locker.registerLock(helper_hashArray);
    //locker.registerLock(hashEngine); // register hash engine to slightly speedup search for locked objects (hash engine used less frequently)
    
    
    helper_BN_A = new Bignat(MAX_BIGNAT_SIZE, memAlloc.getAllocatorType(ObjectAllocator.BNH_helper_BN_A), bnh);
    helper_BN_B = new Bignat(MAX_BIGNAT_SIZE, memAlloc.getAllocatorType(ObjectAllocator.BNH_helper_BN_B), bnh);
    helper_BN_C = new Bignat(MAX_BIGNAT_SIZE, memAlloc.getAllocatorType(ObjectAllocator.BNH_helper_BN_C), bnh);
    helper_BN_D = new Bignat(MAX_BIGNAT_SIZE, memAlloc.getAllocatorType(ObjectAllocator.BNH_helper_BN_D), bnh);
    helper_BN_E = new Bignat(MAX_BIGNAT_SIZE, memAlloc.getAllocatorType(ObjectAllocator.BNH_helper_BN_E), bnh);
    helper_BN_F = new Bignat((short) (MAX_BIGNAT_SIZE + 2), memAlloc.getAllocatorType(ObjectAllocator.BNH_helper_BN_F), bnh); // +2 is to correct for infrequent RSA result with two or more leading zeroes 
    
    helperEC_BN_A = new Bignat(MAX_POINT_SIZE, memAlloc.getAllocatorType(ObjectAllocator.ECPH_helperEC_BN_A), bnh);
    helperEC_BN_B = new Bignat(MAX_COORD_SIZE, memAlloc.getAllocatorType(ObjectAllocator.ECPH_helperEC_BN_B), bnh);
    helperEC_BN_C = new Bignat(MAX_COORD_SIZE, memAlloc.getAllocatorType(ObjectAllocator.ECPH_helperEC_BN_C), bnh);
    helperEC_BN_D = new Bignat(MAX_COORD_SIZE, memAlloc.getAllocatorType(ObjectAllocator.ECPH_helperEC_BN_D), bnh);
    helperEC_BN_E = new Bignat(MAX_COORD_SIZE, memAlloc.getAllocatorType(ObjectAllocator.ECPH_helperEC_BN_E), bnh);
    helperEC_BN_F = new Bignat(MAX_COORD_SIZE, memAlloc.getAllocatorType(ObjectAllocator.ECPH_helperEC_BN_F), bnh);
    
    
}
 
开发者ID:OpenCryptoProject,项目名称:Myst,代码行数:40,代码来源:jcmathlib.java

示例6: setKey

import javacard.security.MessageDigest; //导入方法依赖的package包/类
public void setKey(byte[] buf, short offs, byte type, short len) {
	if((type & HMAC_MASK) != HMAC_SHA1 && (type & HMAC_MASK) != HMAC_SHA256) {
		ISOException.throwIt(ISO7816.SW_DATA_INVALID);
	}
	if((type & OATH_MASK) != HOTP_TYPE && (type & OATH_MASK) != TOTP_TYPE) {
		ISOException.throwIt(ISO7816.SW_DATA_INVALID);
	}
	if(len > hmac_buf_size) {
		ISOException.throwIt(ISO7816.SW_WRONG_DATA);
	}
	if((type & HMAC_MASK) == HMAC_SHA1) {
		if(sha == null) {
			sha = MessageDigest.getInstance(MessageDigest.ALG_SHA, false);
		}
		digest = sha;
	} else if((type & HMAC_MASK) == HMAC_SHA256) {
		if(sha256 == null) {
			sha256 = MessageDigest.getInstance(MessageDigest.ALG_SHA_256, false);
		}
		digest = sha256;
	}

	this.type = type;
	this.counter = 0;
	Util.arrayFillNonAtomic(inner, _0, hmac_buf_size, (byte) 0x36);
	Util.arrayFillNonAtomic(outer, _0, hmac_buf_size, (byte) 0x5c);
       for (short i = 0; i < len; i++, offs++) {
           inner[i] = (byte) (buf[offs] ^ 0x36);
           outer[i] = (byte) (buf[offs] ^ 0x5c);
       }
}
 
开发者ID:JavaCardOS,项目名称:Oath-Applet,代码行数:32,代码来源:OathObj.java

示例7: SecureMessaging

import javacard.security.MessageDigest; //导入方法依赖的package包/类
/**
 * Constructor
 * 
 * @param _tempBuffer a reference for Transient byte array buffer that is used for intermediate operations 
 */
public SecureMessaging(byte[] _tempBuffer) {
	tempBuffer = _tempBuffer;

	mEncryptionKey = (AESKey) KeyBuilder.buildKey(
			KeyBuilder.TYPE_AES_TRANSIENT_DESELECT,
			KeyBuilder.LENGTH_AES_256, false);

	mMackey_1 = (AESKey) KeyBuilder.buildKey(
			KeyBuilder.TYPE_AES_TRANSIENT_DESELECT,
			KeyBuilder.LENGTH_AES_128, false);

	mMackey_2 = (AESKey) KeyBuilder.buildKey(
			KeyBuilder.TYPE_AES_TRANSIENT_DESELECT,
			KeyBuilder.LENGTH_AES_128, false);

	// iv = new byte[(short)0x10];

	mAESCipher = Cipher.getInstance(Cipher.ALG_AES_BLOCK_128_CBC_NOPAD,
			false);

	msgDigest_SHA256 = MessageDigest.getInstance(MessageDigest.ALG_SHA_256,
			false);

	mSignature = Signature.getInstance(Signature.ALG_AES_MAC_128_NOPAD,
			false);

}
 
开发者ID:mobilesec,项目名称:secure-channel-ec-srp-applet,代码行数:33,代码来源:SecureMessaging.java

示例8: init

import javacard.security.MessageDigest; //导入方法依赖的package包/类
public static void init() {
    h = JCSystem.makeTransientShortArray((short)2, JCSystem.CLEAR_ON_DESELECT);
    ctx = JCSystem.makeTransientByteArray(TX_CONTEXT_SIZE, JCSystem.CLEAR_ON_DESELECT);
    digestFull = MessageDigest.getInstance(MessageDigest.ALG_SHA_256, false);
}
 
开发者ID:Toporin,项目名称:SatoChipApplet,代码行数:6,代码来源:Transaction.java

示例9: init

import javacard.security.MessageDigest; //导入方法依赖的package包/类
public static void init(byte[] tmp){
	sha160= MessageDigest.getInstance(MessageDigest.ALG_SHA, false);
	data= tmp;
}
 
开发者ID:Toporin,项目名称:SatoChipApplet,代码行数:5,代码来源:HmacSha160.java

示例10: STPayP

import javacard.security.MessageDigest; //导入方法依赖的package包/类
/**
 * Creates Java Card applet object.
 * 
 * @param array
 *            the byte array containing the AID bytes
 * @param offset
 *            the start of AID bytes in array
 * @param length
 *            the length of the AID bytes in array
 */
private STPayP(byte[] array, short offset, byte length) {
    /*** Start allocate memory when applet is instantiated. ***/
    this.records = new Records(Constants.MAX_SFI_RECORDS);

    this.persistentByteBuffer = new byte[Constants.SIZE_PBB];
    this.personalizedPersistentByteBuffer = new byte[Constants.SIZE_PPBB];

    this.transientByteBuffer = JCSystem.makeTransientByteArray(Constants.SIZE_TBB, JCSystem.CLEAR_ON_DESELECT);

    // NOTE: 'keyEncryption' parameter not used.
    this.mkAC = (DESKey) KeyBuilder.buildKey(KeyBuilder.TYPE_DES, KeyBuilder.LENGTH_DES3_2KEY, false);
    this.mkIDN = (DESKey) KeyBuilder.buildKey(KeyBuilder.TYPE_DES, KeyBuilder.LENGTH_DES3_2KEY, false);
    /*** End allocate memory when applet is instantiated. ***/

    /*** Allocate memory when personalized. ***/
    this.selectResponse = null;
    this.cardLayoutDescriptionPart1 = null;
    this.cardLayoutDescriptionPart2 = null;
    this.cardLayoutDescriptionPart3 = null;

    this.gpState = GPSystem.APPLICATION_SELECTABLE;

    /*** Start initialize variables specific to MPP Remote-SE Lite. ***/
    this.cardProfile = new CardProfile();

    // Build Card Profile.
    // NOTE: This is a kludge to retrieve AID. This would not work with real Java Card.
    byte aidLength = JCSystem.getAID().getBytes(this.transientByteBuffer, (short) 0);
    this.cardProfile.setAid(this.transientByteBuffer, (short) 0, aidLength);

    this.cardProfileHash = new byte[32];

    // Initialize and seed random.
    this.random = RandomData.getInstance(RandomData.ALG_PSEUDO_RANDOM);
    byte[] seed = DataUtil.stringToCompressedByteArray(String.valueOf(Calendar.getInstance().getTimeInMillis()));
    this.random.setSeed(seed, (short) 0, (short) seed.length);

    // Initialize Mobile Key.
    this.dataEncryption = new DataEncryption();
    if (!this.dataEncryption.initMobileKey()) {
        System.out.println("Error: M_Key not initialized.");
    }

    this.sha256 = MessageDigest.getInstance(MessageDigest.ALG_SHA_256, false);
    /*** End initialize variables specific to MPP Remote-SE Lite. ***/

    // Register instance AID.
    register(array, (short) (offset + (byte) 1), array[offset]);
}
 
开发者ID:SimplyTapp,项目名称:CardExamples,代码行数:60,代码来源:STPayP.java

示例11: MPCCryptoOps

import javacard.security.MessageDigest; //导入方法依赖的package包/类
public MPCCryptoOps(ECConfig eccfg) {
    temp_sign_counter = new Bignat((short) 2, JCSystem.MEMORY_TYPE_TRANSIENT_RESET, eccfg.bnh);
    tmp_arr = JCSystem.makeTransientByteArray(Consts.SHARE_DOUBLE_SIZE_CARRY, JCSystem.MEMORY_TYPE_TRANSIENT_RESET);

    placeholder = ECPointBuilder.createPoint(SecP256r1.KEY_LENGTH);
    placeholder.initializeECPoint_SecP256r1();

    c2_EC = ECPointBuilder.createPoint(SecP256r1.KEY_LENGTH);
    c2_EC.initializeECPoint_SecP256r1();

    GenPoint = ECPointBuilder.createPoint(SecP256r1.KEY_LENGTH);
    GenPoint.setW(SecP256r1.G, (short) 0, (short) SecP256r1.G.length);

    plaintext_EC = ECPointBuilder.createPoint(SecP256r1.KEY_LENGTH);
    plaintext_EC.initializeECPoint_SecP256r1();

    tmp_EC = ECPointBuilder.createPoint(SecP256r1.KEY_LENGTH);
    tmp_EC.initializeECPoint_SecP256r1();
    
    randomData = RandomData.getInstance(RandomData.ALG_SECURE_RANDOM);
    
    y_Bn = JCSystem.makeTransientByteArray(Consts.SHARE_BASIC_SIZE, JCSystem.MEMORY_TYPE_TRANSIENT_RESET);
    
    encResult = JCSystem.makeTransientByteArray(Consts.SHARE_DOUBLE_SIZE_CARRY, JCSystem.MEMORY_TYPE_TRANSIENT_RESET);
    
    e_arr = JCSystem.makeTransientByteArray(Consts.SHARE_BASIC_SIZE, JCSystem.MEMORY_TYPE_TRANSIENT_RESET);
    
    md = MessageDigest.getInstance(MessageDigest.ALG_SHA_256, false);
    
    tmp_k_n = JCSystem.makeTransientByteArray(Consts.SHARE_BASIC_SIZE, JCSystem.MEMORY_TYPE_TRANSIENT_RESET);
    prf_result = JCSystem.makeTransientByteArray(Consts.SHARE_BASIC_SIZE, JCSystem.MEMORY_TYPE_TRANSIENT_RESET);
    
    modulo_Bn = new Bignat(Consts.SHARE_BASIC_SIZE, JCSystem.MEMORY_TYPE_TRANSIENT_RESET, eccfg.bnh);
    modulo_Bn.from_byte_array((short) SecP256r1.r.length, (short) 0, SecP256r1.r, (short) 0);
    
    aBn = new Bignat(Consts.SHARE_DOUBLE_SIZE, JCSystem.MEMORY_TYPE_TRANSIENT_RESET, eccfg.bnh);
    
    aBn.set_from_byte_array((short) (aBn.length() - (short) r_for_BigInteger.length), r_for_BigInteger, (short) 0, (short) r_for_BigInteger.length);
    
    e_Bn = new Bignat(Consts.SHARE_BASIC_SIZE, JCSystem.MEMORY_TYPE_TRANSIENT_RESET, eccfg.bnh);
    s_Bn = new Bignat(Consts.SHARE_BASIC_SIZE, JCSystem.MEMORY_TYPE_TRANSIENT_RESET, eccfg.bnh);
    xi_Bn = new Bignat(Consts.SHARE_BASIC_SIZE, JCSystem.MEMORY_TYPE_TRANSIENT_RESET, eccfg.bnh);
    xe_Bn = new Bignat(Consts.SHARE_DOUBLE_SIZE, JCSystem.MEMORY_TYPE_TRANSIENT_RESET, eccfg.bnh);
    
    resBn1 = new Bignat((short) ((short) (eccfg.bnh.MULT_RSA_ENGINE_MAX_LENGTH_BITS / 8) + 1), JCSystem.MEMORY_TYPE_TRANSIENT_RESET, eccfg.bnh);
    resBn2 = new Bignat(Consts.SHARE_BASIC_SIZE, JCSystem.MEMORY_TYPE_TRANSIENT_RESET, eccfg.bnh);
    resBn3 = new Bignat(Consts.SHARE_DOUBLE_SIZE, JCSystem.MEMORY_TYPE_TRANSIENT_RESET, eccfg.bnh);
    
    // AddPoint objects
    four_Bn = new Bignat((short) 32, JCSystem.MEMORY_TYPE_TRANSIENT_RESET, eccfg.bnh);
    five_Bn = new Bignat((short) 32, JCSystem.MEMORY_TYPE_TRANSIENT_RESET, eccfg.bnh);
    p_Bn = new Bignat((short) 32, JCSystem.MEMORY_TYPE_TRANSIENT_RESET, eccfg.bnh);
    
    md = MessageDigest.getInstance(MessageDigest.ALG_SHA_256, false);
    
    m_shortByteArray = JCSystem.makeTransientByteArray((short) 2, JCSystem.MEMORY_TYPE_TRANSIENT_DESELECT);
}
 
开发者ID:OpenCryptoProject,项目名称:Myst,代码行数:58,代码来源:MPCCryptoOps.java


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