Lines Matching refs:ret

97     int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED;
99 ret = mbedtls_chacha20_setkey(&ctx->chacha20_ctx, key);
101 return ret;
108 int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED;
112 ret = mbedtls_chacha20_starts(&ctx->chacha20_ctx, nonce, 0U);
113 if (ret != 0) {
123 ret = mbedtls_chacha20_update(&ctx->chacha20_ctx, sizeof(poly1305_key),
125 if (ret != 0) {
129 ret = mbedtls_poly1305_starts(&ctx->poly1305_ctx, poly1305_key);
131 if (ret == 0) {
140 return ret;
161 int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED;
171 ret = chachapoly_pad_aad(ctx);
172 if (ret != 0) {
173 return ret;
180 ret = mbedtls_chacha20_update(&ctx->chacha20_ctx, len, input, output);
181 if (ret != 0) {
182 return ret;
185 ret = mbedtls_poly1305_update(&ctx->poly1305_ctx, output, len);
186 if (ret != 0) {
187 return ret;
190 ret = mbedtls_poly1305_update(&ctx->poly1305_ctx, input, len);
191 if (ret != 0) {
192 return ret;
195 ret = mbedtls_chacha20_update(&ctx->chacha20_ctx, len, input, output);
196 if (ret != 0) {
197 return ret;
207 int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED;
215 ret = chachapoly_pad_aad(ctx);
216 if (ret != 0) {
217 return ret;
220 ret = chachapoly_pad_ciphertext(ctx);
221 if (ret != 0) {
222 return ret;
234 ret = mbedtls_poly1305_update(&ctx->poly1305_ctx, len_block, 16U);
235 if (ret != 0) {
236 return ret;
239 ret = mbedtls_poly1305_finish(&ctx->poly1305_ctx, mac);
241 return ret;
254 int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED;
256 ret = mbedtls_chachapoly_starts(ctx, nonce, mode);
257 if (ret != 0) {
261 ret = mbedtls_chachapoly_update_aad(ctx, aad, aad_len);
262 if (ret != 0) {
266 ret = mbedtls_chachapoly_update(ctx, length, input, output);
267 if (ret != 0) {
271 ret = mbedtls_chachapoly_finish(ctx, tag);
274 return ret;
300 int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED;
304 if ((ret = chachapoly_crypt_and_tag(ctx,
307 return ret;
431 int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED;
442 ret = mbedtls_chachapoly_setkey(&ctx, test_key[i]);
443 ASSERT(0 == ret, ("setkey() error code: %i\n", ret));
445 ret = mbedtls_chachapoly_encrypt_and_tag(&ctx,
454 ASSERT(0 == ret, ("crypt_and_tag() error code: %i\n", ret));