public class GF extends Object
| 修飾子とタイプ | フィールドと説明 |
|---|---|
static byte |
FF128 |
static byte |
FF64 |
static byte |
FF8 |
static byte[] |
GF128 |
static byte[] |
GF64 |
static byte[] |
GF8 |
| コンストラクタと説明 |
|---|
GF() |
GF(int n,
byte rb)
長い用
|
GF(int n,
byte[] rb)
rb は1バイトだけ使う仮実装
|
GF(int n,
int m)
短い用 1バイトくらいの
|
| 修飾子とタイプ | メソッドと説明 |
|---|---|
byte[] |
add(byte[] a,
byte[] b) |
long[] |
add(long[] a,
long[] b) |
byte[] |
div(byte[] a,
byte[] b)
非推奨です。
未検証
|
int |
div(int a,
int b) |
byte[] |
inv(byte[] a)
逆数計算的なもの(簡易版)
256 - 2 で ^254 ぐらいの位置づけ
ビット長*2回掛けるぐらいで計算はできる
|
int |
inv(int a)
8bit 逆数計算的なもの(高速版)
|
byte[] |
mul(byte[] a,
byte[] b)
a・b
|
int |
mul(int a,
int b) |
long[] |
mul(long[] a,
long[] b)
a・b
|
byte[] |
pow(byte[] a,
BigInteger p)
簡易版
|
byte[] |
pow(byte[] a,
long p)
あれ
|
long[] |
pow(long[] a,
long p) |
byte[] |
r(byte[] s)
GF s・2の逆 /2
|
int |
r(int s) |
int[] |
r(int[] s)
GF s・2の逆 /2
|
long[] |
r(long[] s)
s / 2.
|
static String |
toHexString(long[] s) |
byte[] |
x(byte[] s)
ふつうのGF s・2
バイト数は未検証.
|
int |
x(int a)
a・2
|
long[] |
x(long[] s)
long列 GF s・2
|
public static final byte FF8
public static final byte FF64
public static final byte FF128
public static final byte[] GF8
public static final byte[] GF64
public static final byte[] GF128
public GF()
public GF(int n,
int m)
n - 2^n 8 bit を想定m - n = 8のとき 0x11bくらい 上のビットありpublic GF(int n,
byte[] rb)
n - ビット数 128を想定rb - 0x87 を想定public GF(int n,
byte rb)
n - ビット長 128bitrb - MSBを外したもの constやfinalなので複製しなくてもいい?public byte[] x(byte[] s)
s - 数public long[] x(long[] s)
s - 数public byte[] r(byte[] s)
s・2 - public int[] r(int[] s)
s・2 - public long[] r(long[] s)
s - public final int x(int a)
a - public int r(int s)
public int inv(int a)
a - public byte[] inv(byte[] a)
a - public byte[] pow(byte[] a,
long p)
a - p - exponent 1以上public long[] pow(long[] a,
long p)
public byte[] pow(byte[] a,
BigInteger p)
a - 元p - exponent 1以上public int mul(int a,
int b)
public byte[] add(byte[] a,
byte[] b)
public long[] add(long[] a,
long[] b)
public byte[] mul(byte[] a,
byte[] b)
a - b - public long[] mul(long[] a,
long[] b)
a - b - public int div(int a,
int b)
public byte[] div(byte[] a,
byte[] b)
a - b - public static String toHexString(long[] s)
Copyright © 2024. All rights reserved.