blob: 8194ac0ac226a2e475da6a52fc0fc9bf7b8548ea (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
package eu.siacs.conversations.crypto.sasl;
import com.google.common.hash.HashFunction;
import com.google.common.hash.Hashing;
import org.bouncycastle.crypto.Digest;
import org.bouncycastle.crypto.digests.SHA512Digest;
import org.bouncycastle.crypto.macs.HMac;
import eu.siacs.conversations.entities.Account;
public class ScramSha512 extends ScramMechanism {
public static final String MECHANISM = "SCRAM-SHA-512";
public ScramSha512(final Account account) {
super(account, ChannelBinding.NONE);
}
@Override
protected HashFunction getHMac(final byte[] key) {
return Hashing.hmacSha512(key);
}
@Override
protected HashFunction getDigest() {
return Hashing.sha512();
}
@Override
public int getPriority() {
return 30;
}
@Override
public String getMechanism() {
return MECHANISM;
}
}
|