From 102ef6a1b711e5cbbb1e8dfdd5040b6217c3b4df Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Wed, 8 Oct 2025 19:20:47 +0100 Subject: [PATCH] Fix calculation condition for SpamSum in write operations --- src/write.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/write.c b/src/write.c index c87b724..7f4b987 100644 --- a/src/write.c +++ b/src/write.c @@ -178,7 +178,7 @@ int32_t aaruf_write_sector(void *context, uint64_t sector_address, bool negative if(ctx->calculating_sha256 && !negative && sector_address <= ctx->imageInfo.Sectors && !ctx->writingLong) aaruf_sha256_update(&ctx->sha256_context, data, length); // Calculate SpamSum on-the-fly if requested and sector is within user sectors (not negative or overflow) - if(ctx->calculating_sha256 && !negative && sector_address <= ctx->imageInfo.Sectors && !ctx->writingLong) + if(ctx->calculating_spamsum && !negative && sector_address <= ctx->imageInfo.Sectors && !ctx->writingLong) aaruf_spamsum_update(ctx->spamsum_context, data, length); // Calculate BLAKE3 on-the-fly if requested and sector is within user sectors (not negative or overflow) if(ctx->calculating_blake3 && !negative && sector_address <= ctx->imageInfo.Sectors && !ctx->writingLong) @@ -669,7 +669,7 @@ int32_t aaruf_write_sector_long(void *context, uint64_t sector_address, bool neg if(ctx->calculating_sha256 && !negative && sector_address <= ctx->imageInfo.Sectors) aaruf_sha256_update(&ctx->sha256_context, data, length); // Calculate SpamSum on-the-fly if requested and sector is within user sectors (not negative or overflow) - if(ctx->calculating_sha256 && !negative && sector_address <= ctx->imageInfo.Sectors) + if(ctx->calculating_spamsum && !negative && sector_address <= ctx->imageInfo.Sectors) aaruf_spamsum_update(ctx->spamsum_context, data, length); // Calculate BLAKE3 on-the-fly if requested and sector is within user sectors (not negative or overflow) if(ctx->calculating_blake3 && !negative && sector_address <= ctx->imageInfo.Sectors)