Dmitriy Pavlov, Your statement about page size is true. But our case about plainSize of serialized record in bytes. This method calculates it: plainSize(WALRecord record). For example, if you look in this method, you will see DATA_PAGE_UPDATE_RECORD section. A size of record calculates a sum of: 4 + 8 + 2 + 4 + uRec.payload().length where a length is an arbitrary number.
чт, 31 янв. 2019 г. в 14:54, Dmitriy Pavlov <dpav...@apache.org>: > Hi Maxim, why do you think that data size can be divided to cipher block > size with 0 remainder. > > I used to think that page size 4096 is always divisible by a usual block > cipher block size, e.g 32, 16 or 8 bytes > > чт, 31 янв. 2019 г. в 13:11, Максим Степачёв <maksim.stepac...@gmail.com>: > > > Hi, I have been trying to solve a problem with calculation size for > > encryption mode, it's ticket IGNITE-11129. But I found an additional > place > > for wrong behavior. I'm confused, Is it fine or wrong? Look at > > *KeystoreEncryptionSpi#encryptedSize*, the result calculation works as > > > > (dataSize / BLOCK_SZ + cntBlocks) * BLOCK_SZ; > > > > But we don't have a guarantee that dataSize is multiple of BLOCK_SZ. > > Should we use this code: > > > > ((dataSize + BLOCK_SZ - 1) / BLOCK_SZ + cntBlocks) * BLOCK_SZ; > > > > If yes, I'll fix it. > > >