diff --git a/xwiki-commons-core/xwiki-commons-crypto/xwiki-platform-crypto-common/src/main/java/org/xwiki/crypto/internal/digest/BouncyCastleDigest.java b/xwiki-commons-core/xwiki-commons-crypto/xwiki-platform-crypto-common/src/main/java/org/xwiki/crypto/internal/digest/BouncyCastleDigest.java
index <HASH>..<HASH> 100644
--- a/xwiki-commons-core/xwiki-commons-crypto/xwiki-platform-crypto-common/src/main/java/org/xwiki/crypto/internal/digest/BouncyCastleDigest.java
+++ b/xwiki-commons-core/xwiki-commons-crypto/xwiki-platform-crypto-common/src/main/java/org/xwiki/crypto/internal/digest/BouncyCastleDigest.java
@@ -76,12 +76,14 @@ public class BouncyCastleDigest implements Digest
     @Override
     public FilterInputStream getInputStream(InputStream is)
     {
+        digest.reset();
         return new DigestInputStream(is, digest);
     }
 
     @Override
     public OutputStream getOutputStream()
     {
+        digest.reset();
         return new org.bouncycastle.crypto.io.DigestOutputStream(digest);
     }
XWIKI-<I>: New Crypto Service API

- Properly reset digest as documented in comments