2 # Copyright 2001-2017 The OpenSSL Project Authors. All Rights Reserved.
4 # Licensed under the Apache License 2.0 (the "License"). You may not use
5 # this file except in compliance with the License. You can obtain a copy
6 # in the file LICENSE in the source distribution or at
7 # https://www.openssl.org/source/license.html
9 # Tests start with one of these keywords
10 # Cipher Decrypt Derive Digest Encoding KDF MAC PBE
11 # PrivPubKeyPair Sign Verify VerifyRecover
12 # and continue until a blank line. Lines starting with a pound sign,
13 # like this prolog, are ignored.
30 Input = "hello world!"
31 Output = "aGVsbG8gd29ybGQh\n"
34 Input = 00010203040506070809a0b0c0d0e0f000
35 Output = "AAECAwQFBgcICaCwwNDg8AA=\n"
44 # Tolerate missing newline
49 # Don't tolerate extra trailing '='
52 Output = "aGVsbG8==\n"
55 Output = "aGVsbG8===\n"
57 # Don't tolerate data after '='
59 Output = "aGV=sbG8=\n"
61 # Newlines are ignored
64 Output = "aGV\nsbG8=\n"
68 Output = 614756736247383d0a
72 Output = 614756736247383d0a00
75 Output = 61475600736247383d0a
78 Output = 61475601736247383d0a
81 Output = 61475680736247383d0a
84 Output = e14756736247383d0a
87 Input = "OpenSSLOpenSSL\n"
88 Output = "T3BlblNTTE9wZW5TU0wK\n"
91 Input = "OpenSSLOpenSSL\n"
92 Output = "T3BlblNTTE9wZW5TU0wK"
96 Output = "T3BlblNTTE9wZW5TU0w"
99 Output = "T3BlblNTTE9wZW5TU0"
102 Output = "T3BlblNTTE9wZW5TU"
105 Output = "T3BlblNTTE9wZW5TU0wK===="
108 Output = "T3BlblNTTE9wZW5TU0wK============================================\n"
111 Output = "YQ==YQ==YQ==\n"
132 Input = "OpenSSLOpenSSL\n"
133 Output = "T3BlblNTTE9wZW5TU0wK\n\n"
136 Input = "OpenSSLOpenSSL\n"
137 Output = "T3BlblNTTE\n9wZW5TU0wK"
141 Output = "ZW5jb2RlIG1lCg==================================================================\n"
144 Input = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
145 Output = "eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eA==\n"
148 Input = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
149 Output = "eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eA\n==\n"
152 Input = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
153 Output = "eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eA=\n=\n"
156 Output = "eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eA====\n"
158 # Multiline output without padding
160 Input = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
161 Output = "eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4\neHh4eHh4eHh4eHh4\n"
163 # Multiline output with padding
165 Input = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
166 Output = "eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4\neHh4eHh4eHh4eHh4eHh4eA==\n"
168 # Multiline output with line break in the middle of a b64 block is accepted
170 Input = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
171 Output = "eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh\n4eHh4eHh4eHh4eHh4eHh4eA==\n"
173 # Long lines are accepted
175 Input = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
176 Output = "eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eA==\n"
178 # Multiline input with data after '='.
180 Output = "eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eA==\neHh4eHh4eHh4eHh4eHh4eHh4\n"
183 Output = "eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4\neA==eHh4eHh4eHh4eHh4eHh4\n"
185 # B64_EOF ('-') terminates input and trailing bytes are ignored
187 Input = "OpenSSLOpenSSL\n"
188 Output = "T3BlblNTTE9wZW5TU0wK\n-abcd"
191 Input = "OpenSSLOpenSSL\n"
192 Output = "T3BlblNTTE9wZW5TU0wK-abcd"