Generate bytes using an eXtendable-Output Function (XOF).
Namespace: CryptoSysPKIAssembly: diCrSysPKINet (in diCrSysPKINet.dll) Version: 23.0.0.25611 (23.0.0.0)
Syntaxpublic static byte[] Bytes(
int numBytes,
byte[] message,
XofAlg xofAlg
)
Public Shared Function Bytes (
numBytes As Integer,
message As Byte(),
xofAlg As XofAlg
) As Byte()
Parameters
- numBytes Int32
- Required number of output bytes.
- message Byte
- Input message data.
- xofAlg XofAlg
- XOF algorithm.
Return Value
ByteOutput data in byte array.
Example
byte[] msg = "6ae23f058f0f2264a18cd609acc26dd4dbc00f5c3ee9e13ecaea2bb5a2f0bb6b".FromHex();
int nbytes = 2000 / 8;
byte[] b = Xof.Bytes(nbytes, msg, Xof.Alg.Shake256);
Console.WriteLine(b.ToHex());
int nbytes = 34;
byte[] msg = "3b5c056af3ebba70d4c805380420585562b32410a778f558ff951252407647e3".FromHex();
byte[] b = Xof.Bytes(nbytes, msg, Xof.Alg.Mgf1_Sha256);
Console.WriteLine(b.ToHex());
See Also