mirror of
https://github.com/henrydcase/pqc.git
synced 2024-11-22 23:48:58 +00:00
Fix memory leaks in LEDAkem
This commit is contained in:
parent
0912b1821c
commit
d8c9c431cf
@ -81,7 +81,7 @@ int PQCLEAN_LEDAKEMLT12_LEAKTIME_seedexpander(AES_XOF_struct *ctx, uint8_t *x, s
|
|||||||
memcpy(x + offset, ctx->buffer + ctx->buffer_pos, xlen);
|
memcpy(x + offset, ctx->buffer + ctx->buffer_pos, xlen);
|
||||||
ctx->buffer_pos += xlen;
|
ctx->buffer_pos += xlen;
|
||||||
|
|
||||||
return RNG_SUCCESS;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
// take what's in the buffer
|
// take what's in the buffer
|
||||||
@ -103,7 +103,8 @@ int PQCLEAN_LEDAKEMLT12_LEAKTIME_seedexpander(AES_XOF_struct *ctx, uint8_t *x, s
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
aes256_ctx_release(&ctx256);
|
end:
|
||||||
|
|
||||||
|
aes256_ctx_release(&ctx256);
|
||||||
return RNG_SUCCESS;
|
return RNG_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -81,7 +81,7 @@ int PQCLEAN_LEDAKEMLT32_LEAKTIME_seedexpander(AES_XOF_struct *ctx, uint8_t *x, s
|
|||||||
memcpy(x + offset, ctx->buffer + ctx->buffer_pos, xlen);
|
memcpy(x + offset, ctx->buffer + ctx->buffer_pos, xlen);
|
||||||
ctx->buffer_pos += xlen;
|
ctx->buffer_pos += xlen;
|
||||||
|
|
||||||
return RNG_SUCCESS;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
// take what's in the buffer
|
// take what's in the buffer
|
||||||
@ -103,6 +103,7 @@ int PQCLEAN_LEDAKEMLT32_LEAKTIME_seedexpander(AES_XOF_struct *ctx, uint8_t *x, s
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
end:
|
||||||
aes256_ctx_release(&ctx256);
|
aes256_ctx_release(&ctx256);
|
||||||
|
|
||||||
return RNG_SUCCESS;
|
return RNG_SUCCESS;
|
||||||
|
@ -81,7 +81,7 @@ int PQCLEAN_LEDAKEMLT52_LEAKTIME_seedexpander(AES_XOF_struct *ctx, uint8_t *x, s
|
|||||||
memcpy(x + offset, ctx->buffer + ctx->buffer_pos, xlen);
|
memcpy(x + offset, ctx->buffer + ctx->buffer_pos, xlen);
|
||||||
ctx->buffer_pos += xlen;
|
ctx->buffer_pos += xlen;
|
||||||
|
|
||||||
return RNG_SUCCESS;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
// take what's in the buffer
|
// take what's in the buffer
|
||||||
@ -103,6 +103,7 @@ int PQCLEAN_LEDAKEMLT52_LEAKTIME_seedexpander(AES_XOF_struct *ctx, uint8_t *x, s
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
end:
|
||||||
aes256_ctx_release(&ctx256);
|
aes256_ctx_release(&ctx256);
|
||||||
|
|
||||||
return RNG_SUCCESS;
|
return RNG_SUCCESS;
|
||||||
|
Loading…
Reference in New Issue
Block a user