public int getMaxKeyLength() { return getMinKeyLength(); }
public int getMaxKeyLength() { return getMinKeyLength(); }
public int getMaxKeyLength() { return getMinKeyLength(); }
public byte[] extendShortKey(byte[] shortKey, OctetString password, byte[] engineID, AuthenticationProtocol authProtocol) { // we have to extend the key, currently only the AES draft // defines this algorithm, so this may have to be changed for other // privacy protocols byte[] extKey = new byte[getMinKeyLength()]; int length = shortKey.length; System.arraycopy(shortKey, 0, extKey, 0, length); while (length < extKey.length) { byte[] hash = authProtocol.hash(extKey, 0, length); if (hash == null) { return null; } int bytesToCopy = extKey.length - length; if (bytesToCopy > authProtocol.getDigestLength()) { bytesToCopy = authProtocol.getDigestLength(); } System.arraycopy(hash, 0, extKey, length, bytesToCopy); length += bytesToCopy; } return extKey; }
public byte[] extendShortKey(byte[] shortKey, OctetString password, byte[] engineID, AuthenticationProtocol authProtocol) { // we have to extend the key, currently only the AES draft // defines this algorithm, so this may have to be changed for other // privacy protocols byte[] extKey = new byte[getMinKeyLength()]; int length = shortKey.length; System.arraycopy(shortKey, 0, extKey, 0, length); while (length < extKey.length) { byte[] hash = authProtocol.hash(extKey, 0, length); if (hash == null) { return null; } int bytesToCopy = extKey.length - length; if (bytesToCopy > authProtocol.getDigestLength()) { bytesToCopy = authProtocol.getDigestLength(); } System.arraycopy(hash, 0, extKey, length, bytesToCopy); length += bytesToCopy; } return extKey; }
byte[] extKey = new byte[getMinKeyLength()]; int length = shortKey.length; for (int i=0; i<length; i++) {