summaryrefslogtreecommitdiff
path: root/include/base32.h
diff options
context:
space:
mode:
authorJack Rosenthal <jrosenth@chromium.org>2021-11-04 12:11:58 -0600
committerCommit Bot <commit-bot@chromium.org>2021-11-05 04:22:34 +0000
commit252457d4b21f46889eebad61d4c0a65331919cec (patch)
tree01856c4d31d710b20e85a74c8d7b5836e35c3b98 /include/base32.h
parent08f5a1e6fc2c9467230444ac9b582dcf4d9f0068 (diff)
downloadchrome-ec-stabilize-14526.57.B-ish.tar.gz
In the interest of making long-term branch maintenance incur as little technical debt on us as possible, we should not maintain any files on the branch we are not actually using. This has the added effect of making it extremely clear when merging CLs from the main branch when changes have the possibility to affect us. The follow-on CL adds a convenience script to actually pull updates from the main branch and generate a CL for the update. BUG=b:204206272 BRANCH=ish TEST=make BOARD=arcada_ish && make BOARD=drallion_ish Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I17e4694c38219b5a0823e0a3e55a28d1348f4b18 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3262038 Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Tom Hughes <tomhughes@chromium.org>
Diffstat (limited to 'include/base32.h')
-rw-r--r--include/base32.h73
1 files changed, 0 insertions, 73 deletions
diff --git a/include/base32.h b/include/base32.h
deleted file mode 100644
index ac04ce9c70..0000000000
--- a/include/base32.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/* Copyright 2017 The Chromium OS Authors. All rights reserved.
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-/* Base-32 encoding/decoding, designed for manual operator entry. */
-
-#ifndef __CROS_EC_BASE32_H
-#define __CROS_EC_BASE32_H
-
-/* Symbol map for base32 encoding */
-extern const char base32_map[33];
-
-/**
- * CRC-5-USB Initially created for USB Token Packets. It uses
- * the generator polynomial X^5 + X^2 + X^0 and is 5-bits.
- *
- * @param sym New symbol to update CRC with
- * @param previous_crc Existing CRC value
- * @return The updated CRC.
- */
-uint8_t crc5_sym(uint8_t sym, uint8_t previous_crc);
-
-/**
- * base32-encode data into a null-terminated string
- *
- * Uses A-Z0-9 encoding, skipping I,O,0,1 since they're easy to get mixed up.
- *
- * @param dest Destination buffer; set to empty string on
- * error
- * @param destlen_chars Length of destination buffer in characters
- * @param src Source binary data
- * @param srclen_bits Length of source *in bits*. If this is not a
- * multiple of 8, the *most significant* bits of
- * the last byte will be used. If this is not a
- * multiple of 5, the least significant bits of
- * the last symbol will be padded with 0 bits.
- * @param add_crc_every If non-zero, add a CRC symbol after each group
- * of this many symbols. There must be an exact
- * number of groups; that is, ceil(srclen_bits/5)
- * must be a multiple of add_crc_every.
- * @return EC_SUCCESS, or non-zero error code.
- */
-int base32_encode(char *dest, int destlen_chars,
- const void *srcbits, int srclen_bits,
- int add_crc_every);
-
-/**
- * base32-decode data from a null-terminated string
- *
- * Ignores whitespace and '-' dashes in the source string.
- *
- * If the destination is smaller than the decoded bitstream, only that many
- * bits will be decoded. This is useful for decoding the first part of a
- * bitstream to look for a struct version.
- *
- * If the destination is larger than the decoded bitstream, check the return
- * value to determine how many bits were decoded from the source. Note that if
- * padding was added by base32_encode (that is, the input length was not a
- * multiple of 5 bits), the padding will be included in the count.
- *
- * @param dest Destination; must be at least
- * ceil(destlen_bits/8) bytes.
- * @param destlen_bits Length of destination *in bits*.
- * @param src Source string (null-terminated)
- * @param crc_after_every If non-zero, expect CRC symbol after every
- * group of this many symbols.
- * @return Number of decoded *bits*, or -1 if error.
- */
-int base32_decode(uint8_t *dest, int destlen_bits, const char *src,
- int crc_after_every);
-
-#endif