MCPcopy Create free account
hub / github.com/codenameone/CodenameOne / blockSizeFor

Method blockSizeFor

CodenameOne/src/com/codename1/security/Hmac.java:91–100  ·  view source on GitHub ↗
(String algorithm)

Source from the content-addressed store, hash-verified

89 }
90
91 private static int blockSizeFor(String algorithm) {
92 String a = MessageDigestImpl.normalise(algorithm);
93 if ("MD5".equals(a) || "SHA1".equals(a) || "SHA224".equals(a) || "SHA256".equals(a)) {
94 return 64;
95 }
96 if ("SHA384".equals(a) || "SHA512".equals(a)) {
97 return 128;
98 }
99 throw new CryptoException("unsupported HMAC algorithm: " + algorithm);
100 }
101
102 /// Resets the running HMAC so the instance can be reused with the same key.
103 public void reset() {

Callers 1

createMethod · 0.95

Calls 2

normaliseMethod · 0.95
equalsMethod · 0.65

Tested by

no test coverage detected