Skip to content

Commit

Permalink
Add a few more anonymous namespaces around struts
Browse files Browse the repository at this point in the history
Later we'll probably want to square our preferred styles against this
stricter requirement. (Maybe we should just prefer to put everything
file-local in anonymous namespaces rather than mark things static? Not
sure. I don't like that it's hard to see whether something is static,
but if we have to use this for types anyway...)

Bug: 384186552
Change-Id: Ie86a56b1c7358a32262f0b9c4edb3e503aa3d08a
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/74547
Reviewed-by: Adam Langley <agl@google.com>
Commit-Queue: David Benjamin <davidben@google.com>
Auto-Submit: David Benjamin <davidben@google.com>
Commit-Queue: Adam Langley <agl@google.com>
  • Loading branch information
davidben authored and Boringssl LUCI CQ committed Dec 18, 2024
1 parent ca3146c commit 3dc7237
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions crypto/hrss/hrss.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1835,6 +1835,8 @@ static void poly_lift(struct poly *out, const struct poly *a) {
poly_normalize(out);
}

namespace {

struct public_key {
struct poly ph;
};
Expand All @@ -1845,6 +1847,8 @@ struct private_key {
uint8_t hmac_key[32];
};

} // namespace

// public_key_from_external converts an external public key pointer into an
// internal one. Externally the alignment is only specified to be eight bytes
// but we need 16-byte alignment. We could annotate the external struct with
Expand Down
4 changes: 4 additions & 0 deletions crypto/kyber/kyber.cc
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,8 @@ static void vector_decompress(vector *a, int bits) {
}
}

namespace {

struct public_key {
vector t;
uint8_t rho[32];
Expand Down Expand Up @@ -607,6 +609,8 @@ static struct private_key *private_key_from_external(
return (struct private_key *)external;
}

} // namespace

// Calls |KYBER_generate_key_external_entropy| with random bytes from
// |RAND_bytes|.
void KYBER_generate_key(uint8_t out_encoded_public_key[KYBER_PUBLIC_KEY_BYTES],
Expand Down

0 comments on commit 3dc7237

Please sign in to comment.