protected StandardEncryptionVerifier(CipherAlgorithm cipherAlgorithm, HashAlgorithm hashAlgorithm, int keyBits, int blockSize, ChainingMode chainingMode) { setCipherAlgorithm(cipherAlgorithm); setHashAlgorithm(hashAlgorithm); setChainingMode(chainingMode); setSpinCount(SPIN_COUNT); verifierHashSize = hashAlgorithm.hashSize; }
protected StandardEncryptionVerifier(LittleEndianInput is, StandardEncryptionHeader header) { int saltSize = is.readInt(); if (saltSize!=16) { throw new RuntimeException("Salt size != 16 !?"); } byte salt[] = new byte[16]; is.readFully(salt); setSalt(salt); byte encryptedVerifier[] = new byte[16]; is.readFully(encryptedVerifier); setEncryptedVerifier(encryptedVerifier); verifierHashSize = is.readInt(); byte encryptedVerifierHash[] = new byte[header.getCipherAlgorithm().encryptedVerifierHashLength]; is.readFully(encryptedVerifierHash); setEncryptedVerifierHash(encryptedVerifierHash); setSpinCount(SPIN_COUNT); setCipherAlgorithm(header.getCipherAlgorithm()); setChainingMode(header.getChainingMode()); setEncryptedKey(null); setHashAlgorithm(header.getHashAlgorithm()); }
protected StandardEncryptionVerifier(CipherAlgorithm cipherAlgorithm, HashAlgorithm hashAlgorithm, int keyBits, int blockSize, ChainingMode chainingMode) { setCipherAlgorithm(cipherAlgorithm); setHashAlgorithm(hashAlgorithm); setChainingMode(chainingMode); setSpinCount(SPIN_COUNT); verifierHashSize = hashAlgorithm.hashSize; }
protected StandardEncryptionVerifier(LittleEndianInput is, StandardEncryptionHeader header) { int saltSize = is.readInt(); if (saltSize!=16) { throw new RuntimeException("Salt size != 16 !?"); } byte salt[] = new byte[16]; is.readFully(salt); setSalt(salt); byte encryptedVerifier[] = new byte[16]; is.readFully(encryptedVerifier); setEncryptedVerifier(encryptedVerifier); verifierHashSize = is.readInt(); byte encryptedVerifierHash[] = new byte[header.getCipherAlgorithm().encryptedVerifierHashLength]; is.readFully(encryptedVerifierHash); setEncryptedVerifierHash(encryptedVerifierHash); setSpinCount(SPIN_COUNT); setCipherAlgorithm(header.getCipherAlgorithm()); setChainingMode(header.getChainingMode()); setEncryptedKey(null); setHashAlgorithm(header.getHashAlgorithm()); }