From 5d9cd625fef67d7a6ec751147028c12f938dfdb7 Mon Sep 17 00:00:00 2001 From: rsiddharth Date: Wed, 9 Dec 2020 20:02:39 -0500 Subject: lib/blocks: add Pkcs7PaddingUndo --- lib/blocks.go | 5 +++++ 1 file changed, 5 insertions(+) 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]))] +} -- cgit v1.2.3