Path: blob/master/thirdparty/mbedtls/library/base64_internal.h
9898 views
/**1* \file base64_internal.h2*3* \brief RFC 1521 base64 encoding/decoding: interfaces for invasive testing4*/5/*6* Copyright The Mbed TLS Contributors7* SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later8*/910#ifndef MBEDTLS_BASE64_INTERNAL11#define MBEDTLS_BASE64_INTERNAL1213#include "common.h"1415#if defined(MBEDTLS_TEST_HOOKS)1617/** Given a value in the range 0..63, return the corresponding Base64 digit.18*19* The implementation assumes that letters are consecutive (e.g. ASCII20* but not EBCDIC).21*22* \param value A value in the range 0..63.23*24* \return A base64 digit converted from \p value.25*/26unsigned char mbedtls_ct_base64_enc_char(unsigned char value);2728/** Given a Base64 digit, return its value.29*30* If c is not a Base64 digit ('A'..'Z', 'a'..'z', '0'..'9', '+' or '/'),31* return -1.32*33* The implementation assumes that letters are consecutive (e.g. ASCII34* but not EBCDIC).35*36* \param c A base64 digit.37*38* \return The value of the base64 digit \p c.39*/40signed char mbedtls_ct_base64_dec_value(unsigned char c);4142#endif /* MBEDTLS_TEST_HOOKS */4344#endif /* MBEDTLS_BASE64_INTERNAL */454647