public class ElGamal extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
static int |
LIFTED_ELGAMAL_CIPHERTEXT_LENGTH |
static int |
MAX_BITS |
static int |
PRE_COMP_BITS |
static int |
PRIVATE_KEY_LENGTH |
static int |
PUBLIC_KEY_LENGTH |
| 构造器和说明 |
|---|
ElGamal() |
| 限定符和类型 | 方法和说明 |
|---|---|
static int |
liftedElgamalCheckH(byte[] seed,
int[] validResult)
Check whether the generator 'H' is generated by seed "Lifted_ElGamal_H"
|
static int |
liftedElgamalContextFree()
free context 需要使用 lifted_elgamal_context
|
static int |
liftedElgamalContextInit(int curveId,
int validBits)
初始化加密上下文对象 需要使用 lifted_elgamal_context
|
static int |
liftedElgamalDecrypt(byte[] privateKey,
byte[] ciphertext,
long[] plaintext)
解密 需要使用 lifted_elgamal_context 和 lifted_elgamal_decrypt_context
|
static int |
liftedElgamalDecryptContextFree()
free 解密上下文对象 需要 使用 lifted_elgamal_decrypt_context
|
static int |
liftedElgamalDecryptContextInit(int precompBits,
int load,
byte[] path,
int pathLen)
初始化解密上下文对象,用于elgamal 解密 需要使用 lifted_elgamal_context 和 lifted_elgamal_decrypt_context
|
static int |
liftedElgamalEncrypt(byte[] publicKey,
byte[] rnd,
long plaintext,
byte[] ciphertext)
加密,内存需外部申请,传入,需要使用lifted_elgamal_context和lifted_elgamal_encrypt_context
|
static int |
liftedElgamalEncryptContextFree()
free elgamal 加密预计算表 需要使用 lifted_elgamal_encrypt_context
|
static int |
liftedElgamalEncryptContextInit(byte[] publicKey,
int hTableBits,
int pkTableBits)
加密上下文对象,初始化预计算表,加速加密过程 需要使用 lifted_elgamal_context 和 lifted_elgamal_encrypt_context
|
static int |
liftedElgamalGenKey(byte[] publicKey,
byte[] privateKey,
byte[] seed,
int seedLen)
生成公私钥 需要使用 lifted_elgamal_context
|
static int |
liftedElgamalGenRandom(byte[] rnd)
生成 32 字节长度的随机数,以小端存储 需要使用lifted_elgamal_context
|
static int |
liftedElgamalHomorphicAdd(byte[] first,
byte[] second,
byte[] res)
求和 需要使用 lifted_elgamal_context
|
static int |
liftedElgamalHomorphicSub(byte[] first,
byte[] second,
byte[] res)
求差 需要使用 lifted_elgamal_context
|
static int |
liftedElgamalInitDecryptedTable(int precompBits,
byte[] path,
int pathLen)
预计算解密表 需要使用 lifted_elgamal_context
|
static int |
liftedElgamalScalarMultiply(byte[] dst,
byte[] src,
long scalar)
求乘,需要使用 lifted_elgamal_context
|
public static final int PRIVATE_KEY_LENGTH
public static final int PUBLIC_KEY_LENGTH
public static final int LIFTED_ELGAMAL_CIPHERTEXT_LENGTH
public static final int PRE_COMP_BITS
public static final int MAX_BITS
public static int liftedElgamalContextInit(int curveId,
int validBits)
curveId - validBits - public static int liftedElgamalContextFree()
public static int liftedElgamalEncryptContextInit(byte[] publicKey,
int hTableBits,
int pkTableBits)
publicKey - hTableBits - pkTableBits - public static int liftedElgamalEncryptContextFree()
public static int liftedElgamalDecryptContextInit(int precompBits,
int load,
byte[] path,
int pathLen)
precompBits - load - path - public static int liftedElgamalDecryptContextFree()
public static int liftedElgamalGenKey(byte[] publicKey,
byte[] privateKey,
byte[] seed,
int seedLen)
publicKey - privateKey - seed - seedLen - public static int liftedElgamalGenRandom(byte[] rnd)
rnd - public static int liftedElgamalEncrypt(byte[] publicKey,
byte[] rnd,
long plaintext,
byte[] ciphertext)
publicKey - rnd - plaintext - ciphertext - public static int liftedElgamalDecrypt(byte[] privateKey,
byte[] ciphertext,
long[] plaintext)
privateKey - ciphertext - plaintext - public static int liftedElgamalHomorphicAdd(byte[] first,
byte[] second,
byte[] res)
first - second - res - public static int liftedElgamalHomorphicSub(byte[] first,
byte[] second,
byte[] res)
first - second - res - public static int liftedElgamalScalarMultiply(byte[] dst,
byte[] src,
long scalar)
dst - src - scalar - public static int liftedElgamalInitDecryptedTable(int precompBits,
byte[] path,
int pathLen)
precompBits - path - public static int liftedElgamalCheckH(byte[] seed,
int[] validResult)
seed - validResult - Copyright © 2022. All rights reserved.