Skip to content

Commit

Permalink
✅ Test
Browse files Browse the repository at this point in the history
  • Loading branch information
heliannuuthus committed Mar 30, 2024
1 parent 204c84e commit ec52ad3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 25 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
package io.ghcr.heliannuuthus.devtools.controller;

import static io.ghcr.heliannuuthus.devtools.crypto.parameters.OamParameters.*;

import io.ghcr.heliannuuthus.devtools.crypto.algorithms.MessageDigest;
import io.swagger.v3.oas.annotations.tags.Tag;
import java.util.stream.Stream;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.bouncycastle.jcajce.spec.EdDSAParameterSpec;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
Expand All @@ -22,25 +18,6 @@ public class EncryptionController {

@GetMapping("/encryption")
public Flux<String> algorithm() {
return Flux.fromStream(
Stream.concat(
Stream.of(EdDSAParameterSpec.Ed25519, EdDSAParameterSpec.Ed448),
Stream.of(ECDSA_ALGORITHM, RSA_ALGORITHM, SM2_ALGORITHM)
.flatMap(
alg ->
Stream.of(MessageDigest.values())
.map(md -> md.getValue() + CONNECTOR + alg))));
}

@GetMapping("/paddings")
public Flux<String> padding() {
return Flux.fromStream(
Stream.concat(
Stream.of(EdDSAParameterSpec.Ed25519, EdDSAParameterSpec.Ed448),
Stream.of(ECDSA_ALGORITHM, RSA_ALGORITHM, SM2_ALGORITHM)
.flatMap(
alg ->
Stream.of(MessageDigest.values())
.map(md -> md.getValue() + CONNECTOR + alg))));
return Flux.fromStream(Stream.of("AES", "RSA-OAEP", "ECIES"));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ void testRSAStreamEncrypt(Integer keySize, RSAEncryptionPadding padding) {
}

static Stream<Arguments> eciesStreamEncrypt() {
return Stream.of("secp256r1", "secp384r1", "secp521r1", "secp256k1").map(Arguments::of);
return Stream.of("secp256r1", "secp384r1", "secp521r1", "secp256k1", "curve25519")
.map(Arguments::of);
}

@ParameterizedTest
Expand Down

0 comments on commit ec52ad3

Please sign in to comment.