MacHashFunction(String algorithmName, Key key, String toString) { this.prototype = getMac(algorithmName, key); this.key = checkNotNull(key); this.toString = checkNotNull(toString); this.bits = prototype.getMacLength() * Byte.SIZE; this.supportsClone = supportsClone(prototype); }
MacHashFunction(String algorithmName, Key key, String toString) { this.prototype = getMac(algorithmName, key); this.key = checkNotNull(key); this.toString = checkNotNull(toString); this.bits = prototype.getMacLength() * Byte.SIZE; this.supportsClone = supportsClone(prototype); }
MacHashFunction(String algorithmName, Key key, String toString) { this.prototype = getMac(algorithmName, key); this.key = checkNotNull(key); this.toString = checkNotNull(toString); this.bits = prototype.getMacLength() * Byte.SIZE; this.supportsClone = supportsClone(prototype); }
int hLen = mac.getMacLength();
MacHashFunction(String algorithmName, Key key, String toString) { this.prototype = getMac(algorithmName, key); this.key = checkNotNull(key); this.toString = checkNotNull(toString); this.bits = prototype.getMacLength() * Byte.SIZE; this.supportsClone = supportsClone(prototype); }
/** * @param ikm REQUIRED: The input key material. * @param salt REQUIRED: Random bytes for salt. */ public void init(byte[] ikm, byte[] salt) { byte[] realSalt = salt == null ? EMPTY_ARRAY : (byte[]) salt.clone(); byte[] rawKeyMaterial = EMPTY_ARRAY; try { final Mac e = Mac.getInstance(this.algorithm); if (realSalt.length == 0) { realSalt = new byte[e.getMacLength()]; Arrays.fill(realSalt, (byte) 0); } e.init(new SecretKeySpec(realSalt, this.algorithm)); rawKeyMaterial = e.doFinal(ikm); final SecretKeySpec key = new SecretKeySpec(rawKeyMaterial, this.algorithm); Arrays.fill(rawKeyMaterial, (byte) 0); this.unsafeInitWithoutKeyExtraction(key); } catch (final GeneralSecurityException var10) { throw new RuntimeException("Unexpected exception", var10); } finally { Arrays.fill(rawKeyMaterial, (byte) 0); } }
} else { final Mac mac = this.createMac(); if (length > MAX_KEY_SIZE * mac.getMacLength()) { throw new IllegalArgumentException( "Requested keys may not be longer than 255 times the underlying HMAC length.");
@Override public int getMacLength() { return mac.getMacLength(); }
public MacBasedPRF(String macAlgorithm, String provider) { this.macAlgorithm = macAlgorithm; try { mac = Mac.getInstance(macAlgorithm, provider); hLen = mac.getMacLength(); } catch (NoSuchAlgorithmException e) { throw new RuntimeException(e); } catch (NoSuchProviderException e) { throw new RuntimeException(e); } }
MacHashFunction(String algorithmName, Key key, String toString) { this.prototype = getMac(algorithmName, key); this.key = checkNotNull(key); this.toString = checkNotNull(toString); this.bits = prototype.getMacLength() * Byte.SIZE; this.supportsClone = supportsClone(prototype); }
MacHashFunction(String algorithmName, Key key, String toString) { this.prototype = getMac(algorithmName, key); this.key = checkNotNull(key); this.toString = checkNotNull(toString); this.bits = prototype.getMacLength() * Byte.SIZE; this.supportsClone = supportsClone(prototype); }
MacHashFunction(String algorithmName, Key key, String toString) { this.prototype = getMac(algorithmName, key); this.key = checkNotNull(key); this.toString = checkNotNull(toString); this.bits = prototype.getMacLength() * Byte.SIZE; this.supportsClone = supportsClone(prototype); }
MacHashFunction(String algorithmName, Key key, String toString) { this.prototype = getMac(algorithmName, key); this.key = checkNotNull(key); this.toString = checkNotNull(toString); this.bits = prototype.getMacLength() * Byte.SIZE; this.supportsClone = supportsClone(prototype); }
MacHashFunction(String algorithmName, Key key, String toString) { this.prototype = getMac(algorithmName, key); this.key = checkNotNull(key); this.toString = checkNotNull(toString); this.bits = prototype.getMacLength() * Byte.SIZE; this.supportsClone = supportsClone(prototype); }
MacHashFunction(String algorithmName, Key key, String toString) { this.prototype = getMac(algorithmName, key); this.key = checkNotNull(key); this.toString = checkNotNull(toString); this.bits = prototype.getMacLength() * Byte.SIZE; this.supportsClone = supportsClone(prototype); }
MacHashFunction(String algorithmName, Key key, String toString) { this.prototype = getMac(algorithmName, key); this.key = checkNotNull(key); this.toString = checkNotNull(toString); this.bits = prototype.getMacLength() * Byte.SIZE; this.supportsClone = supportsClone(prototype); }
MacHashFunction(String algorithmName, Key key, String toString) { this.prototype = getMac(algorithmName, key); this.key = checkNotNull(key); this.toString = checkNotNull(toString); this.bits = prototype.getMacLength() * Byte.SIZE; this.supportsClone = supportsClone(prototype); }
MacHashFunction(String algorithmName, Key key, String toString) { this.prototype = getMac(algorithmName, key); this.key = checkNotNull(key); this.toString = checkNotNull(toString); this.bits = prototype.getMacLength() * Byte.SIZE; this.supportsClone = supportsClone(prototype); }
MacHashFunction(String algorithmName, Key key, String toString) { this.prototype = getMac(algorithmName, key); this.key = checkNotNull(key); this.toString = checkNotNull(toString); this.bits = prototype.getMacLength() * Byte.SIZE; this.supportsClone = supportsClone(prototype); }
private void prepareBinderValue() { try { HKDFAlgorithm hkdfAlgortihm = AlgorithmResolver.getHKDFAlgorithm(pskBinder.getBinderCipherConfig()); int macLen = Mac.getInstance(hkdfAlgortihm.getMacAlgorithm().getJavaName()).getMacLength(); pskBinder.setBinderEntry(new byte[macLen]); pskBinder.setBinderEntryLength(pskBinder.getBinderEntry().getValue().length); } catch (NoSuchAlgorithmException ex) { LOGGER.warn(ex); } }