base64.c File Reference

Base64 encoding scheme. More...

#include "core/crypto.h"
#include "encoding/base64.h"

Go to the source code of this file.

Macros

#define TRACE_LEVEL   CRYPTO_TRACE_LEVEL
 

Functions

void base64Encode (const void *input, size_t inputLen, char_t *output, size_t *outputLen)
 Base64 encoding algorithm. More...
 
error_t base64Decode (const char_t *input, size_t inputLen, void *output, size_t *outputLen)
 Base64 decoding algorithm. More...
 

Detailed Description

Base64 encoding scheme.

License

Copyright (C) 2010-2018 Oryx Embedded SARL. All rights reserved.

This file is part of CycloneCrypto Open.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Description

Base64 is a encoding scheme that represents binary data in an ASCII string format by translating it into a radix-64 representation. Refer to RFC 4648 for more details

Author
Oryx Embedded SARL (www.oryx-embedded.com)
Version
1.9.0

Definition in file base64.c.

Macro Definition Documentation

◆ TRACE_LEVEL

#define TRACE_LEVEL   CRYPTO_TRACE_LEVEL

Definition at line 36 of file base64.c.

Function Documentation

◆ base64Decode()

error_t base64Decode ( const char_t input,
size_t  inputLen,
void *  output,
size_t *  outputLen 
)

Base64 decoding algorithm.

Parameters
[in]inputBase64 encoded string
[in]inputLenLength of the encoded string
[out]outputResulting decoded data
[out]outputLenLength of the decoded data
Returns
Error code

Definition at line 186 of file base64.c.

◆ base64Encode()

void base64Encode ( const void *  input,
size_t  inputLen,
char_t output,
size_t *  outputLen 
)

Base64 encoding algorithm.

Parameters
[in]inputInput data to encode
[in]inputLenLength of the data to encode
[out]outputNULL-terminated string encoded with Base64 algorithm
[out]outputLenLength of the encoded string (optional parameter)

Definition at line 76 of file base64.c.