Manuel Pégourié-Gonnard | 50a739f | 2015-09-30 16:28:38 +0200 | [diff] [blame] | 1 | Test case mbedtls_base64_encode #1 buffer just right |
| 2 | mbedtls_base64_encode:"":"":0:0 |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 3 | |
Manuel Pégourié-Gonnard | 50a739f | 2015-09-30 16:28:38 +0200 | [diff] [blame] | 4 | Test case mbedtls_base64_encode #2 buffer just right |
| 5 | mbedtls_base64_encode:"f":"Zg==":5:0 |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 6 | |
Manuel Pégourié-Gonnard | 50a739f | 2015-09-30 16:28:38 +0200 | [diff] [blame] | 7 | Test case mbedtls_base64_encode #2 buffer too small |
| 8 | mbedtls_base64_encode:"f":"Zg==":4:MBEDTLS_ERR_BASE64_BUFFER_TOO_SMALL |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 9 | |
Manuel Pégourié-Gonnard | 50a739f | 2015-09-30 16:28:38 +0200 | [diff] [blame] | 10 | Test case mbedtls_base64_encode #3 buffer just right |
| 11 | mbedtls_base64_encode:"fo":"Zm8=":5:0 |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 12 | |
Manuel Pégourié-Gonnard | 50a739f | 2015-09-30 16:28:38 +0200 | [diff] [blame] | 13 | Test case mbedtls_base64_encode #3 buffer too small |
| 14 | mbedtls_base64_encode:"fo":"Zm8=":4:MBEDTLS_ERR_BASE64_BUFFER_TOO_SMALL |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 15 | |
Manuel Pégourié-Gonnard | 50a739f | 2015-09-30 16:28:38 +0200 | [diff] [blame] | 16 | Test case mbedtls_base64_encode #4 buffer just right |
| 17 | mbedtls_base64_encode:"foo":"Zm9v":5:0 |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 18 | |
Manuel Pégourié-Gonnard | 50a739f | 2015-09-30 16:28:38 +0200 | [diff] [blame] | 19 | Test case mbedtls_base64_encode #4 buffer too small |
| 20 | mbedtls_base64_encode:"foo":"Zm9v":4:MBEDTLS_ERR_BASE64_BUFFER_TOO_SMALL |
| 21 | |
| 22 | Test case mbedtls_base64_encode #5 buffer just right |
| 23 | mbedtls_base64_encode:"foob":"Zm9vYg==":9:0 |
| 24 | |
| 25 | Test case mbedtls_base64_encode #5 buffer too small |
| 26 | mbedtls_base64_encode:"foob":"Zm9vYg==":8:MBEDTLS_ERR_BASE64_BUFFER_TOO_SMALL |
| 27 | |
| 28 | Test case mbedtls_base64_encode #6 buffer just right |
| 29 | mbedtls_base64_encode:"fooba":"Zm9vYmE=":9:0 |
| 30 | |
| 31 | Test case mbedtls_base64_encode #6 buffer too small |
| 32 | mbedtls_base64_encode:"fooba":"Zm9vYmE=":8:MBEDTLS_ERR_BASE64_BUFFER_TOO_SMALL |
| 33 | |
| 34 | Test case mbedtls_base64_encode #7 buffer just right |
| 35 | mbedtls_base64_encode:"foobar":"Zm9vYmFy":9:0 |
| 36 | |
| 37 | Test case mbedtls_base64_encode #7 buffer too small |
| 38 | mbedtls_base64_encode:"foobar":"Zm9vYmFy":8:MBEDTLS_ERR_BASE64_BUFFER_TOO_SMALL |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 39 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 40 | Test case mbedtls_base64_decode #1 |
| 41 | mbedtls_base64_decode:"":"":0 |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 42 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 43 | Test case mbedtls_base64_decode #2 |
| 44 | mbedtls_base64_decode:"Zg==":"f":0 |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 45 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 46 | Test case mbedtls_base64_decode #3 |
| 47 | mbedtls_base64_decode:"Zm8=":"fo":0 |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 48 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 49 | Test case mbedtls_base64_decode #4 |
| 50 | mbedtls_base64_decode:"Zm9v":"foo":0 |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 51 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 52 | Test case mbedtls_base64_decode #5 |
| 53 | mbedtls_base64_decode:"Zm9vYg==":"foob":0 |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 54 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 55 | Test case mbedtls_base64_decode #6 |
| 56 | mbedtls_base64_decode:"Zm9vYmE=":"fooba":0 |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 57 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 58 | Test case mbedtls_base64_decode #7 |
| 59 | mbedtls_base64_decode:"Zm9vYmFy":"foobar":0 |
Paul Bakker | 5946fd9 | 2009-07-11 15:29:30 +0000 | [diff] [blame] | 60 | |
| 61 | Base64 decode (Illegal character) |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 62 | mbedtls_base64_decode:"zm#=":"":MBEDTLS_ERR_BASE64_INVALID_CHARACTER |
Paul Bakker | 5946fd9 | 2009-07-11 15:29:30 +0000 | [diff] [blame] | 63 | |
| 64 | Base64 decode (Too much equal signs) |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 65 | mbedtls_base64_decode:"zm===":"":MBEDTLS_ERR_BASE64_INVALID_CHARACTER |
Paul Bakker | 5946fd9 | 2009-07-11 15:29:30 +0000 | [diff] [blame] | 66 | |
| 67 | Base64 decode (Invalid char after equal signs) |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 68 | mbedtls_base64_decode:"zm=masd":"":MBEDTLS_ERR_BASE64_INVALID_CHARACTER |
Paul Bakker | 3d36082 | 2009-07-05 11:29:38 +0000 | [diff] [blame] | 69 | |
Manuel Pégourié-Gonnard | 64938c6 | 2014-10-15 21:45:39 +0200 | [diff] [blame] | 70 | Base64 decode (Space inside string) |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 71 | mbedtls_base64_decode:"zm masd":"":MBEDTLS_ERR_BASE64_INVALID_CHARACTER |
Manuel Pégourié-Gonnard | 64938c6 | 2014-10-15 21:45:39 +0200 | [diff] [blame] | 72 | |
| 73 | Base64 decode "Zm9vYmFy" (no newline nor '\0' at end) |
| 74 | base64_decode_hex_src:"5a6d3976596d4679":"foobar":0 |
| 75 | |
| 76 | Base64 decode "Zm9vYmFy\n" (LF at end) |
| 77 | base64_decode_hex_src:"5a6d3976596d46790a":"foobar":0 |
| 78 | |
| 79 | Base64 decode "Zm9vYmFy\r\n" (CRLF at end) |
| 80 | base64_decode_hex_src:"5a6d3976596d46790d0a":"foobar":0 |
| 81 | |
| 82 | Base64 decode "Zm9vYmFy\r" (CR at end) |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 83 | base64_decode_hex_src:"5a6d3976596d46790d":"":MBEDTLS_ERR_BASE64_INVALID_CHARACTER |
Manuel Pégourié-Gonnard | 64938c6 | 2014-10-15 21:45:39 +0200 | [diff] [blame] | 84 | |
| 85 | Base64 decode "Zm9vYmFy " (SP at end) |
| 86 | base64_decode_hex_src:"5a6d3976596d467920":"foobar":0 |
| 87 | |
| 88 | Base64 decode "Zm9vYmFy \n" (SP+LF at end) |
| 89 | base64_decode_hex_src:"5a6d3976596d4679200a":"foobar":0 |
| 90 | |
| 91 | Base64 decode "Zm9vYmFy \r\n" (SP+CRLF at end) |
| 92 | base64_decode_hex_src:"5a6d3976596d4679200d0a":"foobar":0 |
| 93 | |
| 94 | Base64 decode "Zm9vYmFy \r" (SP+CR at end) |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 95 | base64_decode_hex_src:"5a6d3976596d4679200d":"":MBEDTLS_ERR_BASE64_INVALID_CHARACTER |
Manuel Pégourié-Gonnard | 64938c6 | 2014-10-15 21:45:39 +0200 | [diff] [blame] | 96 | |
| 97 | Base64 decode "Zm9vYmFy " (2SP at end) |
| 98 | base64_decode_hex_src:"5a6d3976596d46792020":"foobar":0 |
| 99 | |
| 100 | Base64 decode "Zm9vYmFy \n" (2SP+LF at end) |
| 101 | base64_decode_hex_src:"5a6d3976596d467920200a":"foobar":0 |
| 102 | |
| 103 | Base64 decode "Zm9vYmFy \r\n" (2SP+CRLF at end) |
| 104 | base64_decode_hex_src:"5a6d3976596d467920200d0a":"foobar":0 |
| 105 | |
| 106 | Base64 decode "Zm9vYmFy \r" (2SP+CR at end) |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 107 | base64_decode_hex_src:"5a6d3976596d467920200d":"":MBEDTLS_ERR_BASE64_INVALID_CHARACTER |
Manuel Pégourié-Gonnard | 64938c6 | 2014-10-15 21:45:39 +0200 | [diff] [blame] | 108 | |
| 109 | Base64 decode "Zm9vYmF\ny" (LF inside) |
| 110 | base64_decode_hex_src:"5a6d3976596d460a79":"foobar":0 |
| 111 | |
| 112 | Base64 decode "Zm9vYmF\ry" (CRLF inside) |
| 113 | base64_decode_hex_src:"5a6d3976596d460d0a79":"foobar":0 |
| 114 | |
| 115 | Base64 decode "Zm9vYmF\ry" (CR inside) |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 116 | base64_decode_hex_src:"5a6d3976596d460d79":"":MBEDTLS_ERR_BASE64_INVALID_CHARACTER |
Manuel Pégourié-Gonnard | 64938c6 | 2014-10-15 21:45:39 +0200 | [diff] [blame] | 117 | |
| 118 | Base64 decode "Zm9vYmF y" (SP inside) |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 119 | base64_decode_hex_src:"5a6d3976596d462079":"":MBEDTLS_ERR_BASE64_INVALID_CHARACTER |
Manuel Pégourié-Gonnard | 64938c6 | 2014-10-15 21:45:39 +0200 | [diff] [blame] | 120 | |
| 121 | Base64 decode "Zm9vYmF \ny" (SP+LF inside) |
| 122 | base64_decode_hex_src:"5a6d3976596d46200a79":"foobar":0 |
| 123 | |
| 124 | Base64 decode "Zm9vYmF \ry" (SP+CRLF inside) |
| 125 | base64_decode_hex_src:"5a6d3976596d46200d0a79":"foobar":0 |
| 126 | |
| 127 | Base64 decode "Zm9vYmF \ry" (SP+CR inside) |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 128 | base64_decode_hex_src:"5a6d3976596d46200d79":"":MBEDTLS_ERR_BASE64_INVALID_CHARACTER |
Manuel Pégourié-Gonnard | 64938c6 | 2014-10-15 21:45:39 +0200 | [diff] [blame] | 129 | |
| 130 | Base64 decode "Zm9vYmF y" (2SP inside) |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 131 | base64_decode_hex_src:"5a6d3976596d46202079":"":MBEDTLS_ERR_BASE64_INVALID_CHARACTER |
Manuel Pégourié-Gonnard | 64938c6 | 2014-10-15 21:45:39 +0200 | [diff] [blame] | 132 | |
| 133 | Base64 decode "Zm9vYmF \ny" (2SP+LF inside) |
| 134 | base64_decode_hex_src:"5a6d3976596d4620200a79":"foobar":0 |
| 135 | |
| 136 | Base64 decode "Zm9vYmF \ry" (2SP+CRLF inside) |
| 137 | base64_decode_hex_src:"5a6d3976596d4620200d0a79":"foobar":0 |
| 138 | |
| 139 | Base64 decode "Zm9vYmF \ry" (2SP+CR inside) |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 140 | base64_decode_hex_src:"5a6d3976596d4620200d79":"":MBEDTLS_ERR_BASE64_INVALID_CHARACTER |
Manuel Pégourié-Gonnard | 64938c6 | 2014-10-15 21:45:39 +0200 | [diff] [blame] | 141 | |
Paul Bakker | d598318 | 2014-07-04 13:50:31 +0200 | [diff] [blame] | 142 | Base64 encode hex #1 |
| 143 | base64_encode_hex:"010203040506070809":"AQIDBAUGBwgJ":13:0 |
| 144 | |
| 145 | Base64 encode hex #2 (buffer too small) |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 146 | base64_encode_hex:"010203040506070809":"AQIDBAUGBwgJ":12:MBEDTLS_ERR_BASE64_BUFFER_TOO_SMALL |
Paul Bakker | d598318 | 2014-07-04 13:50:31 +0200 | [diff] [blame] | 147 | |
| 148 | Base64 encode hex #3 |
| 149 | base64_encode_hex:"0102030405060708":"AQIDBAUGBwg=":13:0 |
| 150 | |
| 151 | Base64 encode hex #4 |
| 152 | base64_encode_hex:"01020304050607":"AQIDBAUGBw==":13:0 |
| 153 | |
| 154 | Base64 decode hex #1 |
| 155 | base64_decode_hex:"AQIDBAUGBwgJ":"010203040506070809":9:0 |
| 156 | |
| 157 | Base64 decode hex #2 (buffer too small) |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 158 | base64_decode_hex:"AQIDBAUGBwgJ":"010203040506070809":8:MBEDTLS_ERR_BASE64_BUFFER_TOO_SMALL |
Paul Bakker | d598318 | 2014-07-04 13:50:31 +0200 | [diff] [blame] | 159 | |
| 160 | Base64 decode hex #3 |
| 161 | base64_decode_hex:"AQIDBAUGBwg=":"0102030405060708":8:0 |
| 162 | |
| 163 | Base64 decode hex #4 |
| 164 | base64_decode_hex:"AQIDBAUGBw==":"01020304050607":7:0 |
| 165 | |
| 166 | Base64 decode hex #5 (buffer too small) |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 167 | base64_decode_hex:"AQIDBAUGBw==":"01020304050607":6:MBEDTLS_ERR_BASE64_BUFFER_TOO_SMALL |
Paul Bakker | d598318 | 2014-07-04 13:50:31 +0200 | [diff] [blame] | 168 | |
Paul Bakker | 3d36082 | 2009-07-05 11:29:38 +0000 | [diff] [blame] | 169 | Base64 Selftest |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 170 | depends_on:MBEDTLS_SELF_TEST |
Paul Bakker | 3d36082 | 2009-07-05 11:29:38 +0000 | [diff] [blame] | 171 | base64_selftest: |
Manuel Pégourié-Gonnard | 64938c6 | 2014-10-15 21:45:39 +0200 | [diff] [blame] | 172 | |