1 /* { dg-do compile } */
2 /* { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */
3 /* { dg-options "-ffat-lto-objects" } */
4 /* { dg-additional-options "-Wno-return-type" } */
6 typedef unsigned char uint8_t;
7 typedef unsigned int uint32_t;
9 typedef uint32_t u32bit;
10 __extension__ typedef __SIZE_TYPE__ size_t;
12 extern void __warn_memset_zero_len (void) __attribute__((__warning__ ("")));
13 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__))
14 void * memset (void *__dest, int __ch, size_t __len) throw () {
15 if (__builtin_constant_p (__len) && __len == 0)
16 __warn_memset_zero_len ();
19 inline void clear_mem(void* ptr, u32bit n) {
22 template<typename T> class MemoryRegion {
26 const T* begin() const {
28 void set(const T in[], u32bit n) {
31 void set(const MemoryRegion<T>& in) {
32 set(in.begin(), in.size());
35 clear_mem(buf, allocated);
43 mutable u32bit allocated;
45 template<typename T> void MemoryRegion<T>::create(u32bit n) {
50 template<typename T> class SecureVector : public MemoryRegion<T> {
52 SecureVector<T>& operator=(const MemoryRegion<T>& in) {
53 if(this != &in) this->set(in);
58 SecureVector<byte> bits_of() const {
60 OctetString& operator^=(const OctetString&);
61 void change(const MemoryRegion<byte>& in) {
64 OctetString(const MemoryRegion<byte>& in) {
67 SecureVector<byte> bits;
69 OctetString& OctetString::operator^=(const OctetString& k) {
74 bool __attribute__((flatten))
75 operator==(const OctetString& s1, const OctetString& s2) {
76 return (s1.bits_of() == s2.bits_of());