All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.bouncycastle.tls.crypto.impl.BCFipsAEADNonceGenerator Maven / Gradle / Ivy

package org.bouncycastle.tls.crypto.impl;

import org.bouncycastle.crypto.fips.FipsNonceGenerator;
import org.bouncycastle.tls.AlertDescription;
import org.bouncycastle.tls.TlsFatalAlert;

public class BCFipsAEADNonceGenerator
    implements AEADNonceGenerator
{
    private final FipsNonceGenerator nonceGenerator;

    BCFipsAEADNonceGenerator(byte[] baseNonce, int counterBits)
    {
        this.nonceGenerator = new FipsNonceGenerator(baseNonce, counterBits);
    }

    public void generateNonce(byte[] nonce)
        throws TlsFatalAlert
    {
        try
        {
            this.nonceGenerator.generateNonce(nonce);
        }
        catch (Exception e)
        {
            throw new TlsFatalAlert(AlertDescription.internal_error);
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy