FreeRTOS-Plus/ThirdParty/WolfSSL-FIPS-Ready/wolfcrypt/src/asn.c
/* Set the DER/BER encoding of the ASN.1 BIT_STRING header.
 *
 * len         Length of data to encode.
 * unusedBits  The number of unused bits in the last byte of data.
 *             That is, the number of least significant zero bits before a one.
 *             The last byte is the most-significant non-zero byte of a number.
 * output      Buffer to write into.
 * returns the number of bytes added to the buffer.
 */
Set the DER/BER encoding of the ASN.1 BIT_STRING header.
len         Length of data to encode.
unusedBits  The number of unused bits in the last byte of data.
That is, the number of least significant zero bits before a one.
The last byte is the most-significant non-zero byte of a number.
output      Buffer to write into.
returns the number of bytes added to the buffer.
Set the DER / BER encoding of the ASN . 1 BIT_STRING header . len Length of data to encode . unusedBits The number of unused bits in the last byte of data . That is the number of least significant zero bits before a one . The last byte is the most - significant non - zero byte of a number . output Buffer to write into . returns the number of bytes added to the buffer .
word32 SetBitString(word32 len, byte unusedBits, byte* output)
{
    word32 idx = 0;
    if (output)
        output[idx] = ASN_BIT_STRING;
    idx++;
    idx += SetLength(len + 1, output ? output + idx : NULL);
    if (output)
        output[idx] = unusedBits;
    idx++;
    return idx;
}
word32 SetBitString ( word32 len , byte unusedBits , byte * output ) { word32 idx = 0 ; if ( output ) output [ idx ] = ASN_BIT_STRING ; idx ++ ; idx += SetLength ( len + 1 , output ? output + idx : NULL ) ; if ( output ) output [ idx ] = unusedBits ; idx ++ ; return idx ; }
Set the DER/BER encoding of the ASN.1 BIT_STRING header.
Set the DER / BER encoding of the ASN . 1 BIT_STRING header .