public final class LoadNativeMyCrypto extends Object
| 限定符和类型 | 方法和说明 |
|---|---|
static boolean |
isNative() |
static void |
nextBytes(byte[] bytes)
Fetches random bytes from RdRand and places them into the user specified array.
|
static int |
nextBytesNative(byte[] bytes,
int size)
Native method fetching the specified number of bytes in the provided
byte array from RdRand.
|
static int |
sm3HashNative(byte[] md,
byte[] inbuf,
int lenbufLen) |
static int |
sm3KDFNative(byte[] outbuf,
int outbufLen,
byte[] inbuf,
int inbufLen) |
static int |
sm4CbcDecryptWithMacNative(byte[] encKey,
byte[] macKey,
byte[] iv,
byte[] ciphertext,
int ciphertextLen,
byte[] plaintext,
int[] plaintextLen) |
static int |
sm4CbcEncryptWithMacNative(byte[] encKey,
byte[] macKey,
byte[] iv,
byte[] plaintext,
int plaintextLen,
byte[] ciphertext,
int[] ciphertextLen) |
static MyCryptoStatus |
verify()
Verifies the availability and status of the RdRand instruction
on the host.
|
public static boolean isNative()
public static MyCryptoStatus verify()
public static int nextBytesNative(byte[] bytes,
int size)
bytes - The byte array to fill with random bytes.size - The number of random bytes to fetch.public static void nextBytes(byte[] bytes)
bytes - The byte array to fill with random bytes.public static int sm3HashNative(byte[] md,
byte[] inbuf,
int lenbufLen)
md - The output md, must be 32 bytes lengthinbuf - The input buf to hashlenbufLen - Length of input bufpublic static int sm3KDFNative(byte[] outbuf,
int outbufLen,
byte[] inbuf,
int inbufLen)
outbuf - The output buffer of outputLen length.outbufLen - Ouput buffer length.inbuf - The input buffer.inbufLen - The input buffer length.public static int sm4CbcEncryptWithMacNative(byte[] encKey,
byte[] macKey,
byte[] iv,
byte[] plaintext,
int plaintextLen,
byte[] ciphertext,
int[] ciphertextLen)
encKey - [in ] encryption key data, 16 bytes.macKey - [in ] mac key data, 16 bytesiv - [in ] iv data, 16 bytes, random numberplaintext - [in ] plaintext data, plaintextLen bytesplaintextLen - [in ] the byte length of plaintextLen dataciphertext - [ out] ciphertext data, ciphertextLen bytesciphertextLen - [in out] the byte length of ciphertextLen datapublic static int sm4CbcDecryptWithMacNative(byte[] encKey,
byte[] macKey,
byte[] iv,
byte[] ciphertext,
int ciphertextLen,
byte[] plaintext,
int[] plaintextLen)
encKey - [in ] encryption key data, 16 bytes.macKey - [in ] mac key data, 16 bytesiv - [in ] iv data, 16 bytes, random numberciphertext - [in] ciphertext data, ciphertextLen bytesciphertextLen - [in] the byte length of ciphertextLen dataplaintext - [out ] plaintext data, plaintextLen bytesplaintextLen - [in out] the byte length of plaintextLen dataCopyright © 2022. All rights reserved.