File tree Expand file tree Collapse file tree 2 files changed +2
-3
lines changed
Expand file tree Collapse file tree 2 files changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -10,4 +10,3 @@ const ERR_PANIC = -106
1010
1111const EstimatedEncryptionOverhead = 48
1212const EstimatedEnvelopeOverhead = 185
13- const Base64Overhead = 1.34
Original file line number Diff line number Diff line change @@ -118,8 +118,8 @@ func SetupJson(configJson unsafe.Pointer) (result int32) {
118118
119119//export EstimateBuffer
120120func EstimateBuffer (dataLen int32 , partitionLen int32 ) int32 {
121- estimatedDataLen := float64 ( dataLen + EstimatedEncryptionOverhead ) * Base64Overhead
122- result := int32 (cobhan .BUFFER_HEADER_SIZE + EstimatedEnvelopeOverhead + EstimatedIntermediateKeyOverhead + int (partitionLen ) + int ( estimatedDataLen ) )
121+ estimatedDataLen := (( int ( dataLen ) + EstimatedEncryptionOverhead + 2 ) / 3 ) * 4
122+ result := int32 (cobhan .BUFFER_HEADER_SIZE + EstimatedEnvelopeOverhead + EstimatedIntermediateKeyOverhead + int (partitionLen ) + estimatedDataLen )
123123 return result
124124}
125125
You can’t perform that action at this time.
0 commit comments