bc-java
bc-java copied to clipboard
Do the imports below and the sample code perform a CMAC calculation according to NIST SP 800-38B ?
import org.bouncycastle.crypto.SymmetricKey; import org.bouncycastle.crypto.SymmetricSecretKey; import org.bouncycastle.crypto.fips.FipsAES; import org.bouncycastle.crypto.fips.FipsMACOperatorFactory; import org.bouncycastle.crypto.fips.FipsOutputMACCalculator;
FipsMACOperatorFactory<FipsAES.AuthParameters> fipsSymmetricFactory =
new FipsAES.MACOperatorFactory();
FipsOutputMACCalculator<FipsAES.AuthParameters> macCalculator =
fipsSymmetricFactory.createOutputMACCalculator(
aesKey, FipsAES.CMAC.withMACSize(128));