Ejemplo n.º 1
0
        /// <summary>
        ///     If variable striping mode is enabled, advances the state of the selection CSPRNG,
        ///     and returns the output to be used as the length of the next operation.
        ///     Otherwise, fixed length is returned.
        /// </summary>
        /// <returns>Operation length to perform.</returns>
        private int NextOperationLength()
        {
            int operationLength = _stripeMode == FabricStripeMode.VariableLength
                ? EntropySource.Next(_minStripe, _maxStripe)
                : _maxStripe;

            Debug.Print(DebugUtility.CreateReportString("FabricPayloadMux", "NextOperationLength", "Generated stripe length value",
                                                        operationLength));
            return(operationLength);
        }
Ejemplo n.º 2
0
        private int NextPaddingLength()
        {
            int paddingLength = (_paddingMode == FrameshiftPaddingMode.VariableLength)
                ? EntropySource.NextPositive(_minPadding, _maxPadding)
                : _maxPadding;

            Debug.Print(DebugUtility.CreateReportString("FrameshiftPayloadMux", "NextPaddingLength", "Generated length value",
                                                        paddingLength));

            return(paddingLength);
        }