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

org.bouncycastle.pqc.crypto.cmce.GF Maven / Gradle / Ivy

Go to download

The Bouncy Castle Crypto package is a Java implementation of cryptographic algorithms. This jar contains JCE provider and lightweight API for the Bouncy Castle Cryptography APIs for Java 1.8 and later with debug enabled.

There is a newer version: 1.78.1
Show newest version
package org.bouncycastle.pqc.crypto.cmce;

abstract class GF
{
    protected final int GFBITS;
    protected final int GFMASK;//  = ((1 << GFBITS) - 1);

    public GF(int gfbits)
    {
        GFBITS = gfbits;
        GFMASK = ((1 << GFBITS) - 1);

    }

    short gf_iszero(short a)
    {
        int t = a;

        t -= 1;
        t >>>= 19;

        return (short) t;
    }

    short gf_add(short left, short right)
    {
        return (short) (left ^ right);
    }

    abstract protected short gf_mul(short left, short right);
    abstract protected short gf_frac(short den, short num);
    abstract protected short gf_inv(short input);

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy