Generate output bytes using a pseudorandom function (PRF).
Namespace: CryptoSysPKIAssembly: diCrSysPKINet (in diCrSysPKINet.dll) Version: 23.0.0.25611 (23.0.0.0)
Syntaxpublic static byte[] Bytes(
int numBytes,
byte[] message,
byte[] key,
PrfAlg prfAlg,
string customStr = ""
)
Public Shared Function Bytes (
numBytes As Integer,
message As Byte(),
key As Byte(),
prfAlg As PrfAlg,
Optional customStr As String = ""
) As Byte()
Parameters
- numBytes Int32
- Required number of output bytes.
- message Byte
- Input message data.
- key Byte
- Key.
- prfAlg PrfAlg
- PRF algorithm.
- customStr String (Optional)
- Customization string (optional).
Return Value
ByteOutput data in byte array.
Example
int nbytes = 256 / 8;
byte[] msg = "00010203".FromHex();
byte[] key = "404142434445464748494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F".FromHex();
byte[] b = Prf.Bytes(nbytes, msg, key, Prf.Alg.Kmac128);
Console.WriteLine("OUT={0}", b.ToHex());
See Also