diff options
Diffstat (limited to '')
-rw-r--r-- | src/lib/libssl/src/crypto/evp/evp.h | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/src/lib/libssl/src/crypto/evp/evp.h b/src/lib/libssl/src/crypto/evp/evp.h index 5cd125894f..3bd36e9266 100644 --- a/src/lib/libssl/src/crypto/evp/evp.h +++ b/src/lib/libssl/src/crypto/evp/evp.h | |||
@@ -1258,49 +1258,51 @@ int EVP_AEAD_CTX_init(EVP_AEAD_CTX *ctx, const EVP_AEAD *aead, | |||
1258 | void EVP_AEAD_CTX_cleanup(EVP_AEAD_CTX *ctx); | 1258 | void EVP_AEAD_CTX_cleanup(EVP_AEAD_CTX *ctx); |
1259 | 1259 | ||
1260 | /* EVP_AEAD_CTX_seal encrypts and authenticates the input and authenticates | 1260 | /* EVP_AEAD_CTX_seal encrypts and authenticates the input and authenticates |
1261 | * any additional data (AD). The result is written as output, with the number | 1261 | * any additional data (AD), the result being written as output. One is |
1262 | * of bytes written being returned, or -1 on error. | 1262 | * returned on success, otherwise zero. |
1263 | * | 1263 | * |
1264 | * This function may be called (with the same EVP_AEAD_CTX) concurrently with | 1264 | * This function may be called (with the same EVP_AEAD_CTX) concurrently with |
1265 | * itself or EVP_AEAD_CTX_open. | 1265 | * itself or EVP_AEAD_CTX_open. |
1266 | * | 1266 | * |
1267 | * At most max_out_len bytes are written as output and, in order to ensure | 1267 | * At most max_out_len bytes are written as output and, in order to ensure |
1268 | * success, this value should be the length of the input plus the result of | 1268 | * success, this value should be the length of the input plus the result of |
1269 | * EVP_AEAD_overhead. | 1269 | * EVP_AEAD_overhead. On successful return, out_len is set to the actual |
1270 | * number of bytes written. | ||
1270 | * | 1271 | * |
1271 | * The length of the nonce is must be equal to the result of | 1272 | * The length of the nonce is must be equal to the result of |
1272 | * EVP_AEAD_nonce_length for this AEAD. | 1273 | * EVP_AEAD_nonce_length for this AEAD. |
1273 | * | 1274 | * |
1274 | * EVP_AEAD_CTX_seal never results in a partial output. If max_out_len is | 1275 | * EVP_AEAD_CTX_seal never results in a partial output. If max_out_len is |
1275 | * insufficient, -1 will be returned. | 1276 | * insufficient, zero will be returned and out_len will be set to zero. |
1276 | * | 1277 | * |
1277 | * If the input and output are aliased then out must be <= in. */ | 1278 | * If the input and output are aliased then out must be <= in. */ |
1278 | ssize_t EVP_AEAD_CTX_seal(const EVP_AEAD_CTX *ctx, unsigned char *out, | 1279 | int EVP_AEAD_CTX_seal(const EVP_AEAD_CTX *ctx, unsigned char *out, |
1279 | size_t max_out_len, const unsigned char *nonce, size_t nonce_len, | 1280 | size_t *out_len, size_t max_out_len, const unsigned char *nonce, |
1280 | const unsigned char *in, size_t in_len, const unsigned char *ad, | 1281 | size_t nonce_len, const unsigned char *in, size_t in_len, |
1281 | size_t ad_len); | 1282 | const unsigned char *ad, size_t ad_len); |
1282 | 1283 | ||
1283 | /* EVP_AEAD_CTX_open authenticates the input and additional data, decrypting | 1284 | /* EVP_AEAD_CTX_open authenticates the input and additional data, decrypting |
1284 | * the input and writing it as output. The number of bytes decrypted and | 1285 | * the input and writing it as output. One is returned on success, otherwise |
1285 | * written as output is returned, or -1 on error. | 1286 | * zero. |
1286 | * | 1287 | * |
1287 | * This function may be called (with the same EVP_AEAD_CTX) concurrently with | 1288 | * This function may be called (with the same EVP_AEAD_CTX) concurrently with |
1288 | * itself or EVP_AEAD_CTX_seal. | 1289 | * itself or EVP_AEAD_CTX_seal. |
1289 | * | 1290 | * |
1290 | * At most the number of input bytes are written as output. In order to ensure | 1291 | * At most the number of input bytes are written as output. In order to ensure |
1291 | * success, max_out_len should be at least the same as the input length. | 1292 | * success, max_out_len should be at least the same as the input length. On |
1293 | * successful return out_len is set to the actual number of bytes written. | ||
1292 | * | 1294 | * |
1293 | * The length of nonce must be equal to the result of EVP_AEAD_nonce_length | 1295 | * The length of nonce must be equal to the result of EVP_AEAD_nonce_length |
1294 | * for this AEAD. | 1296 | * for this AEAD. |
1295 | * | 1297 | * |
1296 | * EVP_AEAD_CTX_open never results in a partial output. If max_out_len is | 1298 | * EVP_AEAD_CTX_open never results in a partial output. If max_out_len is |
1297 | * insufficient, -1 will be returned. | 1299 | * insufficient, zero will be returned and out_len will be set to zero. |
1298 | * | 1300 | * |
1299 | * If the input and output are aliased then out must be <= in. */ | 1301 | * If the input and output are aliased then out must be <= in. */ |
1300 | ssize_t EVP_AEAD_CTX_open(const EVP_AEAD_CTX *ctx, unsigned char *out, | 1302 | int EVP_AEAD_CTX_open(const EVP_AEAD_CTX *ctx, unsigned char *out, |
1301 | size_t max_out_len, const unsigned char *nonce, size_t nonce_len, | 1303 | size_t *out_len, size_t max_out_len, const unsigned char *nonce, |
1302 | const unsigned char *in, size_t in_len, const unsigned char *ad, | 1304 | size_t nonce_len, const unsigned char *in, size_t in_len, |
1303 | size_t ad_len); | 1305 | const unsigned char *ad, size_t ad_len); |
1304 | 1306 | ||
1305 | void EVP_add_alg_module(void); | 1307 | void EVP_add_alg_module(void); |
1306 | 1308 | ||