summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrsiddharth <s@ricketyspace.net>2020-12-09 20:02:39 -0500
committerrsiddharth <s@ricketyspace.net>2020-12-09 20:02:39 -0500
commit5d9cd625fef67d7a6ec751147028c12f938dfdb7 (patch)
treedb624f96c211db2539da22ea126d91ac38e29af7
parentdc6cca42113ea7e9a292175e1704061d742014dd (diff)
lib/blocks: add Pkcs7PaddingUndo
-rw-r--r--lib/blocks.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/blocks.go b/lib/blocks.go
index 452766b..0645fab 100644
--- a/lib/blocks.go
+++ b/lib/blocks.go
@@ -96,3 +96,8 @@ func Pkcs7Padding(in []byte, k int) []byte {
}
return in
}
+
+// Removes PKCS#7 Padding from input `in`
+func Pkcs7PaddingUndo(in []byte) []byte {
+ return in[0:(len(in) - int(in[len(in)-1]))]
+}