File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -88,15 +88,19 @@ function ciphertextMessageTypeToEnvelopeType(type: number) {
8888 ) ;
8989}
9090
91+ const PADDING_BLOCK = 80 ;
92+
9193function getPaddedMessageLength ( messageLength : number ) : number {
9294 const messageLengthWithTerminator = messageLength + 1 ;
93- let messagePartCount = Math . floor ( messageLengthWithTerminator / 160 ) ;
95+ let messagePartCount = Math . floor (
96+ messageLengthWithTerminator / PADDING_BLOCK
97+ ) ;
9498
95- if ( messageLengthWithTerminator % 160 !== 0 ) {
99+ if ( messageLengthWithTerminator % PADDING_BLOCK !== 0 ) {
96100 messagePartCount += 1 ;
97101 }
98102
99- return messagePartCount * 160 ;
103+ return messagePartCount * PADDING_BLOCK ;
100104}
101105
102106export function padMessage ( messageBuffer : Uint8Array ) : Uint8Array {
You can’t perform that action at this time.
0 commit comments