Browse Source

fixed import org.bouncycastle.pqc.legacy.math.linearalgebra.ByteUtils, test added for EncryptionUtil

pull/10594/head
Sergey Matvienko 2 years ago
parent
commit
e532e0f2a9
  1. 2
      common/message/src/main/java/org/thingsboard/server/common/msg/EncryptionUtil.java
  2. 30
      common/message/src/test/java/org/thingsboard/server/common/msg/EncryptionUtilTest.java

2
common/message/src/main/java/org/thingsboard/server/common/msg/EncryptionUtil.java

@ -17,7 +17,7 @@ package org.thingsboard.server.common.msg;
import lombok.extern.slf4j.Slf4j;
import org.bouncycastle.crypto.digests.SHA3Digest;
import org.bouncycastle.pqc.math.linearalgebra.ByteUtils;
import org.bouncycastle.pqc.legacy.math.linearalgebra.ByteUtils;
/**
* @author Valerii Sosliuk

30
common/message/src/test/java/org/thingsboard/server/common/msg/EncryptionUtilTest.java

@ -0,0 +1,30 @@
/**
* Copyright © 2016-2024 The Thingsboard Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.thingsboard.server.common.msg;
import org.junit.jupiter.api.Test;
import static org.assertj.core.api.Assertions.assertThat;
class EncryptionUtilTest {
@Test
void getSha3Hash256Size() {
assertThat(EncryptionUtil.getSha3Hash("ThingsBoard"))
.isEqualTo("281c7ba06d0ac2ff651fa968572f26a38c96225ea54644522837b54b9c6144f7");
}
}
Loading…
Cancel
Save