MCPcopy Index your code
hub / github.com/SeanDragon/protools / hash

Method hash

security/src/main/java/pro/tools/security/sm/SM3.java:95–107  ·  view source on GitHub ↗
(byte[] source)

Source from the content-addressed store, hash-verified

93 }
94
95 static byte[] hash(byte[] source) throws IOException {
96 byte[] m1 = padding(source);
97 int n = m1.length / (512 / 8);
98 byte[] b;
99 byte[] vi = IV.toByteArray();
100 byte[] vi1 = null;
101 for (int i = 0; i < n; i++) {
102 b = Arrays.copyOfRange(m1, i * 64, (i + 1) * 64);
103 vi1 = CF(vi, b);
104 vi = vi1;
105 }
106 return vi1;
107 }
108
109 private static byte[] CF(byte[] vi, byte[] bi) throws IOException {
110 int a, b, c, d, e, f, g, h;

Callers 1

sm3hashMethod · 0.95

Calls 3

paddingMethod · 0.95
CFMethod · 0.95
toByteArrayMethod · 0.80

Tested by

no test coverage detected