coreboot/src/include
Vadim Bendebury 243c614134 lib: add base64 decoder
It became necessary to decode base64 data retrieved from VPD and
convert it into binary for inclusion in the device tree.

The patch introduces the decoder function based on the description
found in http://en.wikipedia.org/wiki/Base64.

An open source implementation from http://base64.sourceforge.net was
considered, in the end the only thing borrowed from it is the table to
translate base64 ascii characters into numbers in 0..63 range.

BRANCH=none
BUG=chromium:450169

TEST=created a test harness generating random contents of random size
     (in 8 to 32766 bytes range), then converting the contents into
     base64 using the Linux utility, and then converting it back to
     binary using this function and comparing the results.

     It succeeded 1700 iterations before it was stopped.

Change-Id: I502f2c9494c99ba95ece37a7220c0c70c4755be2
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Commit-Id: 6609f76e1559d3cdd402276055c99e0de7da27c8
Original-Change-Id: I5ed68af3a4daead50c44ae0f0c63d836f4b66851
Original-Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/262945
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: http://review.coreboot.org/9892
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2015-04-22 08:50:54 +02:00
..
boot vpd: populate coreboot table with serialno 2015-04-22 08:47:25 +02:00
console Add console wrapper for UART driver 2015-04-14 21:25:34 +02:00
cpu baytrail: Switch from ACPI mode to PCI mode for legacy support 2015-04-10 19:21:49 +02:00
device Unify byte order macros and clrsetbits 2015-04-21 08:23:25 +02:00
pc80
smp
superio
tpm_lite
antirollback.h chromeos: vboot2: Add TPM PCR extension support 2015-04-20 17:06:28 +02:00
assert.h Fix non-x86 __PRE_RAM__ assertions and add FATAL_ASSERTS Kconfig option 2015-04-17 10:11:33 +02:00
b64_decode.h lib: add base64 decoder 2015-04-22 08:50:54 +02:00
base3.h gpio: Remove non-ternary tristate mode, make ternaries easier 2015-04-10 11:57:44 +02:00
bcd.h
boardid.h google/urara: use board ID information to set up hardware 2015-04-22 08:50:10 +02:00
bootmem.h
bootmode.h vboot: when configured, pass the wipeout request to vboot 2015-04-22 08:41:11 +02:00
bootstate.h
cbfs.h cbfs: look for CBFS header in a predefined place 2015-04-17 09:54:40 +02:00
cbfs_core.h
cbfs_serialized.h CBFS: Automate ROM image layout and remove hardcoded offsets 2015-04-14 09:01:27 +02:00
cbmem.h Arrange CBMEM table entries' IDs alphanumerically 2015-04-21 08:08:19 +02:00
delay.h timer: Reestablish init_timer(), consolidate timer initialization calls 2015-04-14 09:03:28 +02:00
edid.h
elog.h
endian.h Unify byte order macros and clrsetbits 2015-04-21 08:23:25 +02:00
fallback.h
gic.h
gpio.h gpio: add a function to read GPIO array as base-2 value 2015-04-10 11:59:30 +02:00
halt.h
inttypes.h
ip_checksum.h
kconfig.h
lib.h New mechanism to define SRAM/memory map with automatic bounds checking 2015-04-06 22:05:01 +02:00
memlayout.h cbfs: look for CBFS header in a predefined place 2015-04-17 09:54:40 +02:00
memory_info.h
memrange.h
option.h
program_loading.h program loading: unify on struct prog 2015-04-03 14:53:11 +02:00
ramstage_cache.h
reg_script.h Add table driven way to add platform specific reg_script routines 2015-04-04 12:40:29 +02:00
reset.h
rmodule-defs.h
rmodule.h rmodule: use struct prog while loading rmodules 2015-04-03 14:53:35 +02:00
romstage_handoff.h romstage_handoff: Fix for changing CBMEM structure 2015-04-21 08:20:50 +02:00
rtc.h
rules.h build system: rename __BOOT_BLOCK__ and __VER_STAGE__ 2015-04-04 20:07:18 +02:00
sdram_mode.h
smbios.h smbios: add a family id in smbios type1 family 2015-04-02 13:26:05 +02:00
spd.h
spd_cache.h
spd_ddr2.h
spi-generic.h spi: support controllers with limited transfer size capabilities 2015-04-13 13:01:33 +02:00
spi_flash.h spi: Add function to read flash status register 2015-04-17 09:21:22 +02:00
stddef.h stddef: Add KHz, MHz and GHz constants 2015-04-04 15:01:51 +02:00
stdlib.h
string.h
swab.h
symbols.h cbfs: look for CBFS header in a predefined place 2015-04-17 09:54:40 +02:00
thread.h
timer.h
timestamp.h timestamps: You can never have enough of them! 2015-04-14 09:03:40 +02:00
tpm.h
trace.h
types.h
vbe.h
version.h
watchdog.h